Skip to content

Commit

Permalink
Send Loudness/Z immediately both before and after sending note-on, to…
Browse files Browse the repository at this point in the history
… try to preserve backwards-compatibility with past Linnstrument firmwares that send this after the note-on message. I'm not sure, but I think this might be important for some synths, especially when poly-pressure is used.
  • Loading branch information
Nathan Kopp committed Dec 30, 2019
1 parent 9de04a0 commit fc01253
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ls_handleTouches.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1293,18 +1293,29 @@ void sendNewNote() {
if (Split[sensorSplit].sendZ && isZExpressiveCell()) {

if(Split[sensorSplit].curveForZ == aftertouchCurve) {

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

// send the note on
midiSendNoteOn(sensorSplit, sensorCell->note, sensorCell->velocity, sensorCell->channel);
}
else {
unsigned short valueZHiFromVelocity = VELOCITYZ_TO_PRESSUREZ(sensorCell->velocity*1016/127);
if(valueZHiFromVelocity>508 && valueZHiFromVelocity > valueZHi) valueZHi = valueZHiFromVelocity;
byte valueZ = scale1016to127(valueZHi, false);

preSendLoudness(sensorSplit, valueZ, valueZHi, sensorCell->note, sensorCell->channel);

// send the note on
midiSendNoteOn(sensorSplit, sensorCell->note, sensorCell->velocity, sensorCell->channel);

preSendLoudness(sensorSplit, valueZ, valueZHi, sensorCell->note, sensorCell->channel);
}
}

// send the note on
midiSendNoteOn(sensorSplit, sensorCell->note, sensorCell->velocity, sensorCell->channel);
else {
// send the note on
midiSendNoteOn(sensorSplit, sensorCell->note, sensorCell->velocity, sensorCell->channel);
}
}
}

Expand Down

0 comments on commit fc01253

Please sign in to comment.