1

I am trying to connect my PSR-A3000 keyboard to play some midi files from computer. When I run the code:

import java.io.File;
import java.io.IOException;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Sequence;


public class jFugeFilePlayer {



    public static void main(String args[]) {
        DeviceThatWillReceiveMidi device = null;
        device = new DeviceThatWillReceiveMidi(); // handle MIDI Unavailable Exception
        Sequence sequence = null;

        try {
            sequence = MidiSystem.getSequence(new File("/Users/path.../baharanMelody.midi"));
        } catch (InvalidMidiDataException e) {
            // handle Invalid MIDI Data Exception
        } catch (IOException e) {
            // handle IO Exception
            e.printStackTrace();
        }
        device.setSequence(sequence);

    }
}

I see the post here have the similar issue and Can't go beyong another exception on "device.sendSequence". JFugue 5 external midi device

I get the error:

Building renderMidi 1.0-SNAPSHOT
------------------------------------------------------------------------

--- exec-maven-plugin:1.5.0:exec (default-cli) @ renderMidi ---
Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
    at DeviceThatWillReceiveMidi.setSequence(DeviceThatWillReceiveMidi.java:17)
    at jFugeFilePlayer.main(jFugeFilePlayer.java:34)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
------------------------------------------------------------------------
BUILD FAILURE

I have tried javaxsound.midi.MidiSystem and It confirms that my devices work correctly. I have added the stack trace to see if I can help.

Any ideas on what I am doing wrong please?

Any help would be greatly appreciated.

CS

chikitin
  • 762
  • 6
  • 28
  • `UnsupportedOperationException: Not supported yet` your JVM does not implement this. – CL. Mar 19 '19 at 06:59
  • If you're using DeviceThatWillReceiveMidi, then you're using a very old version of JFugue (version 4.x). I strongly recommend you upgrade to JFugue 5.0.9 and use MusicReceiver, MusicTransmitterToParserListener, and/or MusicTransmitterToSequence. – David Koelle Mar 19 '19 at 14:42
  • Ok! The software is free however, one have only access to the API with very little information in it. The guide is 25 dollars! I would buy it if I was sure if it was going to work. Why not having say 10 day limited access to their API or something. I guess I am going to use coreMidi4j or Apple's core midi framework. At least I know the latter will work reliably. – chikitin Mar 21 '19 at 01:47

0 Answers0