- Edited
Hey there! I am running a setup that is receiving the MIDI data from a Sensel Morph in Bela using SuperCollider. Basically I want to receive MPE XYZ data for up to five fingers. Apparently all of this is too much for Bela, as pretty often NoteOff messages are missed, when I start MIDIdefs for all three directions. If I am leaving out one of them, I get reliable NoteOn and NoteOff messages, also when running the same code on my MacBook.
Do you have any ideas how to tackle this? For example is there a way to slow down the frame rate of the incoming messages in the MIDIdef?
Here is my code - counting up the n in the loop is intentional, as I am storing the synths into an array counting up from 0, but the channel of the incoming fingers start at 1.
~sensel = 5.collect({
arg n;
n = n+1;
MIDIdef.noteOn("\noteOn" ++ n, {
arg vel, nn, chan, src;
~notes[chan-1] = Synth.new(
\tone,
[
\freq, nn.midicps,
\amp, vel,
\gate, 1,
\bend, 0,
]
);
}, chan: n);
MIDIdef.noteOff("\noteOff" ++ n, {
arg vel, nn, chan, src;
~notes[chan-1].set(\gate, 0);
~notes[chan-1] = nil;
}, chan: n);
MIDIdef.bend(("pitch" ++ n).asSymbol, {
arg val, chan, src;
~notes[chan-1].set(\pitch, val);
}, chan: n);
MIDIdef.cc(("bend" ++ n).asSymbol, {
arg val, num, chan, src;
~notes[chan-1].set(\bend, val);
}, 74, chan: n);
MIDIdef.touch(("touch" ++ n).asSymbol, {
arg val, chan, src;
~notes[chan-1].set(\amp, val);
}, chan: n);
});