NewsLab
Jun 28 17:25 UTC

How do you keep Web MIDI from crashing a 1983 synthesizer? (knob.monster)

51 points|by halfradaition||25 comments|Read full story on knob.monster

Comments (25)

25 shown
  1. 1. sargstuff||context
    Nice retro-demo/motivation for "what's the point of protocols/abstraction layers"[0].

    Use case argument for an add-on programmable logic array / micro controller board as security interface / non-standard to standard protocol translation.

    ----------------------------------------------------------------------------------

    [0] : https://www.terryewell.com/m116/Docs/historyMIDI.pdf

  2. 2. halfradaition||context
    We just throttle the Web MIDI stream in JS with 100ms pauses between packets so the 8-bit CPU doesn't choke.
  3. 3. Macha||context
    I had the opposite problem where using my (recent-ish) cheap midi keyboard with WebMidi was crashing Firefox.
  4. 4. halfradaition||context
    That's usually caused by cheap controller firmware flooding the connection with continuous Active Sensing signals (0xFE bytes every 300ms) or noisy clock jitter.
  5. 5. im3w1l||context
    That's one way to look at it, but imo firefox shouldnt crash no matter how malformed the data is.
  6. 6. tgv||context
    Also, the sensing command is one byte per 300ms. That's irritating when you have to deal with it personally in real time, but for a modern computer, that's peanuts.
  7. 7. _def||context
    tangent/feedback about the product: replacing abandoned desktop apps with a webapp with unknown future does not exactly excite me. Bundle this as a desktop app that works offline-first and you'll pique more interest.
  8. 8. halfradaition||context
    Fair point. We went web-first to bypass driver installation hell, but a local Tauri app for offline-first use is on the roadmap.
  9. 9. nl||context
    Strong disagree!

    Zero install is a huge feature both to reduce friction and to save local storage. I don't want to install yet another synth I'll use twice a year.

  10. 10. gbanfalvi||context
    You can offer standalone exes without installers.
  11. 11. RestartKernel||context
    Implementing in native code and compiling to WASM would make for a good compromise.
  12. 12. nine_k||context
    Zero install and locally stored, as one HTML file, or as a web bundle.
  13. 13. pjmlp||context
    A long forgotten feature of desktop OS, incredible how knowledge goes lost within a lifetime.
  14. 14. brandonmenc||context
    Yeah, and I'm certainly not paying $20 a month - indefinitely - for it.
  15. 15. teliosix||context
    The pricing is totally absurd to the point I don't even want to investigate this further because the pricing is so stupid.
  16. 16. kazinator||context
    You don't have to go the 1980s to find equipment that can't keep up.

    I have an older rev of a Digital Loggers web power switch, before they went to Linux.

    In one lab setup at a previous job, I had to put it on a VLAN; broadcast traffic was killing its ethernet stack, making it hard to connect to its web UI.

  17. 17. peteforde||context
    There's a little pop-up quiz in the bottom right of this page. "Describe your studio setup" and my mild dyslexia kicked in. I almost clicked the first answer because I initially read it as "just one or two bedrooms full of vintage synths".
  18. 18. TazeTSchnitzel||context
    In my experience the amount of buffering you get for USB MIDI seems to be highly variable. I've had incredibly frustrating problems with mysteriously vanishing commands with two different USB-MIDI adapters on macOS (to the point I would consider macOS unusable for MIDI, but since nobody else has ever complained about this it must be a quirk of the 2017 MacBook); on Windows, everything is always buffered properly; and then on Linux, it usually works, but then will randomly blow up.

    Anyway, the æsthetic of this website trips my vibe-coding sense, though I might be oversensitised. I find that pretty depressing, because MIDI is a field of carefully designed resource-constrained systems, everything has been meticulously hand-crafted by generations of engineers and there is nothing so complex it would make sense to resort to AI. (Here's my own MIDI SysEx project that's all hand-written, by the way: https://hikari.noyu.me/etc/SoundPalette. Not trying to self-promote, I just wonder if it might be interesting.)

  19. 19. tgv||context
    A sysex librarian for $230 per year? For a small number of machines which are getting rarer and rarer? Who are your prospects? I hope you support plain .syx downloads, because at that price, you're bound to go under, and your users will want their data when that happens.

    Because the competition is free. There's a free DX7 plugin (https://asb2m10.github.io/dexed/) that includes a librarian, and there's a paid one (https://www.plogue.com/products/chipsynth-ops7.html; outstanding emulation) that also has a librarian (that I have personally used on a mac).

  20. 20. somat||context
    I have only messed with midi virtually so don't know much beyond the bit packing. But when you go to actual hardware and cables is there not a rigid speed it should be running at. 30Kbaud or something. That is, why is the interface running too fast and crashing the synth? the synth(no matter how old and limited) should handle the specified 30Kbaud stream all day long.
  21. 21. theblazehen||context
    Not necessarily. The RTS/CTS pins on the serial port are there for the device to tell the host "stop sending data, I need to process the data already sent"

    The reason this doesn't work is that USB adapters don't have those pins, and thus assume you can send it at 30kbaud - not respecting when the device says it must pause sending data.

    By introducing a static flow rate below what the CPU can handle, it should theoretically keep the flow rate below the threshold that the CPU starts to choke at

  22. 22. dezgeg||context
    MIDI doesn't have RTS/CTS pins...
  23. 23. theblazehen||context
    Well that's on me for assuming :/ I assumed that it did, based on it being explained in the blog post
  24. 24. piva00||context
    US$ 20/month for a SysEx librarian backup? Or US$ 599 for a "lifetime" license of a solution that mostly depends on this company existing to keep the precious backups?

    That's more money than a fully fleshed out DAW like Ableton Live, Bitwig, Logic, etc.

    > Every vintage synthesizer is a ticking time bomb. The soldered internal battery will die, erasing every custom patch you have ever made. Secure your irreplaceable sounds before your hardware turns silent.

    The marketing copy is also really obnoxious to try to sell this solution. Yeah, induce fear to try to convince someone to pay a quite hefty amount of money for saving vintage synths patches.

    I really don't understand the direction of this product, and I'm very much its audience/market...

  25. 25. omneity||context
    The Web MIDI API[0] used by the author has a built-in precise scheduler, that has higher precision and works better than the unreliable setTimeout approach used by OP when coupled with the Performance API[1].

    Pass a timestamp as the second argument to midiOutput.send(data, timestamp), calculated with performance.now. Something like midiOutput.send(data, performance.now() + offset)

    0: https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutput/...

    1: https://developer.mozilla.org/en-US/docs/Web/API/Performance...