Re: SynthDef.recvMsg
but this would work for instance:
(
var bndl, buf, def, synth;
bndl = List.new;
buf = Buffer.new( s, 1024 );
def = SynthDef( \test, { arg bufnum;
Out.ar( 0, PlayBuf.ar( 1, bufnum ));
});
synth = Synth.basicNew( \test, s );
bndl.add( buf.allocMsg({ arg b; def.recvMsg( synth.newMsg( nil,
[ \bufnum, b.bufnum ]))}));
// or alternatively:
// bndl.add( def.recvMsg( buf.allocMsg({ arg b; synth.newMsg( nil,
[ \bufnum, b.bufnum ])})));
s.listSendBundle( nil, bndl );
)
// this example is stupid of course because the buffer is empty,
imagine allocMsg is replaced by allocReadMsg
Am 30.04.2006 um 21:24 schrieb Scott Wilson:
> I'd thought about adding this at one point, but I believe that
> since it's an asynchronous command it won't have the effect you
> want (i.e. ordered execution):
>
> s.makeBundle(nil, {
>
> SynthDef(\notready, {
> Out.ar(0, SinOsc.ar(440, 0, 0.1))
> }).send(s);
> Synth(\notready)
> });
>
> [ [ /d_recv, Int8Array[ 83, 67, 103, 102, 0, 0, 0, 1, 0, 1, 8, 110,
> 111, 116, 114, 101, 97, 100, 121, 0, 3, 67, -36, 0, 0, 0, 0, 0, 0,
> 61, -52, -52, -51, 0, 0, 0, 0, 0, 3, 6, 83, 105, 110, 79, 115, 99,
> 2, 0, 2, 0, 1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 1, 2, 12, 66, 105,
> 110, 97, 114, 121, 79, 112, 85, 71, 101, 110, 2, 0, 2, 0, 1, 0, 2,
> 0, 0, 0, 0, -1, -1, 0, 2, 2, 3, 79, 117, 116, 2, 0, 2, 0, 0, 0, 0,
> -1, -1, 0, 1, 0, 1, 0, 0, 0, 0 ], nil ], [ 9, notready, 1000, 0, 1,
> nil ] ]
> FAILURE /s_new SynthDef not found
>
> S.
>
> On 30 Apr 2006, at 19:50, Sciss wrote:
>
>> hallo,
>>
>> what about adding a recvMsg method to SynthDef ? would be usefull
>> in bundle creation without immediate send. here's a proposal with
>> a modified send method :
>>
>> best, -sciss-
>>
>>
>> + SynthDef {
>> send { arg server, completionMsg;
>> server.sendBundle( nil, this.recvMsg( completionMsg ));
>> }
>>
>> recvMsg { arg completionMsg;
>> ^[ "/d_recv", this.asBytes, completionMsg ];
>> }
>> }
>>
>> _______________________________________________
>> sc-dev mailing list
>> sc-dev@...
>> http://www.create.ucsb.edu/mailman/listinfo/sc-dev
>>
>
> _______________________________________________
> sc-dev mailing list
> sc-dev@...
> http://www.create.ucsb.edu/mailman/listinfo/sc-dev