9 ms·
An update to 37-year-old MIDI
- dang 7y agoRecent & related: https://news.ycombinator.com/item?id=22180731 https://news.ycombinator.com/item?id=22180731
- mkaic 7y agoThis seems to just be an articleized version of Adam’s excellent video from several months ago.
- braindeath 7y agoNot a particularly informative or well-written one frankly. "Also, with more memory, there are simply many more possible features that MIDI 2.0 can try to emulate. More memory should also reduce the chance of the timing between playing a MIDI instrument and digital recording to be slightly off. This should mean music played on MIDI 2.0 instruments will feel more analog, and make it possible for non-keyboard instruments to work better with MIDI." Eh? What? "The fact that MIDI 2.0 is bidirectional has two major effects. First, it means that it is backwards compatible, and won’t make the billions of MIDI 1.0 devices already out in the world obsolete." No, backwards compatibility does not follow from MIDI 2.0 being bidirectional. "“I think using a MIDI guitar would change the way I make music. The way our brain orients to making music on a guitar is just different to a keyboard layout. I used to have a MIDI guitar instrument, but I don’t have it anymore because I felt like there was a lot of latency and I didn’t really like the results I got. I am hoping [MIDI 2.0] will solve some of the issues I had before.”" Well prepare to be disappointed. The problems with digital non-keyboard instruments has little to do with MIDI. In the case of a MIDI guitar, the latency problem is an issue of physics, not the digital transport.
- Something1234 7y agoCan you link to the video?
- corndoge 7y agoWho is Adam?
- mhh__ 7y agoAdam Neely, musician and living Jazz meme.
- twelfthnight 7y agoThis is referencing Adam Neely (from the article). I believe they are referencing this video [1]. Overall, Adam Neely's videos are really great. I personally really like his videos on the Star Spangled Banner and Scotch Snaps. [1] https://www.youtube.com/watch?v=QvJhLQnuktg https://www.youtube.com/watch?v=QvJhLQnuktg
- robbrown451 7y agoMIDI 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 https://bugzilla.mozilla.org/show_bug.cgi?id=836897 -- and it seems to be extremely low priority)
- unlinked_dll 7y agoAudio apps should stay out of the browser
- monetus 7y agoWhy?
- unlinked_dll 7y agoBecause "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 easily crap out with 4-5 voices of polyphony. Now onto why a browser is a bad place to do this. Your audio subsystem supplies a buffer to you (or you supply a buffer to it, depending on OS) and you need to fill it in a fixed amount of time to avoid a buffer underrun, or increase the buffer size. At a 48kHz sample rate and a buffer size of say, 512 (default on MacOS) you have ten milliseconds to fill it. But you don't get all that time. As buffer sizes get smaller, the dominant factor becomes how much time it takes to get data from kernel to userspace, and from userspace down to kernal. In a browser now you have to go from kernel to user space to sandbox down to user space down to kernel. So getting low latency MIDI input to a browser, rendering it to sound, and getting it back, is basically a terrible use case scenario in terms of latency. Yea you can do a lot when you don't care about latency, but then the question is, why would you care about live MIDI input if you don't care about latency? Firefox's audio engine (or at least WebRender) is actually fairly impressive - I've heard things that they can get sub ms latency. But I don't really trust that you can do that and do serious audio processing, which any non-sine synth is going to entail.
- unlinked_dll 7y agoimho MIDI 2.0 hits the low hanging fruit but doesn't go far enough at fixing the biggest problem in professional audio. Deterministic rendering. Basically same input makes the same output, which doesn't happen even in totally digital systems - doubly so with live (or recreated) midi events. I'll give an example - you have your PC with $DAW_OF_CHOICE running and plug in $MIDI_2_CONTROLLER to USB and enable a track and hit record, play your stuff, and stop. When you play it back, unless the cosmic forces are exceptionally on your side, it will not sound the same as when you played it. It's subtle and sometimes ignored or even desirable, but it's there. There are a lot of reasons why this problem hasn't been solved, some technical and others artistic. But imho, a certain grade of equipment (namely, recording/reproduction, of which the MIDI protocol is a key component) should behave identically under the same conditions and be able to reproduce a performance exactly. It's a goal that borders on absurd, but I think we could do it! Namely - enough of this "transport agnostic" horseshit. Give me a professional event protocol that is sent synchronously with the audio, on the wire and on the board. I want my codec chips interleaving midi messages (don't care if they're 16/24/32 bit) as a separate audio channel, even if it is undersampled (eg send LRLRLRMLRLRLRM over I2C at the appropriate clock to have audio in time and MIDI undersampled by 3x per word), I want MIDI events in my interrupt and in the callback, synchronized exactly to whatever audio is coming in at the same time. And give me unadulterated total, absolute dictatorial control over the audio drivers using a ping/pong buffer that gets mapped to memory in the audio callback for my professional application and mine alone. Minimize the kernel time spent mapping physical memory to virtual memory, like ASIO drivers but without the bullshit. I want as little overhead between the frame buffer coming in off DMA to the chip as I want without the possibility of pwning the system. Hell, give me a dedicated core!
- analognoise 7y agoUse an FPGA? I mean that sounds pretty simple, if you think there's a market let's talk.
- unlinked_dll 7y agoSilicon isn't the bottleneck here, you could probably rig it up on existing chips. I can think of a way to do it with a stereo codec and surround codec with a mux in there, it wouldn't be super cheap but for pro gear, who cares. The big blocker is the drivers and compatibility with existing software. Audio people do not like tooling changes, and what I'm talking about is a rather fundamental change to very low level components in MacOS and Windows, the former of which is more important and already does things very well and would take a massive engineering effort with little ROI (CoreAudio is a marvel). On Linux you could do some impressive shit, and how I'd like to do it is via a hypervisor that hogs a core for audio processing and provides an API back to the system for communication. I know there has been some work to do that already, but incorporating hardware changes to support it would be fairly high cost with fairly low ROI. This kind of thing could be done, sure, but the money in pro audio and speed of adoption are non-ideal. You're talking 3-5 years dev cycle to get a prototype shipped and in stores, ask users to give up a lot of hardware, and for a subtle change in what they hear. This would be a project for my free time after an extremely lucrative exit event from my current venture, and I'd have to add it to the list of pro audio paradigm shifts I'd want to work on.
- anigbrowl 7y agoIt won't. Most people aren't interested in those musical subtleties; the ones that are either like their music acoustic (from ballads to grand opera) or listen to experimental electronic music like Autechre which liberated itself from the MIDI straitjacket years ago. It will likely change music performance to some extent, making techno and other highly synchronous styles more fun and interesting to perform live than is currently practical.
- travbrack 7y agoI love how clickbait gets torn apart on this site.
- core-questions 7y ago> 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 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. Higher resolution timing and a greater amount of 'awareness' about the features of the device at the other end so as to facilitate automatic mapping of controls from surfaces to synth parameters is what I would find more useful.
- duskwuff 7y agoAnd 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.
- kazinator 7y agoAlso, 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.
- orangefarm 7y agoIs there any reason why music production in the cloud isn't the standard yet? High-quality VSTs requiree a lot of CPU power. Even my 16-inch MBP easily heats up once I add some more advanced VSTs. I would rather pay X$ per month and have my music production work station in the cloud and interact with it from any old device with a fast internet connection. Working with a buffer size of 512 samples, I currently have a latency of 11.6ms in Ableton. Adding another 10ms latency through the internet connection wouldn't be a drama for me. Working in the cloud would allow me to easily upgrade or downgrade my system based on my needs, better collaboration with others, automatic backups, one-click access to new VSTs and samples, etc. This set up would probably be less ideal for people who actually have to record a lot of 'real' instruments but a lot of music is only created in the box today with VSTs. But I'm surely missing something here. Why hasn't this been a trend yet?
- lend000 7y agoSounds like a business waiting to be born.
- vortico 7y agoAudio over internet would be at least 300ms latency, not sure where you're getting "10ms". Anything over 10ms is annoying, and 50ms is nearly unplayable.
- orangefarm 7y agoWhy would it be at least 300ms latency?
- vortico 7y agoTo send/receive a multi-channel audio/MIDI buffer to/from a server, you need to go through at least a dozen protocols, including waiting for the speed of light between you and your server. If you're in NY and your server is in LA for example, that's already 30ms gone just considering speed of light. Other factors multiply this latency by an order of magnitude.
- kyriakos 7y agoWhy not just use USB? Standardise all instruments on USB and use adaptors for backwards compatibility.
- franky47 7y agoOne 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 https://github.com/FortySevenEffects/arduino_midi_library
- robbrown451 7y agoMost MIDI seems to be done over USB already. MIDI 2.0 is mostly unrelated to the actual connectors and such, it's more about the protocol.
- mhh__ 7y ago"MIDI" on your Desk may well be done over USB but MIDI as a hardware protocol is absolutely rock solid and is the only choice for live music. Speaking as an occasional backstage gremlin, I minimise the USB proportion of the signal path because reduces the amount of testing required (MIDI is generally well implemented on the hardware side, but not all USB midi interfaces are made equal). That and a lot of MIDI is instrument-to-instrument rather than to a PC (Or more realistically a Mac, because you have to have a Mac to be a creative, right...)
- freeone3000 7y agoWindows audio latency increased to a 35ms floor in Vista and never recovered.
- ChuckMcM 7y agoMy "turing test" is whether or not you can tell the difference between Stan Getz playing it and a midi device playing it.
- kazinator 7y agoWhat if it's MIDI that was captured from Stan Getz? What if it's Stan Getz playing live through a MIDI keyboard, into a synth?
- djaychela 7y agoThere are three elements there though: 1) the capture of all the musical and performance input (a wind controller, etc) 2) the transmission of all that information in real-time without latency 3) the conversion of that information into the appropriate sound. Midi is only part 2 of that - advances in other areas are needed for a fully convincing facsimile, but given the incredible improvement in sample-based libraries over the last 10 years or so (and even more so comparing something like a Spitfire Audio library to a synth string patch), it is possible that will be the case, given the investment of time, brains and money.
- kazinator 7y agoBy 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.
- travbrack 7y agoVLC is a pretty good cross platform solution. You do have to load a soundfont, though.
- mmis1000 7y agoIt is possible for current browser to play midi using some JavaScript library just like you use native players to play midi. see MIDI.js. So, for programming usage, it does not matters that much
- TaupeRanger 7y agoWhy in the world would you reference Adam Neely of all people? He is YouTube famous, but by no means a foremost expert on any of this stuff. He literally just reads the feature list in his video and adds some simple explanation while filming himself walking around a convention. If you want to learn about something like this, talk to one of the contributors or an actual hardware/software developer. Neely, like all YouTube explainer-celebrities, is primarily concerned with getting views and having "production quality", while leaving the audience with a vague sense of having learned something without actually having learned anything at all. His most popular videos are chock full of non sequiturs and made-up nonsense.
- philligr 7y agoHis comment about classical betrayed this a bit. It was pretty ignorant (in the pure sense of uninformed) and confusing.
- Jeff_Brown 7y agoI'm happy about it, but if you're able to use Open Sound Control, it's better. Rather than gibberish channel numbers, OSC lets you label your messages meaningfully, as in "/trumpet/volume 100". And it lets you send lots of data types -- numbers, strings, lists -- rather than only numbers.