I learned programming twenty years ago by clicking View Source on random websites.
Time was when you could just read the code on the average website! That's quite rare now.
I used sfxr in some game jams last year, except I shipped the library with the game and had it generate sounds at runtime. (I don't think it's smaller/faster than the mp3s would have been, but it was very satisfying!)
I also used Software Automatic Mouth (originally for the C64) for TTS:
https://fenomas.github.io/wafxr/
It can export wav files, but its main purpose is to generate code snippets for playing the sound effect through webaudio, underneath using a much more general library. But people familiar with audio synthesis might prefer just using the underlying dependency directly - it basically turns arbitrary config into webaudio. This playground shows how it works:
I'm not sure what this webpage is, jsxfr is the name of the JavaScript library on nodejs which is a different url to this page.
But yeah once you start generating things procedurally you can do things like generate 10 sounds with subtle variations to make things less repetitive.
Basically:
- The original sfxr was a win32 app, ca. 2007
- There was later a widely-used Flash port called as3sfxr, ca. 2010
- This page (TFA) is a JS port of sfxr, ca. 2011.
- `jsfxr` on npm was originally a separate JS port of as3sfxr, ca 2014
- Current `jsfxr` on npm appears to have changed hands in 2022, and is now a fork of TFA with somebody else's contributions (and a paid version, confusingly branded as "sfxr")
I tried to create a tone in Glicol (https://glicol.org/) with some random idea there and it works quite well:
``` o: squ ~pitch >> mul ~amp_env >> mul 0.4;
~amp_env: ~trigger >> envperc 0.02 0.19;
~pitch: ~pitch_env >> mul 200 >> add 200;
~pitch_env: ~trigger >> envperc 0.01 0.15;
~trigger: speed 4.0 >> seq 60
```
This predates the WebAudio API, and so it builds data URLs as WAVs instead. Every sound can be represented as a short string, and the tool can be used as a library that procedurally generates the sounds from the strings. It also has a "song mode" where notes can be provided to guide the sound, which makes certain types of more complicated sounds possible to make, including jingles and short songs.
It's definitely dated now, but if anyone is interested, you can find it here
https://www.leshylabs.com/apps/sfMaker/
See the "Example Sounds" at the bottom of the page to hear what it can do.
tlhunter•6mo ago
aYsY4dDQ2NrcNzA•6mo ago
fenomas•6mo ago