We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi!
I just downloaded Processing 3.0.1, and TheMidiBus library from the built-in library manager. I have connected to my computer a KORG NanoKey 2 for testing purposes (And have already installed its drivers).
When I run this sample code https://github.com/sparks/themidibus/blob/master/examples/Basic/Basic.pde
I get this list of available MIDI 'devices' after this line MidiBus.list();
is executed:
Available MIDI Devices:
----------Input----------
[0] "KEYBOARD"
[1] "Real Time Sequencer"
----------Output----------
[0] "Gervill"
[1] "CTRL"
[2] "Real Time Sequencer"
0 is my connected MIDI keyboard code, and its name is "KEYBOARD"
.
Now, there's this line:
myBus = new MidiBus(this, -1, "Java Sound Synthesizer");
in which you create a new IO bus like this
myBus = new MidiBus(this, INPUT_CODE_OR_NAME, OUTPUT_CODE_OR_NAME);
So I change the -1 from the sample at the place I've noted as INPUT_CODE_OR_NAME
to 0 (the value of my MIDI Keyboard, would work the same if I wrote "KEYBOARD" there), so that the input 'device' becomes the MIDI keyboard.
Everytime an event is received from this input device, this function will be invoked:
void noteOn(int channel, int pitch, int velocity)
...and it does work, everytime I press any key on the MIDI keyboard, the program prints its values as intended.
Now, my problem is with the output 'device'.
Any 'device' specified as output will get its signals with this function:
myBus.sendNoteOn(channel, pitch, velocity);
The example has by default the name of "Java Sound Synthesizer"
as its output 'device', which is a 'device' that when it gets any signal, it plays the sound in the computer's speakers. I know this because long time ago I did this same thing with Processing 2.0, and in fact, it did play the sounds on the speakers. Now, this "Java Sound Synthesizer"
'device' doesn't show up as an available output 'device', so I get this error when I try to run the sample as-is:
The MidiBus Warning: No available input MIDI devices named: "Java Sound Synthesizer" were found
Now, I try setting any of the other listed output 'devices' as output,
0 or "Gervill"
1 or "CTRL"
2 or "Real Time Sequencer"
and I get no error, but none works as I need it to, that is, sending sounds to the computer speakers just like "Java Sound Synthesizer"
did.
Any idea on how can I get sounds to the computer speakers, or finding out how to fix this missing Java Sound Synthesizer thing? Thanks!