Skip to content

Commit

Permalink
Fix typos that were using the wrong variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Kopp committed Dec 30, 2019
1 parent fc01253 commit 1fd5b32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ls_handleTouches.ino
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void transferToSameRowCell(byte col) {
toCell->fxdPrevTimbre = sensorCell->fxdPrevTimbre;
toCell->velocity = sensorCell->velocity;
toCell->noteInitialVelocity = sensorCell->noteInitialVelocity;
toCell->noteInitialMaxValueZHi = fromCell->noteInitialMaxValueZHi;
toCell->previousValueZHi = fromCell->previousValueZHi;
toCell->noteInitialMaxValueZHi = sensorCell->noteInitialMaxValueZHi;
toCell->previousValueZHi = sensorCell->previousValueZHi;
toCell->vcount = sensorCell->vcount;
noteTouchMapping[sensorSplit].changeCell(toCell->note, toCell->channel, col, sensorRow);

Expand Down
8 changes: 4 additions & 4 deletions ls_midi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ void preResetLastLoudness(byte split, byte note, byte channel) {
// Called to send Z message. Depending on midiMode, sends different types of Channel Pressure or Poly Pressure message.
void preSendLoudness(byte split, byte pressureValueLo, short pressureValueHi, byte note, byte channel) {

if (Split[sensorSplit].curveForZ != aftertouchCurve) {
if (Split[split].curveForZ != aftertouchCurve) {
// SPECIAL HANDLING FOR ATTACK
// (The purpose of this is to ignore the finger's bounce-back from the hard surface)
#define ATTACK_MS 50
Expand Down Expand Up @@ -2014,13 +2014,13 @@ void preSendLoudness(byte split, byte pressureValueLo, short pressureValueHi, by

// Handle the curves

if (Split[sensorSplit].curveForZ == aftertouchCurve) {
if (Split[split].curveForZ == aftertouchCurve) {
// clip and rescale the top 25% to be the full 100%
// with the bottom 75% being considered zero
pressureValueHi = constrain(pressureValueHi-762, 0, 254)*4;
pressureValueLo = scale1016to127(pressureValueHi, true);
}
else if (Split[sensorSplit].curveForZ == cubicCurve) {
else if (Split[split].curveForZ == cubicCurve) {
// cubic
// TODO: This curve could be precomuputed and stored in memory to improve speed,
// but it seems the microcontroller is fast enough that this is unnecessary.
Expand Down Expand Up @@ -2052,7 +2052,7 @@ void preSendLoudness(byte split, byte pressureValueLo, short pressureValueHi, by
// linearCurve
pressureValueHi = applyLimits1016(pressureValueHi, Split[split].minForZ, Split[split].maxForZ, fxdLimitsForZRatio[split]);
pressureValueLo = applyLimits(pressureValueLo, Split[split].minForZ, Split[split].maxForZ, fxdLimitsForZRatio[split]);
}
}

// scale 1016 to 16383 and fill out with the low resolution in order to reach the full range at maximum value
pressureValueHi = (pressureValueHi * 16 + pressureValueLo) & 0x3FFF;
Expand Down

0 comments on commit 1fd5b32

Please sign in to comment.