     pitch = 127 / 2 * (potentiometer_reading * (RANGE / 1023.0) - note) + 127 / 2;
 
     // Transpose on the right octave
-    octave = map(analogRead(OCTAVE_PIN), 0, 1023, 0, 8);
     note += 12 * octave;
 
     if(velocity && pitch != last_midi_pitch) {

char note;
int pitch;
char octave = 4;

void setup() {
    pinMode(LED_TOO_HIGH_PIN, OUTPUT);
    pinMode(LED_EXACT_PIN, OUTPUT);
    pinMode(LED_TOO_LOW_PIN, OUTPUT);

    #ifdef DEBUG
    Serial.begin(9600);
    #else
    MIDI.begin();
    // All Notes Off
    MIDI.sendControlChange(123, 0, MIDI_CHANNEL);
    #endif
}

/* This is retarded. In theory, we don't need this line of code but
 * there seems to be a bug in the MIDI library.

#define     MIDI_PITCHBEND_MIN  -8192.0
#define     MIDI_PITCHBEND_MAX  8191.0

#define     LED_1               11
#define     LED_2               10
#define     LED_3               9

/* If the potentiometer reading is greater than
 * MovingAverage plus/minus this value, the average is reset
 */
#define     PORTAMENTO_TOLERENCE    90

// Minimumn value for a valid force sensor reading
#define     FORCE_SENSOR_TOLERENCE  20

// This value is used in indicative_lights()
#define     TUNING_TOLERENCE     4
