RWMidi question: How do i get channel and length of a midi note?
in
Contributed Library Questions
•
2 months ago
My friend has a KORG Electribe and i'm trying to receive his MIDI data. It works with note.getPitch(); but the synth sounds work on channels 1 to 5 and the kick works on channel 10. So there are two note.getPitch values that are two different sounds, is there a way to seperate these? Something like:
if (note.getChannel == 10){
dataKick = note.getPitch();
}
and
if (note.getChannel == 5){
dataSynth = note.getPitch();
}
Also the length of the synth is kinda important, especially when you use apreggiators. But i can't seem to find the length of a note? Only the velocity, wich is always 120 with a KORG Electribe. Or is it a noteOff singal that is begin send ?
Here's my code:
- import rwmidi.*;
- MidiInput input;
- MidiOutput output;
- void setup() {
- input = RWMidi.getInputDevices()[0].createInput(this);
- output = RWMidi.getOutputDevices()[0].createOutput();
- }
- void noteOnReceived(Note note) {
- println("note on " + note.getPitch());
- }
- void sysexReceived(rwmidi.SysexMessage msg) {
- println("sysex " + msg);
- }
- void mousePressed() {
- int ret = output.sendNoteOn(0, 3, 3);
- ret = output.sendSysex(new byte[] {(byte)0xF0, 1, 2, 3, 4, (byte)0xF7});
- }
- void draw() {
- }
1