4 ms·
One thing Forth is great at is signal processing. This was kind of a revelation to me when I tried Paul Batchlor's Sporth, a Forth-style language specialized in
by pierrec 8y ago
One thing Forth is great at is signal processing. This was kind of a revelation to me when I tried Paul Batchlor's Sporth, a Forth-style language specialized in audio processing.
Nowadays audio synths and effects are most commonly represented as interactive spaghetti diagrams connecting basic DSP blocks together into directed graphs determining the signal flow. To make a good audio programming language, the question then becomes: is there a nice textual representation for this kind of graph? And Forth is a great answer to that question.
I had so much fun with Sporth that I ported it to the browser and made an online playground for it: https://audiomasher.org/ https://audiomasher.org/ with some examples: https://audiomasher.org/browse https://audiomasher.org/browse and a tutorial: https://audiomasher.org/learn https://audiomasher.org/learn
- vanderZwan 8y agoVery, very cool! Little bit of feedback: it only plays when the tab has focus - is that a browser thing, or something could theoretically be overridden? EDIT: Opening the tab in a separate window keeps the sound running even when alt-tabbing away EDIT2: The interactive cook book environment are missing a previous and next link at the top/end of each chapter, clicking back and finding which chapter is next is a little bit tedious.
- pierrec 8y agoThanks for the feedback! I roughly added some previous and next links as you suggested. As for playing audio from a background tab, I believe browsers actually allow it, but for some reason, audio played though emscripten's APIs seems to stutter or stop when the tab is backgrounded. It might not be hard to fix, but I haven't really looked into it.
- hutzlibu 8y ago" is that a browser thing" Unfortunately and thanks to many misusing auto-playing ads - it is. Sounds can only start playing if the tab is the active one.
- vanderZwan 8y agoAh yes, that does sound like a very valid reason to turn that off. At least the open-in-separate-window trick works around it.
- pierrec 8y agoAs you point out, sounds can only start in foreground tabs, but the glitch here is that already-running audio is getting stopped when the user switches to another tab. So it's a bug in my code!
- zebproj 8y agoCreator of Sporth here. AudioMasher is a really cool project! Projects like this make me really glad I open sourced Sporth. It's really cool to see what sorts of things people will use it for. In addition to learning the API and porting it to the web (with no assistance from me), Pierre has also composed some very beautiful patches in Sporth using his AudioMasher tool. It is always easier to leave things as a "technical demo", so I appreciate the extra effort. You kind learn more about Sporth here: https://pbat.ch/proj/sporth.html https://pbat.ch/proj/sporth.html and the code can be downloaded here: https://www.github.com/paulbatchelor/sporth.git https://www.github.com/paulbatchelor/sporth.git
- vanderZwan 8y agoWhy not link AudioMasher from the Sport project page too?
- zebproj 8y agoI should, but I haven't gotten around to updating the page yet. I've been busy with other projects.