Using tutorial provided here (https://www.pjrc.com/teensy/td_libs_MIDI.html), I'm unable to receive hardware MIDI input from a hardware sequencer. Any guidance is greatly appreciated!
I am a new coder and new to Teensy. Was successful with a MIDI monitor sketch using UNO and a different sketch and basic hardware MIDI I/O circuit but due to UNO limitations, the sketch stopped working at higher BPMs, which is why I moved to Teensy.
Trying to determine what I am missing here? Do I need additional usbMIDI commands included in the sketch for the serial output?
I am also unclear what USB and Port settings for Hardware MIDI on my Teensy-LC?
I've followed the schematic here: https://www.pjrc.com/teensy/td_libs_MIDI_sch_t3.png
Using this sketch:
Here's the photos of my MIDI I/O circuit built based on the PJRC schematic (pins are correctly connected for serial 1 & power but camera angle is not):
MIDI out from sequencer to Board Hardware Din input and Teensy-LC USB plugged into computer USB and is recognized:
I am a new coder and new to Teensy. Was successful with a MIDI monitor sketch using UNO and a different sketch and basic hardware MIDI I/O circuit but due to UNO limitations, the sketch stopped working at higher BPMs, which is why I moved to Teensy.
Trying to determine what I am missing here? Do I need additional usbMIDI commands included in the sketch for the serial output?
I am also unclear what USB and Port settings for Hardware MIDI on my Teensy-LC?
I've followed the schematic here: https://www.pjrc.com/teensy/td_libs_MIDI_sch_t3.png
Using this sketch:
Code:
/* MIDI Input Test - for use with Teensy or boards where Serial is separate from MIDI
* As MIDI messages arrive, they are printed to the Arduino Serial Monitor.
*
* Where MIDI is on "Serial", eg Arduino Duemilanove or Arduino Uno, this does not work!
*
* This example code is released into the public domain.
*/
#include <MIDI.h>
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);
Serial.begin(57600);
Serial.println("MIDI Input Test");
}
unsigned long t=0;
void loop() {
int type, note, velocity, channel, d1, d2;
if (MIDI.read()) { // Is there a MIDI message incoming ?
byte type = MIDI.getType();
switch (type) {
case midi::NoteOn:
note = MIDI.getData1();
velocity = MIDI.getData2();
channel = MIDI.getChannel();
if (velocity > 0) {
Serial.println(String("Note On: ch=") + channel + ", note=" + note + ", velocity=" + velocity);
} else {
Serial.println(String("Note Off: ch=") + channel + ", note=" + note);
}
break;
case midi::NoteOff:
note = MIDI.getData1();
velocity = MIDI.getData2();
channel = MIDI.getChannel();
Serial.println(String("Note Off: ch=") + channel + ", note=" + note + ", velocity=" + velocity);
break;
default:
d1 = MIDI.getData1();
d2 = MIDI.getData2();
Serial.println(String("Message, type=") + type + ", data = " + d1 + " " + d2);
}
t = millis();
}
if (millis() - t > 10000) {
t += 10000;
Serial.println("(inactivity)");
}
}
Here's the photos of my MIDI I/O circuit built based on the PJRC schematic (pins are correctly connected for serial 1 & power but camera angle is not):
MIDI out from sequencer to Board Hardware Din input and Teensy-LC USB plugged into computer USB and is recognized: