Does anybody know why Buffer.sendCollection doesn’t work in Pfset’s func
Works with .loadCollection though.
Related to “streaming” I guess, but couldn’t find much about how to deal with such cases
so, for the following Pfset:
(
SynthDef(\foo, { |out=0|
var a = SinOsc.ar(\freq.kr(444) * [0.99, 1.01]);
a = a * EnvGen.kr(Env.perc(0.01, 1), doneAction: 2);
Out.ar(out, a * 0.5)
}).add;
SynthDef(\fx, { |out=0|
var a = In.ar(\inBus.kr(), 2);
a = Shaper.ar(\buf.kr, a);
Out.ar(out, a)
}).add;
)
(
Pfset(
func: {
var sz = rrand(1, 5);
var tf = Signal.sineFill(
size: 513,
amplitudes: Array.fill(sz, {rrand(0.1,1.0)}),
phases: Array.fill(sz, {rrand(0.0, 2*pi)})
);
tf = tf.normalize(-1.0,1.0).asWavetableNoWrap;
~buffer = Buffer.sendCollection(s, tf, 1);
~inBus = Bus.audio(s, 2);
~x = Synth(\fx, [
\inBus, ~inBus.index,
\out, 0,
\buf, ~buffer.bufnum
], addAction: \addToTail);
},
pattern: Pbind(
\instrument , \foo,
\out , Pkey(\inBus),
\dur , 0.25,
\scale , Scale.major,
\root , 0,
\degree , Pseq([0,2,4,6], inf),
\octave , 4
),
cleanupFunc: {
~x.free;
~inBus.free;
~buffer.free;
}
).play
)
I get:
-> an EventStreamPlayer
ERROR: Message 'playAndDelta' not understood.
RECEIVER:
Symbol 'hang'
ARGS:
Instance of EventStreamCleanup { (0x55851df262e8, gc=DC, fmt=00, flg=00, set=02)
instance variables [1]
functions : instance of IdentitySet (0x55851da249a8, size=2, set=2)
}
false
PROTECTED CALL STACK:
Meta_MethodError:new 0x55851a75b0c0
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = hang
Meta_DoesNotUnderstandError:new 0x55851a75d400
arg this = DoesNotUnderstandError
arg receiver = hang
arg selector = playAndDelta
arg args = [ an EventStreamCleanup, false ]
Object:doesNotUnderstand 0x55851916fac0
arg this = hang
arg selector = playAndDelta
arg args = nil
EventStreamPlayer:prNext 0x55851b4f0640
arg this = an EventStreamPlayer
arg inTime = 2225.771107881
var nextTime = nil
var outEvent = hang
a FunctionDef 0x55851b4ee840
sourceCode = "<an open Function>"
arg inTime = 2225.771107881
Routine:prStart 0x55851b550680
arg this = a Routine
arg inval = 2225.771107881
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Routine>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Object:doesNotUnderstand
arg this = 'hang'
arg selector = 'playAndDelta'
arg args = [*2]
EventStreamPlayer:prNext
arg this = <instance of EventStreamPlayer>
arg inTime = 2225.771107881
var nextTime = nil
var outEvent = 'hang'
< FunctionDef in Method EventStreamPlayer:init >
arg inTime = 2225.771107881
Routine:prStart
arg this = <instance of Routine>
arg inval = 2225.771107881
^^ ERROR: Message 'playAndDelta' not understood.
RECEIVER: hang