diff --git a/ressource arduino/MidiHallSynthChrom/MidiHallSynthChrom.ino b/ressource arduino/MidiHallSynthChrom/MidiHallSynthChrom.ino index 4c7878e..0abd6ee 100644 --- a/ressource arduino/MidiHallSynthChrom/MidiHallSynthChrom.ino +++ b/ressource arduino/MidiHallSynthChrom/MidiHallSynthChrom.ino @@ -8,7 +8,7 @@ bool EtatEntree28 = HIGH ; bool VarSuivi28 = HIGH ; -void setup() ² +void setup() { pinMode(24,INPUT); @@ -36,22 +36,64 @@ void loop() { EtatEntree24 = digitalRead(24); - EtatEntree26 = digitalRead(24); - EtatEntree28 = digitalRead(24); + EtatEntree26 = digitalRead(26); + EtatEntree28 = digitalRead(28); if ( (EtatEntree24 != VarSuivi24) && (EtatEntree24 == HIGH) ) { noteOn(0x80, 0x24 , 0x00) ; /* note off sur canal1 ; C2 ; vel 0 */ /* Serial.println("touche lachee"); */ - VarSuivi = HIGH; + VarSuivi24 = HIGH; } - if ( (EtatEntree != VarSuivi) && (EtatEntree == LOW) ) + if ( (EtatEntree24 != VarSuivi24) && (EtatEntree24 == LOW) ) { noteOn(0x90, 0x24 , 0x70) ; /* note on sur canal1 ; C2 ; vel */ /* Serial.println("touche appuyee"); */ - VarSuivi = LOW; + VarSuivi24 = LOW; } + if ( (EtatEntree26 != VarSuivi26) && (EtatEntree26 == HIGH) ) + { + noteOn(0x80, 0x26 , 0x00) ; /* note off sur canal1 ; D2 ; vel 0 */ + /* Serial.println("touche lachee"); */ + VarSuivi26 = HIGH; + } + + if ( (EtatEntree26 != VarSuivi26) && (EtatEntree26 == LOW) ) + { + noteOn(0x90, 0x26 , 0x70) ; /* note on sur canal1 ; D2 ; vel */ + /* Serial.println("touche appuyee"); */ + VarSuivi26 = LOW; + } + + if ( (EtatEntree28 != VarSuivi28) && (EtatEntree28 == HIGH) ) + { + noteOn(0x80, 0x28 , 0x00) ; /* note off sur canal1 ; C2 ; vel 0 */ + /* Serial.println("touche lachee"); */ + VarSuivi28 = HIGH; + } + + if ( (EtatEntree28 != VarSuivi28) && (EtatEntree28 == LOW) ) + { + noteOn(0x90, 0x28 , 0x70) ; /* note on sur canal1 ; C2 ; vel */ + /* Serial.println("touche appuyee"); */ + VarSuivi28 = LOW; + } + + + + + + + + + + + + + + + /* // play notes from F#-0 (0x1E) to F#-5 (0x5A):