Possible fix for approx 10ms gap in pressure response after note on

Official support for: rogerlinndesign.com
RELATED
PRODUCTS

Post

There has been some talk on these forums and elsewhere of a small gap between note on and pressure being sent over midi. There are times in a synth patch where you want velocity to control the peak of a sharp attack but then hand over control to pressure for further volume shaping (e.g. to swell beyond the initial attack peak). In some cases, the 10ms gap where pressure is being read as 0 can be a problem. I think I've isolated the cause of this gap in the firmware and a fix for this, but I'd really love some feedback about whether my fix is appropriate!

Basically, as per the MPE standard, immediately before note on is sent, a pressure value of 0 is sent. This is handled by line 1258 in the sendNewNote function in ls_handleTouches.ino:

preSendLoudness(sensorSplit, 0, 0, sensorCell->note, sensorCell->channel);

For zero readings, this function skips the midi decimation timer (which rate limits the number of pressure messages sent per second) to ensure that it is guaranteed to be sent. However, sending this zero *starts* the decimation timer, which means that the next pressure value won't be sent until the rate limit has passed, basically guaranteeing that there will *always* be a gap between note on and the first pressure reading. There's a handy function already available to temporarily disable the rate limit by resetting the timer. So we can call that function directly after the line above, and the delay should be removed, so we add the following at line 1259:

preResetLastLoudness(sensorSplit, sensorCell->note, sensorCell->channel);

This works beautifully in my testing - the first real pressure reading is sent very quickly after note on. But this is my first attempt to edit the firmware, so would be keen to get any views on whether what I've done is sensible!

Cheers!
Simon

Post Reply

Return to “Roger Linn Design”