flush spam: Any way to filter the Sysex input on port?

Post Reply New Topic
RELATED
PRODUCTS

Post

Hey there,
I'm currently working on a clip launcher for the Embodme Erae 2, and I'd say I'm almost there.

My main problem left (I think) is that the device sends hi resolution finger position data (and many other parameters) via sysex I dont need most of the time and therefore spams hundreds of flush-function-calls.

At first, I thought this is because of a bug induced by my (quite limited) javascript skills.
So I made a test Script which does nothing but getting the raw Sysex data in and realized, it spams it on the most fundamental level, like so:

Code: Select all

loadAPI(21);

SYX_PREFIX = 'F0 00 21 50 00 01 00 02';
	
SYX_API_ON = '01 01 04 01';
SYX_API_OFF = '01 01 04 02';
REC_PREFIX = '7D';

SYX_END = 'F7';

host.setShouldFailOnDeprecatedUse(true);

host.defineController("Embodme", "Erae 2 Sysex Test", "0.1", "33d6b7eb-95c5-4fdd-9efb-649b2cf6e3db", "TheYke");

host.defineMidiPorts(1, 1);

function init() {
   host.getMidiInPort(0).setSysexCallback(onSysex0);

	// TURN SYSEX API ON
	sendSysex (SYX_PREFIX + SYX_API_ON + REC_PREFIX + SYX_END);

   println("Erae 2 Sysex Test initialized!");
}

// Called when a MIDI sysex message is received on MIDI input port 0.
function onSysex0(data) {
}

function flush() {
	println("called flush");
   // TODO: Flush any output to your controller here.
}

function exit() {
	// DISABLE SYSEX API
	sendSysex (SYX_PREFIX + SYX_API_OFF + REC_PREFIX + SYX_END);
}
Is there any way to filter the amount of Sysex data triggering the onSysex0-function and therefore the flush?

Any help would be much appreciated as I'm almost there and spent months and witnessed massive headaches to get to where I am now (I started basically at zero javascript knowledge). :lol:

Thanks in advance.

Post Reply

Return to “Controller Scripting”