midi shield

Hi,

Much of the MIDI shield is working great; except I cannot for the life of me get any input with the MIDI input. Ran several tests with my midi keyboard and modules; cables work, keyboard out to module in (and module out to other module in) works great; redirecting keyboard via midi usb connector also works. Again, just the example sketches do not allow midi in data.

Is there a simple midi in/midi out on the shield I can run?

Thanks!

Steve

quick update: I modified an example program; now able to output midi to a module! So, maybe just the input is not working?

Hi scshepard.

Make sure you change the PROG / RUN to RUN after uploading code to your board.

By default, the shield uses the hardware serial port on the Arduino for MIDI communication – but that port is shared with the bootloader, which is initiated when you press the “load” button in the Arduino IDE. The switch allows them to share the port politely, avoiding output contention.

If you’re using the hardware serial port, set the switch to the PROG position, before you load your sketch. Once it’s loaded and verified, set it back to RUN.

If you’re having trouble loading a sketch, double check that the switch is set to PROG!

Hi Chris,

I “think” I’m setting the PROG/FUN correctly; took all of the debug Serial.println statements out. Again, I can loop with MIDI.noteon and MIDI.noteoff and that works great on the MIDI out.

Now trying to a quick “MIDI.read()” and see that all of the notes from MIDI in are actually going out. Is there supposed to be a MIDI.write()? It doesn’t seem to exist. Here’s my simple sketch for MIDI out:

#include <MIDI.h>

// Simple tutorial on how to receive and send MIDI messages.

// Here, when receiving any message on channel 4, the Arduino

// will blink a led and play back a note for 1 second.

MIDI_CREATE_DEFAULT_INSTANCE();

static const unsigned ledPin = 10; // LED pin on Arduino Uno

static const unsigned ledMidi = 9;

void setup()

{

pinMode(ledPin, OUTPUT);

pinMode(ledMidi,OUTPUT);

MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI and listen to channel 4

digitalWrite(ledPin,HIGH);

digitalWrite(ledMidi,HIGH);

delay(5000);

digitalWrite(ledPin,LOW);

digitalWrite(ledMidi,LOW);

delay(5000);

}

void loop()

{

digitalWrite(ledPin, HIGH);

digitalWrite(ledMidi,HIGH);

delay(1000);

digitalWrite(ledPin, LOW);

digitalWrite(ledMidi,LOW);

delay(1000);

digitalWrite(ledPin, HIGH);

digitalWrite(ledMidi,HIGH);

MIDI.sendNoteOn(42, 127, 1); // Send a Note (pitch 42, velo 127 on channel 1)

delay(1000); // Wait for a second

MIDI.sendNoteOff(42, 0, 1); // Stop the note

digitalWrite(ledPin, LOW);

digitalWrite(ledMidi,LOW);

}

Added a simple check for MIDI.read(); if it’s detected noteon for channel 1, otherwise noteon for channel 2. Only channel 2 shows up. I just double checked that keyboard output and midi cable work on midi module. Kinda at a loss here…

Thanks!

Hi,

I’ve done extension testing of all modules, cables, keyboard, etc that I attempt to connect to MIDI in; again, I can send midi data through the MIDI out; works great! But that input; here’s a summary of where I am so far. The problem, of course, is isolating the signal on MIDI in; I have another order (already got the bus pirate!) including an isolator. Holding my fingers on this one…

http://midi.yubacollegecompsci.com/

Ahhhhh. Seems that there is much “write” activity on midi in. So, switching to RUN mode does indeed fix for MIDI in. Curious, now, why MIDI out worked???

MIDI out isn’t connected to the switch, only MIDI in is so MIDI out works on matter how the switch is set. :slight_smile: