I kinda fell off with SC recently, and am forcing myself to get back into it. I was just getting too frustrated not knowing what the hell is going on because I suck at programming. But here I am! Back for more punishment. As such, I’m a little rusty. SC is definitely NOT like “riding a bike” for me.
I’m getting a Message “def” not found error when playing this:
(
SynthDef(\demand1, {
arg out=0, gate=1, freq=400;
var x, y, env, sig;
env = EnvGen.ar(Env.adsr(), gate, doneAction:2);
x=Dseq((5..20)*50,inf);
y={ |a|
SinOsc.ar(Demand.kr(Impulse.kr(a),0,x))
};
sig = SinOsc.ar([freq, freq+1]) * y.(1) * y.(3);
Out.ar(out, sig * env);
}.play;
)
)
The code works and plays, but I can’t decipher this error.
ERROR: Message 'def' not understood.
RECEIVER:
Instance of Synth { (000001E5DE3303F8, gc=B0, fmt=00, flg=00, set=03)
instance variables [6]
nodeID : Integer 1216
server : instance of Server (000001E5D741FBE8, size=30, set=5)
group : instance of Group (000001E5E1B59078, size=5, set=3)
isPlaying : false
isRunning : false
defName : Symbol 'temp__5'
}
ARGS:
PATH: C:/SCandTidal/realsad.scd
PROTECTED CALL STACK:
Meta_MethodError:new 000001E5DE0F8340
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = Synth('temp__5' : 1216)
Meta_DoesNotUnderstandError:new 000001E5DE0FA300
arg this = DoesNotUnderstandError
arg receiver = Synth('temp__5' : 1216)
arg selector = def
arg args = [ ]
Object:doesNotUnderstand 000001E5E0E42300
arg this = Synth('temp__5' : 1216)
arg selector = def
arg args = nil
SynthDef:addControlsFromArgsOfFunc 000001E5D70CF9C0
arg this = SynthDef:demand1
arg func = Synth('temp__5' : 1216)
arg rates = nil
arg skipArgs = 0
var def = nil
var names = nil
var values = nil
var argNames = nil
var specs = nil
SynthDef:buildUgenGraph 000001E5D70CF440
arg this = SynthDef:demand1
arg func = Synth('temp__5' : 1216)
arg rates = nil
arg prependArgs = [ ]
var result = nil
var saveControlNames = nil
a FunctionDef 000001E5D70CDA80
sourceCode = "<an open Function>"
Function:prTry 000001E5D6ABE580
arg this = a Function
var result = nil
var thread = a Thread
var next = nil
var wasInProtectedFunc = false
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Function:protect
arg this = <instance of Function>
arg handler = <instance of Function>
var result = <instance of DoesNotUnderstandError>
SynthDef:build
arg this = <instance of SynthDef>
arg ugenGraphFunc = <instance of Synth>
arg rates = nil
arg prependArgs = nil
Interpreter:interpretPrintCmdLine
arg this = <instance of Interpreter>
var res = nil
var func = <instance of Function>
var code = "(
SynthDef(\demand1, {
arg ..."
var doc = nil
var ideClass = <instance of Meta_ScIDE>
Process:interpretPrintCmdLine
arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Message 'def' not understood.
RECEIVER: Synth('temp__5' : 1216)
Any help much appreciated! Thank you thank you.