Offset Misunderstanding

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

Offset Misunderstanding

Marigold Maripol
Hi All-

My understanding is that the modulating SinOsc in this example
produces a signal of +/- 0.1 - and the add of the main SinOsc is set
to 0.9.
I'd expect the result to produce a range of 0.8 to 1.0.
Seems to be producing something in the range of 0 to 1, though, on my
SuperCollider...
3.8.0, running OSX....

{SinOsc.ar(300, 0, SinOsc.ar(0.3, 0, 0.1), 0.9)}.play;

_______________________________________________
sc-users 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-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: Offset Misunderstanding

LightRate
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Offset Misunderstanding

ddw_music
In reply to this post by Marigold Maripol
Marigold Maripol wrote
My understanding is that the modulating SinOsc in this example
produces a signal of +/- 0.1 - and the add of the main SinOsc is set
to 0.9.
I'd expect the result to produce a range of 0.8 to 1.0.
Seems to be producing something in the range of 0 to 1, though, on my
SuperCollider...
3.8.0, running OSX....

{SinOsc.ar(300, 0, SinOsc.ar(0.3, 0, 0.1), 0.9)}.play;
I can't reproduce that problem here (Linux).

Your understanding is correct, btw. If I adjust the modulator so that it begins at its maximum amplitude (phase = 0.5pi makes it a cosine rather than a sine oscillator), and plot, the displayed range is clearly 0.8 - 1.0.

{ SinOsc.ar(300, 0, SinOsc.ar(0.3, 0.5pi, 0.1), 0.9) }.plot;

If you see something different, also try tracing the synth:

a = { SinOsc.ar(300, 0, SinOsc.ar(0.3, 0, 0.1), 0.9) }.play;

^^ note "a = ..." -- IMO it's generally good practice to assign synths to a variable, even if it's just for testing, so that you can do things to it later, such as:

a.trace;

TRACE 1001  temp__1    #units: 10
  unit 0 SinOsc
    in  0.3 0
    out 0.993785
  unit 1 BinaryOpUGen
    in  0.993785 0.1
    out 0.0993785
  unit 2 SinOsc
    in  300 0
    out -0.914479
  unit 3 MulAdd
    in  -0.914479 0.0993785 0.9
    out 0.80912
...

If you're getting a noticeably different output range, you can check the math by hand -- especially "unit 3," which handles the mul and add for the outer SinOsc.

-0.914479 * 0.0993785
-> -0.0908795513015
-0.0908795513015 + 0.9
-> 0.8091204486985

So, on my machine, it checks out.

There have been bugs in the past where some math ops, in the server, calculated incorrectly (especially with vector optimization). I wouldn't expect that here -- MulAdd shows up *often* so it's quite well tested -- but if that is the case here, your manual result would differ from the result in the trace.

hjh