Carthaginian
Member
I am trying to make my Teensy 3.0 play notes on my Nexus 7. The two devices are connected via a regular USB and an On-the-Go adapter cable (I've see these two cables work fine with an ordinary Midi controller). I also selected "Midi" under board type.
After I plug the Teensy into my Nexus 7, the Nexus 7 recognizes the Teensy as a Midi device, but nothing seems to happen. When I load the Grand Piano Pro app, no sounds come out. I also don't see any messages received by the "USB Midi Monitor" app (but then again, my other Midi Controller which does produce sound also doesn't show up on USB Midi Monitor).
Could the clock speed be causing an issue? The Teensyduino IDE has set 96 MHz "overclock" by default. Could this be causing an issue? I would check it myself right now, but I'm several miles from my Teensy.
My current code is below. I've tried many variations of it:
After I plug the Teensy into my Nexus 7, the Nexus 7 recognizes the Teensy as a Midi device, but nothing seems to happen. When I load the Grand Piano Pro app, no sounds come out. I also don't see any messages received by the "USB Midi Monitor" app (but then again, my other Midi Controller which does produce sound also doesn't show up on USB Midi Monitor).
Could the clock speed be causing an issue? The Teensyduino IDE has set 96 MHz "overclock" by default. Could this be causing an issue? I would check it myself right now, but I'm several miles from my Teensy.
My current code is below. I've tried many variations of it:
Code:
#include <Bounce.h>
const int channel = 1;
const int ledPin = 13;
void setup() {
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
}
void loop() {
// play notes from F#-0 (0x1E) to F#-5 (0x5A):
for (int note = 0x1E; note < 0x5A; note ++) {
//Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
usbMIDI.sendNoteOn(0x90, note, 0x45);
delay(100);
digitalWrite(ledPin, HIGH);
//Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
usbMIDI.sendNoteOn(0x90, note, 0x00);
delay(100);
digitalWrite(ledPin, LOW);
}
}