Missing NoteOff messages using a Sensel Morph on Bela

Hey people!

I’ve got this problem with SuperCollider running on a Sensel Morph, getting the MPE XYZ data for each finger. From the fourth finger on, I apparently get so many midi messages, that NoteOff messages are being missed, resulting in an endless drone. It works without problem, if I ignore one of the dimensions of each finger.

I have written more about it in the Bela forum, but maybe you also have an idea, how to solve this software wise? Meaning - is there a way to slow down or reducing incoming midi messages from SC, without using an external library or class? Had the impresseion so far, that running custom classes on the Bela is also some kind of a hassle…

Here is the post:
https://forum.bela.io/d/3090-using-bela-sensel-supercollider-noteoff-messages-misseds

Looking forward to answers and thank you!

Anybody has an idea? This is killing me :confused:

I think Alberto de Campo wrote this a number of years ago. I use it with OSC data:

SpeedLimit {
	var <>action, <>dt;
	var <now, <lastTime, <delta, <scheduled = false, <latestArgs;

	*new { |action, dt = 0.1|
		^super.newCopyArgs(action, dt).init
	}
	init {
		now = lastTime = Main.elapsedTime;
	}

	filterValue { |...args|
		now = Main.elapsedTime;
		delta = now - lastTime;

		if (delta >= dt) {
			action.value(*args);
			lastTime = now;
			^this
		};
		// do it later:
		latestArgs = args;
		if (scheduled.not) {
			scheduled = true;
			SystemClock.sched(dt - delta, {
				action.value(*latestArgs);
				lastTime = Main.elapsedTime;
				scheduled = false;
			})
		}
	}

	value {|...args|
		this.filterValue(*args);
	}
}
1 Like

Here is the usage:

a = SpeedLimit({|num| num.postln;}, 0.1);

({
	100.do{|i|
		a.filterValue(i);
		0.01.wait;
	}
}.fork)