essai avec 24 capteurs

This commit is contained in:
CHRISTOPHE 2019-10-18 21:48:59 +02:00
parent 083c68bb98
commit 061a2a60d3

View File

@ -155,6 +155,14 @@ int DePL7 = 128 ; //
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 */
{
Serial.write(cmd);
Serial.write(pitch);
Serial.write(velocity);
}
@ -204,8 +212,6 @@ void setup()
/* DDRA = B11111111 ; /* initialisation du port A en entré sur toutes les broches */ /* NE FONCTIONNE PAS ! */ /* DDRA = B11111111 ; /* initialisation du port A en entré sur toutes les broches */ /* NE FONCTIONNE PAS ! */
/* DDRB = B11111111 ; /* initialisation du port B en entré sur toutes les broches */ /* DDRB = B11111111 ; /* initialisation du port B en entré sur toutes les broches */
/* DDRC = B11111111 ; /* initialisation du port C en entré sur toutes les broches */ /* DDRC = B11111111 ; /* initialisation du port C en entré sur toutes les broches */
@ -222,16 +228,14 @@ void setup()
noteOn( 0x80, i , 0x00 ) ; noteOn( 0x80, i , 0x00 ) ;
} }
delay(2000);
} }
/*
void noteOn(int cmd, int pitch, int velocity) /* plays a MIDI note. Doesn't check to see that cmd is greater than 127, 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 */ or that data values are less than 127 */
/*
{ {
Serial.write(cmd); Serial.write(cmd);
Serial.write(pitch); Serial.write(pitch);
@ -239,6 +243,8 @@ void noteOn(int cmd, int pitch, int velocity) /* plays a MIDI note. Doesn't chec
} }
*/
void loop() void loop()
@ -260,11 +266,11 @@ void loop()
EPA6 = RegistreA & Masque64 ; EPA6 = RegistreA & Masque64 ;
EPA7 = RegistreA & Masque128 ; EPA7 = RegistreA & Masque128 ;
if ( ( EPA0 == 0 ) && ( DePA0 == 1 ) ) { noteOn(0x90, 0x24 , 0x70 ) ; } if ( ( EPA0 == 0 ) && ( DePA0 == 1 ) ) { noteOn(0x90, 0x24 , 0x90 ) ; }
if ( ( EPA0 == 1 ) && ( DePA0 == 0 ) ) { noteOn(0x80, 0x24 , 0x00 ) ;} if ( ( EPA0 == 1 ) && ( DePA0 == 0 ) ) { noteOn(0x80, 0x24 , 0x00 ) ;}
if ( ( EPA1 == 0 ) && ( DePA1 == Masque2 ) ) noteOn(0x90, 0x25 , 0x70 ) ; if ( ( EPA1 == 0 ) && ( DePA1 == Masque2 ) ) {noteOn(0x90, 0x25 , 0x70 ) ;}
if ( ( EPA1 == Masque2 ) && ( DePA1 == 0 ) ) noteOn(0x80, 0x25 , 0x00 ) ; if ( ( EPA1 == Masque2 ) && ( DePA1 == 0 ) ) {noteOn(0x80, 0x25 , 0x00 ) ;}
if ( ( EPA2 == 0 ) && ( DePA2 == Masque4 ) ) { noteOn(0x90, 0x26 , 0x70 ) ;} if ( ( EPA2 == 0 ) && ( DePA2 == Masque4 ) ) { noteOn(0x90, 0x26 , 0x70 ) ;}
if ( ( EPA2 == Masque4 ) && ( DePA2 == 0 ) ) { noteOn(0x80, 0x26 , 0x00 ) ; } if ( ( EPA2 == Masque4 ) && ( DePA2 == 0 ) ) { noteOn(0x80, 0x26 , 0x00 ) ; }
@ -297,8 +303,8 @@ void loop()
if ( ( EPB0 == 0 ) && ( DePB0 == 1 ) ) { noteOn(0x90, 0x2C , 0x70 ) ; } /* gestion du port B */ if ( ( EPB0 == 0 ) && ( DePB0 == 1 ) ) { noteOn(0x90, 0x2C , 0x70 ) ; } /* gestion du port B */
if ( ( EPB0 == 1 ) && ( DePB0 == 0 ) ) { noteOn(0x80, 0x2C , 0x00 ) ;} if ( ( EPB0 == 1 ) && ( DePB0 == 0 ) ) { noteOn(0x80, 0x2C , 0x00 ) ;}
if ( ( EPB1 == 0 ) && ( DePB1 == Masque2 ) ) noteOn(0x90, 0x2D , 0x70 ) ; if ( ( EPB1 == 0 ) && ( DePB1 == Masque2 ) ) { noteOn(0x90, 0x2D , 0x70 ) ;}
if ( ( EPB1 == Masque2 ) && ( DePB1 == 0 ) ) noteOn(0x80, 0x2D , 0x00 ) ; if ( ( EPB1 == Masque2 ) && ( DePB1 == 0 ) ) { noteOn(0x80, 0x2D , 0x00 ) ;}
if ( ( EPB2 == 0 ) && ( DePB2 == Masque4 ) ) { noteOn(0x90, 0x2E , 0x70 ) ;} if ( ( EPB2 == 0 ) && ( DePB2 == Masque4 ) ) { noteOn(0x90, 0x2E , 0x70 ) ;}
if ( ( EPB2 == Masque4 ) && ( DePB2 == 0 ) ) { noteOn(0x80, 0x2E , 0x00 ) ; } if ( ( EPB2 == Masque4 ) && ( DePB2 == 0 ) ) { noteOn(0x80, 0x2E , 0x00 ) ; }
@ -332,8 +338,8 @@ void loop()
if ( ( EPC0 == 0 ) && ( DePC0 == 1 ) ) { noteOn(0x90, 0x34 , 0x70 ) ; } /* gestion du port C */ if ( ( EPC0 == 0 ) && ( DePC0 == 1 ) ) { noteOn(0x90, 0x34 , 0x70 ) ; } /* gestion du port C */
if ( ( EPC0 == 1 ) && ( DePC0 == 0 ) ) { noteOn(0x80, 0x34 , 0x00 ) ;} if ( ( EPC0 == 1 ) && ( DePC0 == 0 ) ) { noteOn(0x80, 0x34 , 0x00 ) ;}
if ( ( EPC1 == 0 ) && ( DePC1 == Masque2 ) ) noteOn(0x90, 0x35 , 0x70 ) ; if ( ( EPC1 == 0 ) && ( DePC1 == Masque2 ) ) { noteOn(0x90, 0x35 , 0x70 ) ;}
if ( ( EPC1 == Masque2 ) && ( DePC1 == 0 ) ) noteOn(0x80, 0x35 , 0x00 ) ; if ( ( EPC1 == Masque2 ) && ( DePC1 == 0 ) ) { noteOn(0x80, 0x35 , 0x00 ) ;}
if ( ( EPC2 == 0 ) && ( DePC2 == Masque4 ) ) { noteOn(0x90, 0x36 , 0x70 ) ;} if ( ( EPC2 == 0 ) && ( DePC2 == Masque4 ) ) { noteOn(0x90, 0x36 , 0x70 ) ;}
if ( ( EPC2 == Masque4 ) && ( DePC2 == 0 ) ) { noteOn(0x80, 0x36 , 0x00 ) ; } if ( ( EPC2 == Masque4 ) && ( DePC2 == 0 ) ) { noteOn(0x80, 0x36 , 0x00 ) ; }
@ -367,8 +373,8 @@ void loop()
if ( ( EPL0 == 0 ) && ( DePL0 == 1 ) ) { noteOn(0x90, 0x3C , 0x70 ) ; } /* gestion du port L */ if ( ( EPL0 == 0 ) && ( DePL0 == 1 ) ) { noteOn(0x90, 0x3C , 0x70 ) ; } /* gestion du port L */
if ( ( EPL0 == 1 ) && ( DePL0 == 0 ) ) { noteOn(0x80, 0x3C , 0x00 ) ;} if ( ( EPL0 == 1 ) && ( DePL0 == 0 ) ) { noteOn(0x80, 0x3C , 0x00 ) ;}
if ( ( EPL1 == 0 ) && ( DePL1 == Masque2 ) ) noteOn(0x90, 0x3D , 0x70 ) ; if ( ( EPL1 == 0 ) && ( DePL1 == Masque2 ) ) {noteOn(0x90, 0x3D , 0x70 ) ; }
if ( ( EPL1 == Masque2 ) && ( DePL1 == 0 ) ) noteOn(0x80, 0x3D , 0x00 ) ; if ( ( EPL1 == Masque2 ) && ( DePL1 == 0 ) ){ noteOn(0x80, 0x3D , 0x00 ) ; }
if ( ( EPL2 == 0 ) && ( DePL2 == Masque4 ) ) { noteOn(0x90, 0x3E , 0x70 ) ;} if ( ( EPL2 == 0 ) && ( DePL2 == Masque4 ) ) { noteOn(0x90, 0x3E , 0x70 ) ;}
if ( ( EPL2 == Masque4 ) && ( DePL2 == 0 ) ) { noteOn(0x80, 0x3E , 0x00 ) ; } if ( ( EPL2 == Masque4 ) && ( DePL2 == 0 ) ) { noteOn(0x80, 0x3E , 0x00 ) ; }