Skip to content

Commit

Permalink
Version 6: Improve speed of the new velocity calculation (less lag); …
Browse files Browse the repository at this point in the history
…when feature for leaving AT at non-zero value is not enabled, force sending loudness of zero before sending note-off, regardless of MIDI message traffic;
  • Loading branch information
Nathan Kopp committed Mar 9, 2020
1 parent de5167b commit 9bc9b5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions linnstrument-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ For any questions about this, contact Roger Linn Design at support@rogerlinndesi
/******************************************** CONSTANTS ******************************************/

const char* OSVersion = "222.";
const char* OSVersionBuild = ".K05";
const char* OSVersionBuild = ".K06";

// SPI addresses
#define SPI_LEDS 10 // Arduino pin for LED control over SPI
Expand Down Expand Up @@ -242,7 +242,7 @@ const unsigned short ccFaderDefaults[8] = {1, 2, 3, 4, 5, 6, 7, 8};
#define VELOCITY_SCALE_LOW 43
#define VELOCITY_SCALE_MEDIUM 41
#define VELOCITY_SCALE_HIGH 40
#define VELOCITY2_MAX_SAMPLES 8 // cannot be more than 63, due to 6-bit storage of vcount
#define VELOCITY2_MAX_SAMPLES 6 // cannot be more than 63, due to 6-bit storage of vcount

#define DEFAULT_MIN_VELOCITY 1 // default minimum velocity value
#define DEFAULT_MAX_VELOCITY 127 // default maximum velocity value
Expand Down
2 changes: 1 addition & 1 deletion ls_handleTouches.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ void handleTouchRelease() {
// reset the pressure when the note is released, but only for the afterTouch curve
if (Split[sensorSplit].sendZ && isZExpressiveCell()) {
if(Split[sensorSplit].curveForZ == aftertouchCurve || !Split[sensorSplit].releasePreserveLastZ) {
preSendLoudness(sensorSplit, 0, 0, sensorCell->note, sensorCell->channel, false);
preSendLoudness(sensorSplit, 0, 0, sensorCell->note, sensorCell->channel, true);
}
}

Expand Down
4 changes: 2 additions & 2 deletions ls_touchInfo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ VelocityState calcVelocity(unsigned short z) {
return velocityNew;
}
else if (z <= sensorCell->maxVelocityZ) {
// if we see the same or lower value for 3 samples in a row, then consider that we've hit the peak
if (sensorCell->vcount2>2)
// if we see the same or lower value for 2 samples in a row, then consider that we've hit the peak
if (sensorCell->vcount2>1)
{
sensorCell->velocity = calcPreferredVelocity(sensorCell->maxVelocityZ);
sensorCell->vcount = VELOCITY2_MAX_SAMPLES + 1;
Expand Down

0 comments on commit 9bc9b5e

Please sign in to comment.