Hi, I’ve just started to learn SC using “The SuperCollider Book” (still in “Beginner’s Tutorial”) and the PDF “A Gentle Introduction To SuperCollider” (just finished the Pattern section). I don’t speak any other computer languages, but have a solid background in analogue synthesizers.
I am interested in realtime manipulation of Patterns, i.e. changing notes and other parameters while the pattern is playing, so that I don’t have to stop it and re-evaluate the code. I figured so much that this can be done using Pfunc
. But I have difficulties understanding and using it.
When I evaluate the following two code blocks together, a chord is being played over and over, I can change the numbers in ~notes
and re-evaluate just that line to change the chord without loosing the “rhythm”.
~notes = [0, 1, 2, 3];
(
Pbind(
\degree, Pfuncn({~notes}, inf),
\dur, 0.5
).trace.play
)
While this allows me to change one chord in real-time, I wonder how I can play the notes in ~notes
as a sequence of notes and change these individually in real-time. The trace
output from the example above tells me that this array [0, 1, 2, 3]
is written into the event stream Pbind
creates. This leads me to believe that the result of
Pfuncn({~notes})
is actually this:
[0, 1, 2, 3]
So I figured I can use this array directly as the list argument for Pseq
, in the hope that this will now play the notes in succession, instead all of them together. So I wrote:
(
Pbind(
\degree, Pseq(Pfuncn({~notes}), inf),
\dur, 0.5
).trace.play
)
Alas, it didn’t work, and the error messages tells me Pseq
expected a non-empty collection, whereas I gave it a Pfunc
. But when I enclose Pfunc
with square brackets to turn it into a collection, I am back at “square one”, because the notes are now played together as a chord again.
Please, can somebody be so kind and help me understand why this doesn’t work and where my thinking went wrong, and how I can accomplish the goal to play the notes in succession and change them in realtime? Thanks much in advance, and sorry for the long & winding post.