Variable for Rest

hello!

I am a little confused about how I would sequence Rest times for \dur in pbind? Or in that case any pbind argument?

I get the error
ERROR: Primitive ‘_Event_Delta’ failed.

When I want to do something like this-
\dur, ,Pseq([0.2,Rest(Pseq([0.3,0.01],inf).asStream)],inf),

same result if I get rid of .asStream

Thanks!

Hi,

you could write

(
Pbind(
	\dur, Pseq([0.2, Prand([0.3, 0.1]).collect(Rest(_)) ], inf),
	\note, Prand((1..10), inf)
).play
)

which is short for

(
Pbind(
	\dur, Pseq([0.2, Prand([0.3, 0.1]).collect { |x| Rest(x) } ], inf),
	\note, Prand((1..10), inf)
).play
)

If you think that this is clumsy - I agree, you’d be not the first one. See this thread:

https://scsynth.org/t/pbind-and-samples-with-different-durations-2

IMO something like Pattern.rest or Pattern.asRest should exist, but there is no consensus on that. You could also take James’ suggestion Prest from there.

This has come up often enough that I’m willing (after the dust settles from a few things at work) to make this my first RFC.

See this thread:

https://scsynth.org/t/pbind-and-samples-with-different-durations-2

IMO something like Pattern.rest or Pattern.asRest should exist, but there is no consensus on that. You could also take James’ suggestion Prest from there.

chuckle I just reread that thread… I don’t have a lot to add to it, and tbh, my opinion hasn’t changed very much.

  • In pattern-land, the baseline way to modify patterns’ results is a filter pattern: Pfin, Pcollect etc.

  • EDIT deleted one point because it wasn’t true.

  • I’d also argue that reading the code out loud doesn’t work very well for a rest method. pattern.collect(func) reads as “I have these values, and I want this operation to be done for them.” pattern.rest reads as “I have these values, and… oh, by the way, I want them to be rests.” The latter strikes me as awkward, where the former does not.

  • Last, I now think Prest should have a count argument (like Pfin) instead of a probability, default = 1. It seems to me that the typical case is to interlace a single rest in the middle of some other sequence. (Unless you’re John Cage, you never want an infinite stream of rests.) Tendency masking should be done by another class.

hjh

Thanks so much! This really helpful.

I also very much appreciate this!

Submitted: https://github.com/supercollider/rfcs/pull/4

hjh

1 Like

Thanks for this initiative, James !