if only for educational purposes, any ideas for embedding it in clojure?
Likely there are some interesting cross pollination of ideas that could emerge from looking at SaPF. Stack based languages manage to surpass Lisp’s sexps in their reduction of syntax. And APL’s rank polymorphism certainly offers some musically interesting ideas.
Finally gave sapf a shot. Wow it's sleek!
imagine if you could schedule synths from overtone? coordinate supercollider and sapf synths via at-at
could we add namespacing to sapf, like overtone does for supercollider?
and allow clojure code to interleave with the sapf dsl? for example, we could compute the notes of this Bach prelude in Clojure and splice it in when sending it to sapf https://github.com/lfnoise/sapf/blob/e798a7b9e35c5ee8011ed6a3bae7f03695053a31/sapf-examples.txt#L738-L762
For me it is great, since I’ve been talking a big talk about the potential of APL and stack languages for music expression, at various gatherings of experimental music folk. So now I can put those ideas to the test, without having to create something like sapf myself.
This seems like a good opportunity for me to understand that expressive power and the implementation of stack based langs. Looking at https://github.com/lfnoise/sapf/blob/main/sapf-examples.txt there's a bunch of regular forms like project Euler solutions. Maybe a good place to start for a Clojure DSL.
I prototyped a namespace calling sapf from clojure and scheduling with at-at. a limitation I found was that stop is quite expensive. I don't think you can stop individual instruments.
Maybe an overtone namespace could provide the stack-based syntax. Perhaps this SC example could be translated to overtone => SC via an embedded DSL:
;; the analog bubbles example from SuperCollider:
.4 0 lfsaw 2 * [8 7.23] 0 lfsaw .25 * 5/3 + + ohz 0 sinosc .04 * .2 0 4 combn playI don't fully understand the differences in capabilities between SaPF and SC, but it might at the very least be a fun alternative syntax.