So i wanted to create a pan knob for all of my synth to be effected by, so i created the knob, and along with it, two variables; kRight, and kLeft.i multiply the output by those in their respected channels, and used my theory, of the right being just a plain knob, and the left being chnget (“masterpan”)*-1+1 to make it go in the opposite direction, but still be in the range of zero to one, but when i run the synth i get the compiler error: unexpected NEWLINE, expecting ‘,’ or ‘)’ (token “”).
instr 1
iFreq = p4/2
iAmp = p5
kRight = chnget ("masterpan")
kLeft = chnget ("masterpan")*-1+1
kGain chnget ("mastergain")
kEnv madsr chnget:i("attack"), chnget:i("decay"), chnget:i("sustain"), chnget:i("release")
kMod1Env madsr chnget:i("mod1attack"), chnget:i("mod1decay"), chnget:i("mod1sustain"), chnget:i("mod1release")
iOsc1Semitone = (2^(1/12)*p4)-p4
aOut vco2 iAmp, iFreq+iOsc1Semitone*chnget:k("osc1fine")
aLp moogladder aOut, chnget:k("filcutoff")*kMod1Env, chnget:k("filreso")
outs aLp*kEnv*kGain*kRight, aLp*kEnv*kGain*kLeft
endin
this is the code im using.
here is a picture of my theory if it makes more sense that way.