// sensorMidi // Mobile Synth II Workshop // CCRMA - Stanford University #include bool debug = false; void setup() { if(debug){ Serial.begin(9600); // initializing serial port } } void loop() { int sensorValue = analogRead(A0); // retrieving sensor value on Analog pin 0 if(debug){ Serial.println(sensorValue); // printing sensor value } else{ int midiCC = 10; // must match the faust configuration int midiValue = sensorValue*127/1024; // value between 0-127 int midiChannel = 0; // actually doesn't matter usbMIDI.sendControlChange(midiCC,midiValue,midiChannel); // sending control message } delay(30); // wait for 30ms }