Live data from Hacker News

An update to 37-year-old MIDI

qz.com

31–40 of 105 posts

Re: An update to 37-year-old MIDI

#31

Why not just use USB? Standardise all instruments on USB and use adaptors for backwards compatibility.

One advantage that MIDI 1.0 had (and still holds) over USB is it's simplicity to implement on low power controllers and devices.

I got into programming 12 years ago thanks to MIDI, I wanted to control some of my guitar pedals with an Arduino, and the simplicity of the protocol definitely contributed to helping me hack things together and learn. I'm not sure it would have been the case if I had to learn the contrived details of the USB stack just to send a simple ProgramChange message (2 bytes) to my pedal (which uses MIDI DIN plugs, no USB there).

I can't wait to see how to get those 2.0 extensions into the library I built for Arduino [1]. Hopefully it will remain simple for newcomers to learn and enjoy programming by interacting with their musical instruments, like I did.

[1] https://github.com/FortySevenEffects/arduino_midi_library

Re: An update to 37-year-old MIDI

#32
post #10

Earlier quoted context omitted.

Why?

Because "the audio thread waits for nothing." Garbage collection is unacceptable, more than a single pointer dereference to get to state is borderline unacceptable, and synthesizers (that an MIDI system would trigger) are up there with some of the most computationally demanding software you can develop even for toy projects. Especially so, even. A naively coded soft synth in C++ talking directly with drivers can easi…

Have you actually tried it? I mean, I build music web apps that run great on Chromium browsers. They use Web Audio API to generate sounds (non sine synths.... Web Audio API allows you to do all kinds of crazy stuff with oscillators and convolvers and such), and they take input from a MIDI keyboard. On a decent computer it sounds great and latency isn't noticeable (to me anyway). I've compared to using various native software synths and don't hear a difference in latency.

Then again, I'm not expecting anyone to use my app to do a performance in Carnegie Hall. I want kids and other mere mortals to be able to have fun while learning and making music.

You don't have to use it, of course, but I'm genuinely curious why you'd want to deny this sort of thing to others.

Re: An update to 37-year-old MIDI

#35

> In MIDI 1.0, all data was in 7-bit values. That means musical qualities were quantized on a scale of 0 to 127. Features like volume, pitch, and how much of the sound should come out of the right or left speaker are all measured on this scale, with 128 possible points. This is not a lot of resolution. For some really sophisticated listeners, they can clearly hear the steps between points. This is extremely misleadin…

And it wasn't even uncommon for MIDI controls to be split into a MSB and LSB value. 14 bits is plenty for most audio values.

Re: An update to 37-year-old MIDI

#36
By the way, seems that MIDI playback support in operating systems and browsers is petering out.

About nine or ten years ago, I had little trouble playing back MIDI files on various platforms.

Recently, I sent an old .mid file that I produced almost a decade ago to someone (at Google!) and they couldn't play it. After trying it myself, I was shocked. Browser after browser, system after system; no dice.

I ended up converting to MP3 using Timidity -> Lame.

Re: An update to 37-year-old MIDI

#37

MIDI 2.0 is awesome and all, but I'd be happy if Firefox supported MIDI 1.0. (only Chrome and Edgium and the like do, Firefox has been saying they will for ages -- https://bugzilla.mozilla.org/show_bug.cgi?id=836897 -- and it seems to be extremely low priority)

I might be hallucinating memories but I'd swear my old MIDI website from 2005 worked perfectly in FireFox, including playing them.

Re: An update to 37-year-old MIDI

#38

> In MIDI 1.0, all data was in 7-bit values. That means musical qualities were quantized on a scale of 0 to 127. Features like volume, pitch, and how much of the sound should come out of the right or left speaker are all measured on this scale, with 128 possible points. This is not a lot of resolution. For some really sophisticated listeners, they can clearly hear the steps between points. This is extremely misleadin…

Also, if we talk about the volume parameter.

The human ear's dynamic range is about 120 dB, which includes about 20-30 dB of pain. With 127 bits, we can map that with 1 dB resolution.

16 bit audio ("CD quality") only has a 90 dB dynamic range.

We would almost never want a single instrument to have a 90 dB dynamic range, but if we did, MIDI values could logarithmically encode it with a better than 1 dB per step resolution.

In a mix, any instrument that is reduced by more than about 20 dB will disappear.

When synthesized music (e.g. electronic drumming) lacks dynamics, it is not because of the encoding of the raw volume parameter. It's due to other factors, like poor synth patches. Poor synth patches use a small number of samples, like say a snare drum being hit in three different ways, and they stretch that over the dynamic range with some naive scaling. A real drum doeesn't work that way; it makes a different sound for each intensity with which it is struck. You need samples of it being played at a myriad volume levels, sort those by intensity and map them to the intensity range.

Some instruments don't even change intensity that much when they are played louder; a lot of the perception of loudness comes from changing harmonic content. If you fake it with one sample that is just volume-adjusted, it will not sound right.

Synthesizers have tricks to help with this, like low-pass filters that respond to velocity: hit the key harder, and more high frequencies go through. That's one tool in the box for creating a more dynamic sound from scratch.

Re: An update to 37-year-old MIDI

#40

> In MIDI 1.0, all data was in 7-bit values. That means musical qualities were quantized on a scale of 0 to 127. Features like volume, pitch, and how much of the sound should come out of the right or left speaker are all measured on this scale, with 128 possible points. This is not a lot of resolution. For some really sophisticated listeners, they can clearly hear the steps between points. This is extremely misleadin…

> This is extremely misleading. Sure, the velocity input into your synth is going to be at 7-bit resolution, but at soon as the synth has it, it can play anything it wants at whatever volume it wants to based on how you have configured it. There's nothing about the external 7-bit implementation that is really limiting the dynamics of the synth itself.

I don't agree. Musical sounds are evolving, so one should not be seeing a note as "keeping a value zero-order sampled for a period" -- consider tremolo, sliding, etc.

When it's one more dimension to consider than just a point, the limitation of 7bit is shown. Consider a lowpass filter commonly found on a synth. Play a note, and turn the knob all the way down. On an analog device the transition will be smooth and you'll hear the filter gradually "closing down". If the knob is mapped to 0-127, you can easily hear the steps (sounds like discrete i----a----o----u----n----).

Sure there are non-standard 14bit encodings (NRPN), but that's manufacturer-specific, and doesn't communicate.

The article is right that MIDI 2.0 will make it feel a lot more "analog".

Post reply on HN