SAPF users?

Hi curious if you guys are using SAPF ? And If people want to share experiences. It’s a steep learning curve for me, my only experience with coding is SC, but Im enjoying chipping away at it. Also the sound examples are crazy good.

2 Likes

I would have been trying it out if I had an Apple machine available here—lots of new insights and ideas.

1 Like

just started fiddling - using ToggleTerm in NeoVim to be able to send lines/selections to the REPL and use the same muscle memory I have in SCNvim… will report back after a bit but excited to get it going

2 Likes

Im opening sc and then back and forth testing bits of code out between the two as well

@mikecalvert This can be useful to grasp some fundamentals.

3 Likes

awesome thank you going to watch it now

1 Like

just scratching the surface but if sure feels good to write! so terse…

Some years ago, I’ve worked a bit with it, it is very interesting and sounds very good. The learing curve may be a bit steep, but if you start with small snippets, it is quite understandable. Especially it is good to see how you build things up.

I find it a relief actually, it is so much less to type. So when you think about a modulator, you just write

15 .0 sinosc

and then how much?

15 .0 sinosc 200 *

and from what offset?

15 .0 sinosc 200 * 300 +

modulate the freq of another sinosc: first we need to specify the phase

15 .0 sinosc 200 * 300 + .0

then the oscillator

15 .0 sinosc 200 * 300 + .0 sinosc

then make it a little quieter and play it

15 .0 sinosc 200 * 300 + .0 sinosc .1 * play

What is sometimes hard is that you need to know the number of arguments of a function to read the code. You can the read backwards.

So an editor that would show this would help a lot, like that (hand-drawn), but this is perhaps too simple an example.

Screenshot 2025-02-07 at 17.15.27

2 Likes

can write lispily I guess:

(((150 0 sinosc) 200 * 300 +) 0 sinosc) .1 * play

yes, but this won’t do all the programs that you can write, because some functions leave several objects on the stack. Of course you can rearrange, but you may have to.

you could also write:

15 .0 sinosc 200 300 *+ .0 sinosc .1 * play

And there are some interesting functions in sapf that exploit this.

1 Like

debating whether to alias things to make them more supercollider-y ie wait for sleep and fork for go etc

it’s kind of funny to have such a strong bilingual feeling:
midicps nnhz
choose pick
scramble muss
order grade
inject scan
first head
Pseries().asStream ord

and so on …

Completely agree I also think it sounds really great. And also about a bit difficult to recall where you are in your code. I keep a separate window open of help file so I can check the number of input’s. But maybe this in time this will become ingrained in memory…

Haskell also doesn’t use parentheses, but the number of inputs is in the type definition, and apart from that, it’s not significantly different from the other languages in this particular point.

1 Like

Extra tricky because of postfix- your editor can’t remind you until it’s too late!

it forces me to slow down and look over what I put down multiple times… James must have laser focus

curious if you are using an IDE or just terminal ?

Using Neovim with TogglleTerminal plugin !

1 Like

missing something obvious probably… trying convert this simple SC patch

(
{
	SinOsc.ar(
		Latch.kr(
			LFSaw.kr(Line.kr(0.1, 20, 60), 0, 500),
			Impulse.kr(10)),
		mul: 0.1
	)
}.scope(1)
)

to sapf … which I was thinking might be this

\[
	.1 20 60 line 0 lfsaw 500 * = in
 	10 0 impulse = trig
 	in trig sah = sh
	sh 0 sinosc .2 *
 ] ! play

see anything obvious ?