SinOsc.ar * 1 is audio rate, SinOsc.ar * 0 is scalar rate?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SinOsc.ar * 1 is audio rate, SinOsc.ar * 0 is scalar rate?

Nathan Ho
a small inconsistency i found -- when multiplying a ugen by a scalar,
the rate is different when you multiply by 0. example of a side effect:

// ok
SynthDef(\, { Out.ar(1, LPF.ar(SinOsc.ar * 1, 8000)) }).add

// ERROR: LPF first input is not audio rate:  0 scalar
SynthDef(\, { Out.ar(0, LPF.ar(SinOsc.ar * 0, 8000)) }).add

not a serious problem at all, but i'm curious if this was intended.

sorry if this shows up as a double message, i appear to be locked out of
nabble for some reason.


nathan

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/
i
Reply | Threaded
Open this post in threaded view
|

Re: SinOsc.ar * 1 is audio rate, SinOsc.ar * 0 is scalar rate?

i
Hi Nathan,

If you multiply by 0 it’s optimised out.

SynthDef(\foo, { Out.ar(0, SinOsc.ar(mul:0)) }).dumpUGens

[ 0_DC, audio, [ 0 ] ]
[ 1_Out, audio, [ 0, 0_DC[0] ] ]
-> SynthDef:foo

S.

> On 26 Dec 2017, at 21:10, [hidden email] wrote:
>
> a small inconsistency i found -- when multiplying a ugen by a scalar, the rate is different when you multiply by 0. example of a side effect:
>
> // ok
> SynthDef(\, { Out.ar(1, LPF.ar(SinOsc.ar * 1, 8000)) }).add
>
> // ERROR: LPF first input is not audio rate:  0 scalar
> SynthDef(\, { Out.ar(0, LPF.ar(SinOsc.ar * 0, 8000)) }).add
>
> not a serious problem at all, but i'm curious if this was intended.
>
> sorry if this shows up as a double message, i appear to be locked out of nabble for some reason.
>
>
> nathan
>
> _______________________________________________
> sc-dev mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
> search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/


_______________________________________________
sc-dev mailing list

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