[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] behavior when assigning SynthDef to NodeProxy



it's a subtle issue.  not sure if it counts as a bug.
in your example the ndef ends up as a control rate proxy.

s.boot;
Ndef(\foo).clear
Ndef(\foo, SynthDef(\w, { arg out=nil; Out.ar(out,SinOsc.ar([Rand(430, 600), 600], 0, 0.2)) }););
Ndef(\foo).rate  //control - NOTE! should be audio

a workaround is to make sure you create an audio rate proxy before assigning the synthdef
Ndef(\foo).clear
Ndef.ar(\foo, 2);  //create the node proxy in audio rate
Ndef(\foo, SynthDef(\w, { arg out=nil; Out.ar(out,SinOsc.ar([Rand(430, 600), 600], 0, 0.2)) }););
Ndef(\foo).rate  //now we get audio rate!
Ndef(\foo).play;  //and this work
Ndef(\foo).stop;

another way to write it is...
s.boot;
SynthDef(\w, { arg out=nil; Out.ar(out,SinOsc.ar([Rand(430, 600), 600], 0, 0.2)) }).add;
Ndef(\foo, \w);
Ndef(\foo).rate  //here we get audio
Ndef(\foo).play;
Ndef(\foo).stop;

_f

> 9 jan. 2019 kl. 05:33 skrev clfest@xxxxxxxxxx:
> 
> How come when I execute:
> 
> s.boot;
> 
> Ndef(\foo,
>     SynthDef("w", { arg out=nil; Out.ar(out,SinOsc.ar([Rand(430, 600), 600], 0, 0.2)) })
> )
> 
> the 'w' plays on bus 0, and even executing
> 
> Ndef(\foo).stop;
> 
> Will not stop it?
> 
> I'm trying to get a SynthDef that I can use from another pattern that is enclosed within
> a Ndef.
> 
>             Thanks For Your Attention
> 
> 
> 
> -- 
> Time is an imaginary number. Entropy always wins.
> 
> 
> _______________________________________________
> sc-users mailing list
> 
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/


  #|
     fredrikolofsson.com     musicalfieldsforever.com
  |#


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/