From 233762dd1af0dd25a75231c3abda697ca5a7ec93 Mon Sep 17 00:00:00 2001 From: CHRISTOPHE Date: Fri, 27 Dec 2019 20:53:52 +0100 Subject: [PATCH] =?UTF-8?q?changement=20de=20port=20s=C3=A9rie=20et=20ajou?= =?UTF-8?q?t=20de=20commentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MidiHallSynth32/MidiHallSynth32.ino | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ressource arduino/MidiHallSynthChrom/MidiHallSynth32/MidiHallSynth32.ino b/ressource arduino/MidiHallSynthChrom/MidiHallSynth32/MidiHallSynth32.ino index b0616f5..e697403 100644 --- a/ressource arduino/MidiHallSynthChrom/MidiHallSynth32/MidiHallSynth32.ino +++ b/ressource arduino/MidiHallSynthChrom/MidiHallSynth32/MidiHallSynth32.ino @@ -74,9 +74,9 @@ int RegistreC = 0xFF ; /* initialisation registre C */ int RegistreL = 0xFF ; /* initialisation registre L */ + /* variable pour l'utilisation du port A */ - -int EPA0 = B00000001 ; /* variable pour l'utilisation du port A */ +int EPA0 = B00000001 ; /* Etat A0 du Port A */ int EPA1 = B00000010 ; // int EPA2 = B00000100 ; // int EPA3 = B00001000 ; // @@ -85,7 +85,7 @@ int EPA5 = B00100000 ; // int EPA6 = B01000000 ; // int EPA7 = B10000000 ; // -int DePA0 = 1 ; // +int DePA0 = 1 ; /* Dernier etat de A0 du port A */ // int DePA1 = 2 ; // int DePA2 = 4 ; // int DePA3 = 8 ; // @@ -221,17 +221,16 @@ void setup() - Serial.begin(31250); /* initialisation d'un port serie au debit MIDI */ + Serial2.begin(31250); /* initialisation du port serie 2 broche 16 au debit MIDI */ - for (int i=0x24 ; i<= 0x43 ; i++ ) + for (int i=0x24 ; i<= 0x43 ; i++ ) /* boucle de mise d'extinction des notes */ { noteOn( 0x80, i , 0x00 ) ; - } delay(2000); } -/* +/*EXEMPLE INITIAL void noteOn(int cmd, int pitch, int velocity) /* plays a MIDI note. Doesn't check to see that cmd is greater than 127, or that data values are less than 127 */ @@ -266,7 +265,7 @@ void loop() EPA6 = RegistreA & Masque64 ; EPA7 = RegistreA & Masque128 ; - if ( ( EPA0 == 0 ) && ( DePA0 == 1 ) ) { noteOn(0x90, 0x24 , 0x90 ) ; } + if ( ( EPA0 == 0 ) && ( DePA0 == 1 ) ) { noteOn(0x90, 0x24 , 0x90 ) ; } /* si etat A0=0 et Dernier etat A0=1 , jouer la note */ if ( ( EPA0 == 1 ) && ( DePA0 == 0 ) ) { noteOn(0x80, 0x24 , 0x00 ) ;} if ( ( EPA1 == 0 ) && ( DePA1 == Masque2 ) ) {noteOn(0x90, 0x25 , 0x70 ) ;} @@ -397,10 +396,8 @@ void loop() - - - - DePA0 = EPA0 ; /* port A */ + /* port A */ + DePA0 = EPA0 ; /* Dernier etat = etat : réinitialisation des etats avant rebouclage et lecture */ DePA1 = EPA1 ; DePA2 = EPA2 ; DePA3 = EPA3 ; @@ -448,6 +445,3 @@ void loop() } - - -