Stupid question about MIDI signal

Started by ricothetroll, April 24, 2011, 05:01:47 AM

Previous topic - Next topic

ricothetroll

Hi,
I'm doing my first steps on programming microcontrollers. I'm currently working on simple MIDI programs.

There's something I don't get about MIDI connections : it's a serie format, so how can you send a chord with notes played exactly at the same time (manually writtent on a DAW MIDI track for example) ?

I computed the transmission time for 1 MIDI note  : 3 bytes (channel, key and velocity) and found that it takes about 1ms (time for 1bit is 1/31250=32us, and including start and stop bits, for 30 bits=960us~1ms). 1ms between each note seems like pretty long time !

Best regards.

Eric

Hides-His-Eyes

I don't know the answer to your question, but 1ms is probably considerably less time than it took you to press the key.

That said what if you play a chord of 10 notes? 10ms is approaching the minimum latency for recording into a computer. It's not so bad.

PRR

Strum a chord on guitar. You get six notes in, what? less than 1/10th second? Say 60mS? 10mS between notes?

Part of the "sound" of guitar chords is, of course, the arpeggio effect; but it is quite small and we rarely notice we don't get all notes at once. I suspect that a chord played 10 times faster is "simultaneous" to the ear.

I recall when MIDI was new, arguments like this were used to show that it would never catch on. Somehow it did.
  • SUPPORTER

ricothetroll

Hi,

Thanx a lot for your answers !

I guess that's the kind of question that comes when you begin to deal with MIDI interfaces and ask yourself "would it explode if two notes come EXACTLY at the same time ?" I guess the sender has some kind of "MIDI merge" anyway, and makes one note wait for its turn if another one is being transmitted.

Best regards.

Eric

mhelin

If you use USB you can get rid of the 31250 baud rate limitation. For an example the Arduino Uno can be programmed to work as MIDI device (see http://mtiid.calarts.edu/research/hiduino). Regarding the other problem you will obviously need some buffering somewhere.

Mac Walker

Thirty milliseconds is generally considered the standard as the minimum time interval for which the human brain can interpret a "division" between percussive type events.   So one millisecond really is a short period of time in comparison.  Its highly probable that the midi transmitter is "waiting" for you to finish your chording to transmit the tail end notes, even though to the player this may not seem to be the case. 

Gurner

I remember a few years ago when the challenge was to get audio latency sub 10ms (this was considered the threshold below which not even superman can discern any percussive difference between notes) ...so a five note chord, with 1ms between each note is pretty much in line with the 10ms threshold. Things can start choking in a heavily laden midi track though.

About time the mfrs got their heads together & rolled out a universally agreed Midi MKII updated it really ....a serial baudrate of 31250 isn't cutting it in 2011!

G. Hoffman

Back when I was in college, we were told the minimum delay that is perceptible as a distinct note is about 20ms.  But, first of all, that is at best an average, and even then it is only under ideal conditions.  But if you really want to test it, start playing a signal, and pan the dry and wet signals opposite of one another.  Start with 0ms delay, and start dialing it up.  Figure out where you start to hear a distinct repeat - I'm betting that it will be more than 20ms, so 1ms really doesn't matter.


Gabriel

ricothetroll

That's right, but when I play the guitar through the soundcard, 10ms latency can definitely be felt (more than heard actually). I just feel that the notes aren't "sticking" to my fingers as they should be.
Best regards.
Eric

mistahead

Strange actually - yesterday I was reading an article about lag effects (PC related article as that's my day job) and it touches on this topic somewhat:
http://www.skytopia.com/project/articles/lag/latency.html

2ms for a singer with monitors... I would also suggest that these singers are the sort who throw hissy fits over how badly the engineer did - at least until they're autotuned.
;D

Hides-His-Eyes

Quote from: ricothetroll on May 05, 2011, 05:13:59 AM
That's right, but when I play the guitar through the soundcard, 10ms latency can definitely be felt (more than heard actually). I just feel that the notes aren't "sticking" to my fingers as they should be.
Best regards.
Eric

You realise of course that 10ms latency is the same as sitting 3 metres away from your amp?

You probably had more latency than the computer was reporting.

potul

Quote from: Hides-His-Eyes on May 06, 2011, 07:09:01 AM
Quote from: ricothetroll on May 05, 2011, 05:13:59 AM
That's right, but when I play the guitar through the soundcard, 10ms latency can definitely be felt (more than heard actually). I just feel that the notes aren't "sticking" to my fingers as they should be.
Best regards.
Eric

You realise of course that 10ms latency is the same as sitting 3 metres away from your amp?

You probably had more latency than the computer was reporting.

Good point.... I never thought of latency this way. I don't think anyone would complain because the amp is 3m away and the sound gets delayed. :)

ricothetroll

QuoteYou realise of course that 10ms latency is the same as sitting 3 metres away from your amp?

You probably had more latency than the computer was reporting.

I think you're right !

By the way, I took a look at this midi merger project :
http://www.ucapps.de/index.html?page=floorboard_fr.html

I have a question : what does "Time Out" means ? It's mentioned in the features : "Time Out: 200 mS (avoids hangups if MIDI cable is removed during transfer)".

Best regards.

Eric

ORK

Is the MIDI latency constant like constantly standing at a constant distance from the amp, or does it vary several times per second like running like crazy to and from the amp?

ricothetroll

ORK, I must admit that I didn't understand your question !  ::)

Hides-His-Eyes

Quote from: ORK on May 10, 2011, 01:27:39 PM
Is the MIDI latency constant like constantly standing at a constant distance from the amp, or does it vary several times per second like running like crazy to and from the amp?

The midi latency is like standing next to your amp for the first note of the chord and 30cm away for the next, I guess.

ricothetroll

QuoteThe midi latency is like standing next to your amp for the first note of the chord and 30cm away for the next, I guess.
:icon_biggrin:

pjwhite

Try actually playing two notes on a piano simultaneously.  You could put a microphone above the strings and measure the waveform with an oscilloscope.  I'll bet there's always going to be at least 1-5ms of variation in the attack between the notes, no matter how "perfectly" your hand strikes the keys.  Three or more notes at the same time will have even more spread.  I think MIDI latency is not really a problem for normal type playing.