lb

This code is for a teensy-lc powered midi controller with 11 touch sensors (i used tinfoil and single wires). 9 of the touch sensors are programmed to play a midi note (middle c) on separate channels. The two remaining touch sensors can be assigned to more notes, as they're programmed, or easily midi mapped to be sends for delay and reverb. Any DAW with midi mapping capability should be able to recognize this controller. Also, I use the midi instrument "simpler" to make it a sampler, but the options are pretty endless. Use the Arduino IDE and save the code as a .ino file. int ledPin = 13; // choose the pin for the LED int inputPin = 1; // choose the input pin (for PIR sensor) int inputPin1 = 0; int touchRead_pin = 0; int touchRead_pin1 = 1; int touchRead_pin2 = 3; int touchRead_pin3 = 4; int touchRead_pin4 = A9; int touchRead_pin5 = A8; int touchRead_pin6 = A5; int touchRead_pin7 = A4; int touchRead_pin8 = A3; int touchRead_pin9 = A2; int touchRead_pin10 = A1; bool tr; bool tr1; bool tr2; bool tr3; bool tr4; bool tr5; bool tr6; bool tr7; bool tr8; bool tr9; bool tr10; bool tr11; int data; void setup() { // put your setup code here, to run once: pinMode(ledPin, OUTPUT); // declare LED as output pinMode(inputPin, INPUT); // declare sensor as input pinMode(inputPin1, INPUT); Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: data = touchRead(touchRead_pin); Serial.println(data); if (data > 2000) { if (tr == true) { usbMIDI.sendNoteOn(60, 127, 2); tr = false; } } else { if (tr == false) { usbMIDI.sendNoteOff(60, 0, 2); tr = true; } } data = touchRead(touchRead_pin1); Serial.println(data); if (data > 2000) { if (tr1 == true) { usbMIDI.sendNoteOn(60, 127, 3); tr1 = false; } } else { if (tr1 == false) { usbMIDI.sendNoteOff(60, 0, 3); tr1 = true; } } data = touchRead(touchRead_pin2); Serial.println(data); if (data > 2000) { if (tr2 == true) { usbMIDI.sendNoteOn(60, 127, 1); tr2 = false; } } else { if (tr2 == false) { usbMIDI.sendNoteOff(60, 0, 1); tr2 = true; } } data = touchRead(touchRead_pin3); Serial.println(data); if (data > 2000) { if (tr3 == true) { usbMIDI.sendNoteOn(60, 127, 4); tr3 = false; } } else { if (tr3 == false) { usbMIDI.sendNoteOff(60, 0, 4); tr3 = true; } } data = touchRead(touchRead_pin4); Serial.println(data); if (data > 2000) { if (tr4 == true) { usbMIDI.sendNoteOn(60, 127, 10); tr4 = false; } } else { if (tr4 == false) { usbMIDI.sendNoteOff(60, 0, 10); tr4 = true; } } data = touchRead(touchRead_pin5); Serial.println(data); if (data > 2000) { if (tr5 == true) { usbMIDI.sendNoteOn(60, 127, 11); tr5 = false; } } else { if (tr5 == false) { usbMIDI.sendNoteOff(60, 0, 11); tr5 = true; } data = touchRead(touchRead_pin6); Serial.println(data); if (data > 2000) { if (tr6 == true) { usbMIDI.sendNoteOn(60, 127, 6); tr6 = false; } } else { if (tr6 == false) { usbMIDI.sendNoteOff(60, 0, 6); tr6 = true; } } data = touchRead(touchRead_pin7); Serial.println(data); if (data > 2000) { if (tr7 == true) { usbMIDI.sendNoteOn(60, 127, 5); tr7 = false; } } else { if (tr7 == false) { usbMIDI.sendNoteOff(60, 0, 5); tr7 = true; } } data = touchRead(touchRead_pin8); Serial.println(data); if (data > 2000) { if (tr8 == true) { usbMIDI.sendNoteOn(60, 127, 7); tr8 = false; } } else { if (tr8 == false) { usbMIDI.sendNoteOff(60, 0, 7); tr8 = true; } data = touchRead(touchRead_pin9); Serial.println(data); if (data > 2000) { if (tr9 == true) { usbMIDI.sendNoteOn(60, 127, 8); tr9 = false; } } else { if (tr9 == false) { usbMIDI.sendNoteOff(60, 0, 8); tr9 = true; } } data = touchRead(touchRead_pin10); Serial.println(data); if (data > 2000) { if (tr11 == true) { usbMIDI.sendNoteOn(60, 127, 9); tr11 = false; } } else { if (tr11 == false) { usbMIDI.sendNoteOff(60, 0, 9); tr11 = true; } } delay(100); while (usbMIDI.read()); { } usbMIDI.send_now(); { } } } }