• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Bass Whistle in the Browser

    April 19th, 2020
    music, tech, whistling  [html]
    Last summer I wrote some code that would let you control a bass synthesizer by whistling (details). I wrote it in a low-level language so I could minimize latency, but the downside is that it's a bit of a pain to install and try out. After playing around with the Web Audio API yesterday, however, I realized I could make a demo in JavaScript. Here it is: bass-whistle-js.

    Currently this only works in Chrome, because Firefox and Safari haven't implemented AudioWorklet yet. It has enough latency to be painful, even though the AudioContext is running with minimum latency settings. I suspect this is Chrome layering several buffers, and comes from optimizing for something other than what I want (cross-platform, simplicity, minimizing dropouts, power consumption). Still, it's neat that this works at all!

    Debugging my AudioWorklet port was painful, as browser debugging goes. Devtools doesn't understand the worklet very well, and so several syntax errors in the worklet were reported as syntax errors in the UI thread code (crbug.com/1073300). The devtools "disable cache" setting also doesn't seem to apply to worklet modules (crbug.com/1073297), and they don't even show up in the Network tab (crbug.com/1073295), so I put in a cachebuster during development. I also managed to make the browser unresponsive by logging too much (crbug.com/1073301).

    Comment via: facebook, lesswrong

    Recent posts on blogs I like:

    Case Selection

    Eric and I recently sent in a list of criteria for case selection. We’re currently funded for 6 detailed case studies, of which one is the Green Line Extension in Boston due to funding from a different grant. My guess is that we need about 15-20 different…

    via Pedestrian Observations August 1, 2020

    Collections: Bread, How Did They Make It? Part II: Big Farms

    This is the second part of our look at the basic structure of food production (particularly grains to make bread) in the pre-modern world. Last week, we began by looking at the great majority of our rural population, the little farmers. Now I know everyon…

    via A Collection of Unmitigated Pedantry July 31, 2020

    Attention is your scarcest resource

    how to ration your shower thoughts • care viscerally • monotask • evade obligations • timebox bullshit

    via benkuhn.net July 29, 2020

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact