Hi,
I'm attempting to make a FM synth on the teensy 4.0 with the audio board. I want to receive notes from a sequencer so I can start playing around with generating some synth noises.
For now I am just trying to receive MIDI notes from an Arturia Beatstep via the 3.5mm midi out on the device.
I have used the code from the MIDI library section https://www.pjrc.com/teensy/td_libs_MIDI.html and used the circuit from this tutorial with a 3.5mm input to the teensy instead of a 5-DIN cable https://www.notesandvolts.com/2018/11/teensy-synth-part-9-midi-input.html . I have used the code from the MIDI Library section above to monitor the messages received by the teensy.
When I monitor the midi messages coming in to the teensy it is only displaying these two messages on the serial monitor. "Note Off: ch=1, note=0, velocity=128" and
"Note Off: ch=1, note=0, velocity=0". The Beatstep is on sequencer mode and should be playing middle C every 16th note. I have tried different notes and patterns ect. but the serial monitor just alternates between the above two messages.
I am pretty new to this any help would be greatly appreciated.
I'm attempting to make a FM synth on the teensy 4.0 with the audio board. I want to receive notes from a sequencer so I can start playing around with generating some synth noises.
For now I am just trying to receive MIDI notes from an Arturia Beatstep via the 3.5mm midi out on the device.
I have used the code from the MIDI library section https://www.pjrc.com/teensy/td_libs_MIDI.html and used the circuit from this tutorial with a 3.5mm input to the teensy instead of a 5-DIN cable https://www.notesandvolts.com/2018/11/teensy-synth-part-9-midi-input.html . I have used the code from the MIDI Library section above to monitor the messages received by the teensy.
Code:
#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)");
}
}
When I monitor the midi messages coming in to the teensy it is only displaying these two messages on the serial monitor. "Note Off: ch=1, note=0, velocity=128" and
"Note Off: ch=1, note=0, velocity=0". The Beatstep is on sequencer mode and should be playing middle C every 16th note. I have tried different notes and patterns ect. but the serial monitor just alternates between the above two messages.
I am pretty new to this any help would be greatly appreciated.