wanting to make some music thats liner based and was trying to have trig/env synced to note starts, as doing it I felt my way of thinking was clunky. So checking in hopes to see how others think about it…
\[ [48 60 72] nnhz = pitches
[.5 .25 .75] = durs
pitches durs 1 steps = freq
1 durs 1 imps 1m .4 decay2 = env
freq 0 saw 1200 .1 rlpf env * cyc .1 * 1m splayd softclip
] play
yea feels clumsy
What do you mean “liner” based?
I just started messing around myself, but quickly becoming enamored with this language. Excited to share snippets and to explore what’s there with other folks.
What do you find clunky about your example? My guess is the use of steps and then again imps and the duplication around the usage of durs. That is, it doesn’t feel very DRY?
I guess I say linear because before I was really using sapf to make strange sounds and textures. Now I’m trying to think of beginning to ends.
Mainly, I think clunky because I’m sure that the same result can be done with our less code.
I share your excitement for sapf really loving it.
While you could probably get down to a one line, I like the fact that your example is “readable”. This aspect of SAPF is fascinating to me - being able to get things honestly too compact, but sufficient language design allowing a more “structured” approach.
Not shorter, but I thought it might be clearer if you used seq and a single trig source to get the freq and the env:
\[ [.5 .25 .75] = durs
[48 60 72] nnhz = pitches
1 durs 1 imps = trig
pitches trig seq = freq
trig 1m .4 decay2 = env
freq 0 saw 1200 .1 rlpf env * cyc .1 * 1m splayd softclip
] play
I like this change. yea I only came to sc and sapf via working with physical synths so have no other coding experience before. But now want to study code and see what directions it takes and go against my old ways of thinking some.