HEY GUYS !I would like to know what is the connection between sendemidi and value number,like "244", and are there have any document listed those correspondence of numbers.Is there
have any library be used for "sendeMIDI" ?
CODE:
int joyX = 0; //Pitch Bend
int joyY = 0; //CC1 und CC20
int pitchBend = 0;
int controllerWert = 0;
int button = LOW;
int buttonAlt = LOW;
int schalter = 0;
void setup() {
Serial.begin (9600);
pinMode (8, INPUT_PULLUP);
}
void loop() {
joystickAbfragen();
buttonAbfragen();
}
void joystickAbfragen() {
joyX = analogRead(A0);
if (joyX > 530) {
pitchBend = map(joyX,530,1023,65,127);
sendeMIDI(224,0,pitchBend);
}
if (joyX < 520) {
pitchBend = map(joyX,0,520,0,63);
sendeMIDI(224,0,pitchBend);
}
else if ((joyX > 520 && joyX < 530) && pitchBend != 64) {
pitchBend = 64;
sendeMIDI(224,0,pitchBend);
}
joyY = analogRead(A1);
if (joyY > 530) {
controllerWert = map(joyY,530,1023,0,127);
sendeMIDI(176,1,controllerWert);
}
else if (joyY < 520) {
controllerWert = map(joyY,520,0,0,127);
sendeMIDI(176,20,controllerWert);
}
}
void buttonAbfragen() {
button = digitalRead(8);
if (button == LOW && buttonAlt == HIGH) {
if(schalter == 0){
sendeMIDI(176, 64, 127);
schalter = 1;
}
else {
sendeMIDI(176, 64, 0);
schalter = 0;
}
}
buttonAlt = button;
}
void sendeMIDI(int statusByte, int dataByte1, int dataByte2) {
Serial.write(statusByte);
Serial.write(dataByte1);
Serial.write(dataByte2);
}