Fork me on GitHub
#overtone
<
2018-08-02
>
Fereidoon06:08:28

This gets the error

overtone.sc.machinery.ugen.sc_ugen.ControlProxy cannot be cast to
   java.lang.Number
. How can I fix it? I don’t want n to be a ControlProxy, just a normal argument.

hlolli09:08:24

@rudiwillalwaysloveyou you cant pass clojure number like that. You will need to pass it as buffer and use index:kr to get the number. You could write defn wrapper around your synth to do that.

😃 4
👍 4
hlolli09:08:07

There are other ways too, but defsynth is a compile time macro and the parameters are supercollider proxy types. So it corrolates to SynthDef in sc.

hlolli15:08:45

@rudiwillalwaysloveyou reading this again, the problem is not the number. You can of course pass number. I felt like you were trying to pass pre-calculated values. But the problem is ‘repeat’. The error message is misleading and needs to be improved. You need to find sc ugen that does repeat.

Fereidoon09:08:46

Thanks! No, your first answer is exactly what I’m looking for.