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.@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.
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.
@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.
Thanks! No, your first answer is exactly what I’m looking for.