https://youtu.be/aHDsutNMfXo
https://youtu.be/-4BPpfFGcIE
I combined the drum pad construction of the second video, with the wiring and circuitry of the first video as well as the code from the midi glove adafruit video. Since I was using a Teensy 2.0 instead of a FLORA I altered the code to match the first 4 analog inputs of the Teensy board. After soldering and putting it all together I get noting when plugging it into ableton live. The teensy is recognized as a MIDI controller, but no MIDI signal is being picked up. I will also note, that before soldering anything to the Teensy board, I was able to touch the 4 pin holes on the board and a midi signal for those four would be picked up from just my finger making a connection. Lastly, once everything was soldered and connected, the board got very warm.
My only assumptions at this point, is that, while I have a 1m ohm resistor running in paralell for each piezo, I should add a 10k ohm resistor at each pin on the teensy to reduce even more, or the hot glue I used on the piezos is preventing it from making direct contact with drumpad, or that I burned out the teensy pins because I didn't have additional resistors in place.
Any help at all would be great. Please see sketch and images below.
Sketch:
Code: Select all
/*
Piezo MIDI glove
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried, Phillip Burgess, & Becky Stern for Adafruit Industries.
BSD license, all text above must be included in any redistribution
*/
#define LED 11 // Pin for heartbeat LED (shows code is working)
#define CHANNEL 1 // MIDI channel number
int note;
const int indexFinger = A0; // the piezo is connected to analog pin 0 (aka F0)
const int middleFinger = A1; // the piezo is connected to analog pin 1 (aka F1)
const int thumb = A2; // the piezo is connected to analog pin 2 (aka F4)
const int pinkyFinger = A3; // the piezo is connected to analog pin 3 (aka F5)
const int pins[] = {thumb, indexFinger, middleFinger, pinkyFinger};
//char Keys[] = {'z','x','c','v'};
boolean currentPressed[] = {false, false, false, false};
const int threshold = 40; // threshold value to decide when the detected sound is a knock or not
void setup()
{
pinMode(LED, OUTPUT);
// We dont have Serial or Keyboard available in MIDI mode!!!
//while (!Serial)
//Serial.begin(115200);
//Serial.println("start");
//Keyboard.begin();
}
void loop()
{
for (int i=0;i<4;i++) {
delay(1);
long total1 = 0;
long start = millis();
long total = analogRead(pins[i]);
// check if we are sensing that a finger is touching
// and that it wasnt already pressed
if ((total > threshold) && (! currentPressed[i])) {
//Serial.print("Key pressed #"); Serial.print(i);
//Serial.print(" ("); Serial.print(Keys[i]); Serial.println(")");
currentPressed[i] = true;
//Keyboard.press(Keys[i]);
//note = LOWNOTE + (i & 0x0F) * 8;
usbMIDI.sendNoteOn(60+i, 127, CHANNEL);
}
else if ((total <= threshold) && (currentPressed[i])) {
// key was released (no touch, and it was pressed before)
//Serial.print("Key released #"); Serial.print(i);
//Serial.print(" ("); Serial.print(Keys[i]); Serial.println(")");
currentPressed[i] = false;
//Keyboard.release(Keys[i]);
usbMIDI.sendNoteOff(60+i, 0, CHANNEL);
}
delay(5);
}
while(usbMIDI.read()); // Discard incoming MIDI messages
}
Thanks,
Kyle