Okayyyyyyy, i think i have something now.
Hearing the cops coming with a loop ![]()
/*
So simple midi
*/
int speed_com = 31250; // the midi speed
int note;
 Â
void setup(){Â
 Serial.begin(speed_com);  // init serial speed
 playMidi (0x90, 0x5A, 0x45); // play on channel 1, never ending pain of my ears !
}
void loop(){
 // NOW, PITCH ME, PLEASE !!!
 for (int i=2000 ; i < 8000 ; i+=5){
  // you're under arrest, cops are singing !
  PitchWheelChange(i);
 }
}
void playMidi (int cmd, int pitch, int velocity) {
 Serial.write(cmd);
 Serial.write(pitch);
 Serial.write(velocity);
}
// johnwasser was here !
// Value is +/- 8192
void PitchWheelChange(int value) {
  unsigned int change = 0x2000 + value; // 0x2000 == No Change
  unsigned char low = change & 0x7F; // Low 7 bits
  unsigned char high = (change >> 7) & 0x7F; // High 7 bits
 playMidi(0xE0, low, high);
}
I'm not sure where i'm going with that, but i'm learning !
I think i'm gonna try adding a potentiomer to drive your function.
If someone looking for me, i'm in the lab !
Thanks for France ![]()