(Example code) To make a synthDef more easily readable i wanted to declare my variables in the code using .ir, however this does not seem to work together with SynthDescLib (sliders dont do anything). I don’t know much about .ir initialization or SynthDescLib so maybe someone can help me?
Working code with |args|:
SynthDef(\guiExample, {|freq=100,modFreq=50,amp=0.4|
var sig, mod;
sig = SinOsc.ar(freq,0,0.5);
mod = SinOsc.ar(modFreq,0,0.5,0.5);
sig = sig*mod;
Out.ar(0, sig * amp!2);
}, metadata: (
specs: (
freq: [30,10000,\exp],
modFreq: [5,5000,\exp],
amp: [0, 1, \db]
)
)).add;
)
SynthDescLib.global[\guiExample].makeGui.alwaysOnTop_(true)
Same code with .ir initialization (silders dont work):
SynthDef(\guiExample, {
var sig, mod;
sig = SinOsc.ar(\freq.ir(100),0,0.5);
mod = SinOsc.ar(\modFreq.ir(50),0,0.5,0.5);
sig = sig*mod;
Out.ar(0, sig * \amp.ir(0.4)!2);
}, metadata: (
specs: (
freq: [30,10000,\exp],
modFreq: [5,5000,\exp],
amp: [0, 1, \db]
)
)).add;
)
SynthDescLib.global[\guiExample].makeGui.alwaysOnTop_(true)