 #define     MIDI_PITCHBEND_MIN  -8192.0
 #define     MIDI_PITCHBEND_MAX  8191.0
 
-#define     LED_TOO_HIGH_PIN    11
-#define     LED_EXACT_PIN       10
-#define     LED_TOO_LOW_PIN     9
+#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
+#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

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.

/**
 * 
 *
 * @param octave The current octave
 */
void indicative_lights(char octave) {

    digitalWrite(LED_1, (octave & 1 ? HIGH : LOW));
    digitalWrite(LED_2, (octave & 2 ? HIGH : LOW));
    digitalWrite(LED_3, (octave & 4 ? HIGH : LOW));

    #ifdef DEBUG
    Serial.print("Current octave & values : ");
    Serial.print((int) octave);
    Serial.print(" ");
    Serial.print( ((octave & 1)));
    Serial.print(" ");
    Serial.print((int) ((octave & 2)));
    Serial.print(" ");
    Serial.print((int) ((octave & 4)));
    Serial.print(" ");
    #endif
}

void setup() {
    pinMode(LED_1, OUTPUT);
    pinMode(LED_2, OUTPUT);
    pinMode(LED_3, OUTPUT);

    indicative_lights(octave);

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

void loop() {

    velocity = map(analogRead(FORCE_SENSOR_PIN), 0, 1000, 0, 127);
    velocity = velocity > FORCE_SENSOR_TOLERENCE ? velocity : 0; // Force sensor uncertainty

    potentiometer_reading = analogRead(POTENTIOMETER_PIN);

    // Zero values aren't welcomed in MovingAverage class
    if(!potentiometer_reading) {
        return;
    }

    // Read current octave and display on indicative lights
    octave = map(analogRead(OCTAVE_PIN), 0, 1023, 0, 8);

    // Update lights
    if(octave != last_octave) {
        indicative_lights(octave);
        last_octave = octave;
    }

    if(potentiometer_reading > potentiometer_reading_average.average() + PORTAMENTO_TOLERENCE ||
