MIDI Polyphony


I recently bought an Arduino Mega. I want to build a MIDI sequencer (looper). My question is: Can I send or receive more than one MIDI note simultaneously over a standard MIDI connector?

I want to record and play back chords and rhythms. Any help would be very appreciated!


Rafael :-)

It can't be 'simultaneous' because it's a serial communication line. Everything is sent one byte at a time. Fortunately it is a FAST serial communication line so sequential Note On command sound simultaneous. You can turn on any number of notes before you turn them off but most MIDI output devices have a limit to how many simultaneous notes they can produce. Turn on more then that and the earliest notes will turn off to make room for the new notes.

Thank you so much John!

I always wanted to know that :-)

Don't forget you have 16 channels you can use.........

Even an Uno can do a decent job with sequencing beatbox kind of stuff.

I'm working on a MIDI-to-Light project and I've noticed that MIDI going into the Arduino definitely doesn't like quantized chords. However, a simple randomizer type function in Cubase which moves all notes a few ticks seems to do the trick just fine.

What alternatives are there to the serial connection? Just curious.

MIDI going into the Arduino definitely doesn't like quantized chords

That is down to your software not to the arduino. You are probbly getting notes in the running status mode which your software is not coping with.

I’d like to add that I have built a step sequencer based on the Arduino and the MIDI library and am currently facing a problem with sending multiple notes-on. Basically, I figured that I could set it up so that at any given step, I could send all my note-on instructions based on whatever my grid was set up as. And then when it was time to move to the next step, send all my note-offs for the previous step, then send my note-on messages for the current step (“next step” relative to the previous one). But what I am finding, and I don’t know if this is just how MIDI is or if this is something in the MIDI library…but what I am finding is that when I send a “note-on” message, then I send another “note-on” message before sending a “note-off” message for the previous note, the MIDI messages are glitching and it is not operating correctly. My fix for this, at the moment, is to only ever have only “one note on at any given moment”. I haven’t yet implemented my idea. I’m going to write something up and test it out. But I wanted to make you aware of this issue that I’m having so if you were thinking of something that is going to be playing. But, you know, maybe that is just how MIDI works, I still have a lot to learn about it and it’s totally possible that I’m just doing it wrong but I wanted to at least add my $.02. :slight_smile:

Also, since I found this thread through a google search, I hope this helps anyone else who is suffering the same problem.

I want to report that changing Running Status from 1 to 0 within the MIDI.h file did the trick. It sends the correct messages at the correct times in the correct order and everything seems to work OK. However, it is also sending an additional random MIDI message that is totally unrelated to the MIDI Notes I am using. But since this extra message is a note-on with velocity 0, I guess I'll just live with it. :0

Note on with a velocity of zero is a valid MIDI way of sending a note off message.

No I know. But the buggy MIDI message is "Note 3, Velocity 0" and now it happens every time I send a "note on" message or groups of message. But what I was trying to say was, I'm neither using Note 3, nor too concerned with a constant "note off" message being sent at every step event. It is what it was at this point. If I was really going get serious about it and enable an option for customizable note assignment, I would worry about it. But for my purposes, I can just stick to the fixed assigned notes and none of them are note 3 so I will just let it be. Very strange though. I wonder why it happens.

I think you are best starting your own thread, describing your setup, code and exact problem.