Hi,
first i wanna thank you for your quick answer, and apologize for confusion,
i try to ask more specifically;
So the problem that i have is to find a code (as im not able to program by myself) that is working for my 21 piezos 3 mux MIDI drumpad, a code i can use directly OR a code that can be modified and changed
I knew the link in video´s description but i think i cannot use it as this code is not working with Multiplexer (Mux)
(correct me if im wrong)
Im gonna post;
1A)picture of my hardware (21 piezos drumpad working with 3 mux)
1B)circuit diagram for my piezo drumpad
-
Piezo_Drum_Pad_v0_1
:sketch i already posted in my first posting, isn’t working with mux but really nice to adjust parameters like sensitivity to my piezo
-
MIDI_Controller_v1-2
another code thats working with multiplexer but is NOT especially for piezos (i would prefere to use this sketch because its easy to edit and modify things, but it didn’t work with my piezo)
i know that theres another code thats working with piezos AND mux but (as far as i know) only with ONE multiplex.;
-
Help with piezo midi drum using CD4051 [solved] - #17 by bigslo - LEDs and Multiplexing - Arduino Forum
(saw you there;))
unsigned char PadNote[8] = {30,34,26,24,33,31,29,39};
unsigned char status;
int PadCutOff[8] = {200,200,200,200,200,200,200,250};
int MaxPlayTime[8] = {25,25,25,25,25,25,25,25};
#define midichannel 0;
boolean activePad[8] = {0,0,0,0,0,0,0,0};
int PinPlayTime[8] = {0,0,0,0,0,0,0,0};
boolean VelocityFlag = true;
int pin = 0;
int hitavg = 0;
int pad = 0;
int r0 = 0;
int r1 = 0;
int r2 = 0;
int count = 0;
int multiplex[8];
void setup()
{
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
Serial.begin(115200);
}
void loop(){
readSensors(1);
checkSensors(1);
}
void readSensors (int analogPin) {
for(count=0; count <= 7; count++)
{
r2 = bitRead(count,0);
r1 = bitRead(count,1);
r0 = bitRead(count,2);
digitalWrite(2, r0);
digitalWrite(3, r1);
digitalWrite(4, r2);
multiplex[count] = analogRead(analogPin);
}
}
void checkSensors (int analogPin)
{
for(int pin=0; pin <=7; pin++)
{
hitavg = multiplex[pin];
pad=pin;
if(hitavg > 200)
{
if((activePad[pad] == false))
{
hitavg = map(hitavg,0,1023,50,127);
MIDI_TX(144,PadNote[pad],hitavg);
delay(5);
MIDI_TX(144,PadNote[pad],0);
PinPlayTime[pad] = 0;
activePad[pad] = true;
}
else
{
PinPlayTime[pad] = PinPlayTime[pad] + 1;
}
}
else if((activePad[pad] == true))
{
PinPlayTime[pad] = PinPlayTime[pad] + 1;
if(PinPlayTime[pad] > MaxPlayTime[pad])
{
activePad[pad] = false;
MIDI_TX(144,PadNote[pad],0);
}
}
}
}
void MIDI_TX(unsigned char MESSAGE, unsigned char PITCH, unsigned char VELOCITY) {
status = MESSAGE + midichannel;
Serial.write(status);
Serial.write(PITCH);
Serial.write(VELOCITY);
}
To this sketch i want to know if theres any way to edit more multiplexer? I tried it out (loaded up to my arduino) but (surprise) only 8 from that 21 piezo worked 
Anyways thank you a lot for any ideas, advices or what ever 
and sorry for my bad english, i hope everythings understandable 