Hello, I really am a beginner and have just botched my way through SC for years now. I set up a really basic midi synth and get the following error:
ERROR: Message ‘at’ not understood.
Perhaps you misspelled ‘as’, or meant to call ‘at’ on another receiver?
RECEIVER:
Symbol ‘robBasic’
ARGS:
Symbol ‘freq’
Float 82.406889 791E127C 40549A0A
Symbol ‘amp’
Float 0.163800 FD8ADABA 3FC4F765
KEYWORD ARGUMENTS:
CALL STACK:
DoesNotUnderstandError:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Object:doesNotUnderstand
arg this = ‘robBasic’
arg selector = ‘at’
arg args = [*4]
arg kwargs = [*0]
< FunctionDef in closed FunctionDef >
arg veloc = 52
arg num = 40
arg chan = 0
arg src = -898120851
MIDIMessageDispatcher:value
arg this =
arg src = -898120851
arg chan = 0
arg num = 40
arg val = 52
Meta_MIDIIn:doNoteOnAction
arg this =
arg src = -898120851
arg chan = 0
arg num = 40
arg veloc = 52
^^ ERROR: Message ‘at’ not understood.
Perhaps you misspelled ‘as’, or meant to call ‘at’ on another receiver?
RECEIVER: robBasic
The code I am using is this:
(
var notes, on, off;
MIDIClient.init;
MIDIIn.connectAll;
notes = Array.newClear(128); // array has one slot per possible MIDI note
on = MIDIFunc.noteOn({ |veloc, num, chan, src|
notes[num] = Synth(\robBasic [\freq, num.midicps,
\amp, veloc * 0.00315]);
});
off = MIDIFunc.noteOff({ |veloc, num, chan, src|
notes[num].release;
});
q = { on.free; off.free; };
)
(
SynthDef(\robBasic,{|out= 0 freq = 440 amp = 0.1 gate=1 lforate = 4.85 lfowidth= 0.5 cutoff= 2000 rq=0.5 pan = 0.0|
var pulse, filter, env;
pulse = SinOsc.ar(freq)+ LFTri.ar(freq,0.5,0.5,0.05);
pulse = pulse*(Dust.ar(100,1,0.5)*LFPar.ar(freq,0,0.5));
env = EnvGen.ar(Env.adsr(0.9,1.0,0.8,3.0),gate,doneAction:2);
//keyboard tracking filter cutoff
filter = BLowPass4.ar(pulse,(cutoff*(env.squared))+200+freq,rq);
Out.ar(out,Pan2.ar(Mix(filter)*env*amp,pan));
}).add;
)
Can anyone explain what the error means, and what the solution is; I just cannot work it out.