Luigi Cortese
Luigi Cortese

Reputation: 11131

Supercollider: why assigning SinOsc to a variable x won't allow to plot the variable

I'm new to Supercollider, couldn't find a lot of resources to learn from, so I'm proceeding by attempts and intuitions to some extent.

I can get a wonderful sine wave with this line of code

{SinOsc.ar(freq: 440.0  , phase: 0.0, mul: 0.7  , add: 0.0)}.plot;

enter image description here

But i'm only gettig a flat line with this one

(
x=SinOsc.ar(freq: 440.0  , phase: 0.0, mul: 0.7  , add: 0.0);
{x}.plot;
)

enter image description here

To me those two statements seem equivalent, but I'm obviously missing something crucial. What is happening behing the scenes? Why/how are they actually different?

Upvotes: 0

Views: 47

Answers (0)

Related Questions