maxwellmattryan
New member
Hello all,
I'm writing / building my first synthesizer and am currently trying to get the MIDI communications to work (via 5-pin MIDI DIN). I've gotten my sketch to receive basic input from a keyboard I've got, but for some reason the actual sound generation part of my sketch no longer works / I'm no longer able to hear any audio.
I narrowed it down to my MIDI init function and noticed that if I commented out the `MIDI.begin()` line then the audio would start working as normal again, but the MIDI would stop. Uncommenting it would make the audio inaudible, but the MIDI works. What can I do to make sure that both are working at the same time?
It might be worth mentioning that I am not using an octocoupler in my wiring (simply two 220ohm resistors for the +5v and TX pins), but I didn't (still don't, but correct me if I'm wrong) think this mattered because I have successfully gotten MIDI input to be read successfully.
Thank you!
I'm writing / building my first synthesizer and am currently trying to get the MIDI communications to work (via 5-pin MIDI DIN). I've gotten my sketch to receive basic input from a keyboard I've got, but for some reason the actual sound generation part of my sketch no longer works / I'm no longer able to hear any audio.
I narrowed it down to my MIDI init function and noticed that if I commented out the `MIDI.begin()` line then the audio would start working as normal again, but the MIDI would stop. Uncommenting it would make the audio inaudible, but the MIDI works. What can I do to make sure that both are working at the same time?
It might be worth mentioning that I am not using an octocoupler in my wiring (simply two 220ohm resistors for the +5v and TX pins), but I didn't (still don't, but correct me if I'm wrong) think this mattered because I have successfully gotten MIDI input to be read successfully.
Thank you!
Code:
MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI);
...
void setup() {
Serial.begin(31250);
initAudio();
initMIDI();
...
}
void initAudio() {
AudioMemory(192);
...
}
void initMIDI() {
MIDI.begin(MIDI_CHANNEL_OMNI);
Serial2.setTX(10);
Serial2.setRX(9);
}