PS. I've recently implemented an FM / additive / modular synthesizer entirely in SQL: https://github.com/ClickHouse/NoiSQL
44100 AS sample_frequency
, number AS tick
, tick / sample_frequency AS time
I see this used a lot in Haskell, nix, and sometimes other languages (first time here with SQL). I personally find it very odd to read
. It feels like starting a sentence with a dot, instead of ending it with one, which feels quite jarring
. What is the primary motivation for employing this style, especially in languages (like SQL) where this doesn't seem to be the norm? And especially for the languages (Haskell, nix) where this is the standard (?) coding style, wouldn't it be preferable to use a different token as the separator, one that doesn't look as odd at the beginning of a line?
If you put the comma at the end, and then you need to add a line, you either:
* Insert the new item "in the middle" of the list. This is often possible, but not always.
* Add the new item to the end of the list, in which case the the line that was at the end before will now need to be modified to add a line.
Lines that begin with the coma can be more easily moved around/resorted. With the comma at the end, if you put the "last" item in the middle, you also need to add a comma at its end (and remove the comma from the new item that is now the final one).
Personally, I like languages where you can simply leave a comma at the end of a list or enumeration without this being deemed a syntax error (for example, in Lua the table {1,2,3,} is equivalent to {1,2,3} )
Practically: Overkill to avoid "no final commas in JSON" moments.
If anyone's interested, some years ago I made a wrapper library for things like this, to wallpaper over the famously hairy WebAudio synthesis API. Basically you pass in a static object describing the audio graph and parameters you want, and the lib creates the WebAudio nodes and then cleans them up after the sound releases (hopefully without clicks, unless you specifically want them).
Audio processing and synthesis is one of those things where you can do high quality in real time on mobile devices, and achieve delicious fast feedback loops. Creating new interactive modes of creativity! It's less possible with video because of the complexity and added cost. Right now anyway.
So exciting! I know the synth may look simple, but it's my feeling that it's really well made.
Regarding commenters mentioning click artefacts...that's troubling! I personally did not encounter it here, but I find, quite strangely I think, that: click artefacts are almost a "Random" bug. They show up sometimes, but not other times, even if everything else is seemingly the same.
That's been my experience. Maybe it's an "artefact" (pun intended) of dealing so closely with hardware. I don't know! Any experts want to weigh in on a way to avoid click crunches in WebAudio?? :)
edits in italic:
I found the GitHub repo: https://github.com/mizuhiki/webfmsynth from 11 years ago!!!! :) ;px xx ;p
More fascinatingly it seems the original genesis of this project and its innovations came from the guy's academic work: https://github.com/mizuhiki/webfmsynth/blob/2cd2655fb5f8e1f7...
you can check my project; audio synthesis in browsers without gc
Post a Show HN
Looking into it, it's kind of crazy it's an ECMAScript standard, and that its spiritual successor is TypeScript.
Language aside. Flash offered so much. I wonder if we're mostly caught up now, but it's taken years!
https://en.wikipedia.org/wiki/MUSIC-N
This goes back to 1957, and as the article notes, is the parent of many of the most used synthesis languages right down to the present day (which is both good and bad).
I wonder if there's more performant wasm implementations that can interface with the WebAudio API [2]? Quick search brings up things like [3]
[1] https://en.wikipedia.org/wiki/Frequency_modulation_synthesis
[2] https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_A...
https://gist.github.com/jacobd/e08fc227671328f6de5cd5a337262...
https://gist.github.com/jacobd/e08fc227671328f6de5cd5a337262...
This also enables multi-key support so you can have chords and whatnot
This is really cool. The only thing I found kind of odd was you click the down arrow to increase the program number instead of up.