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

[sc-users] Expected behavior of NodeProxy in math ops?



I've just seen something very strange.

~ffreq = 2000; ~ffreq.addSpec(\ffreq, \freq);
~ffreqeg = { |t_trig| (~ffreq.kr * EnvGen.kr(Env(#[1, 80, 1], #[0.002, 0.5], \exp), t_trig)).clip(20, 20000) };

s.sendMsg(\n_trace, ~ffreqeg.objects[0].nodeID);

TRACE 6878  temp__0ffreqeg_0    #units: 13
  unit 0 TrigControl
    in
    out 0
  unit 1 EnvGen
    in  0 1 0 1 0 1 2 -99 -99 80 0.002 2 0 1 0.5 2 0
    out 32.7969
  unit 2 In
    in  24
    out 224.404
  unit 3 BinaryOpUGen
    in  224.404 32.7969
    out 7359.75
  unit 4 Clip
    in  7359.75 20 20000
    out 7359.75
  unit 5 Control
    in
    out 1
  unit 6 Impulse
    in  0 0
    out 0
  unit 7 BinaryOpUGen
    in  1 0
    out 1
  unit 8 Control
    in
    out 0.02
  unit 9 BinaryOpUGen
    in  0.02 0
    out 0
  unit 10 EnvGen
    in  1 1 0 0.02 2 0 2 1 -99 1 1 1 0 0 1 1 0
    out 1
  unit 11 BinaryOpUGen
    in  7359.75 1
    out 7359.75
  unit 12 Out
    in  25 7359.75
    out

I'm repeatedly triggering t_trig, so this result is expected.

But...

~ffreqeg = { |t_trig| (~ffreq * EnvGen.kr(Env(#[1, 80, 1], #[0.002, 0.5], \exp), t_trig)).clip(20, 20000) };

If I remove the .kr from ~ffreq, the synth for this nodeproxy goes completely bonkers.

TRACE 6879  temp__0ffreqeg_0    #units: 21
  unit 0 TrigControl
    in
    out 0
  unit 1 EnvGen
    in  0 1 0 1 0 1 2 -99 -99 80 0.002 2 0 1 0.5 2 0
    out 50.5742
  unit 2 In
    in  24
    out 224.404
  unit 3 In
    in  24
    out 224.404
  unit 4 In
    in  25
    out 20000

^^ Hm, nothing in my synth function asks for the value of ~ffreqeg... why would this NodeProxy be reading from its own bus?

  unit 5 LinXFade2
    in  224.404 20000 -1
    out 20000

^^ And this, really? LinXFade2, with a pan input of -1, should output the *first* input, not the second... that's seriously messed up.

  unit 6 BinaryOpUGen
    in  20000 50.5742
    out 1.01148e+06
  unit 7 Clip
    in  1.01148e+06 20 20000
    out 20000
  unit 8 In
    in  25
    out 20000

^^ And why is all of the above repeated? This is a *mono* control-rate synth!

  unit 9 LinXFade2
    in  224.404 20000 -1
    out 20000
  unit 10 BinaryOpUGen
    in  20000 50.5742
    out 1.01148e+06
  unit 11 Clip
    in  1.01148e+06 20 20000
    out 20000
  unit 12 Control
    in
    out 1
  unit 13 Impulse
    in  0 0
    out 0
  unit 14 BinaryOpUGen
    in  1 0
    out 1
  unit 15 Control
    in
    out 0.02
  unit 16 BinaryOpUGen
    in  0.02 0
    out 0
  unit 17 EnvGen
    in  1 1 0 0.02 2 0 2 1 -99 1 1 1 0 0 1 1 0
    out 1
  unit 18 BinaryOpUGen
    in  20000 1
    out 20000
  unit 19 BinaryOpUGen
    in  20000 1
    out 20000
  unit 20 Out
    in  25 20000 20000
    out

Somehow I think this is not quite ideal behavior.

hjh