I’m using a granular patch with an Ndef (most of the code is from Reflectives videos) and playing with controlling the parameters with external LFOs via extra Ndefs. So far, so good. But when I try to change the buffer with Ndef(\gran_fx).set(\buf, ~git[3])
, it gets me into trouble - I get the following error message, and after that, nothing seems to work. Maybe someone could explain what’s going on? Code is below the error message.
ERROR: Message 'rate' not understood.
Perhaps you misspelled 'rank', or meant to call 'rate' on another receiver?
RECEIVER:
Instance of Buffer { (0x6c20d18, gc=FC, fmt=00, flg=00, set=03)
instance variables [8]
server : instance of Server (0x1b15b48, size=30, set=5)
bufnum : Integer 3
numFrames : Integer 21520356
numChannels : Integer 1
sampleRate : Float 44100.000000 00000000 40E58880
path : "/home/jordan/Documents/music-work/LBD/aug_21..."
startFrame : Integer 0
doOnInfo : nil
}
ARGS:
PATH: /home/jordan/Documents/music-work/LBD/aug_21/gran_fx.scd
PROTECTED CALL STACK:
Meta_MethodError:new 0x2753780
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)
Meta_DoesNotUnderstandError:new 0x2755ac0
arg this = DoesNotUnderstandError
arg receiver = Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)
arg selector = rate
arg args = [ ]
Object:doesNotUnderstand 0x21bd7c0
arg this = Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)
arg selector = rate
arg args = nil
a FunctionDef 0x3660680
sourceCode = "<an open Function>"
arg key = buf
arg value = Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)
var rate = nil
Dictionary:keysValuesArrayDo 0x364a880
arg this = ProxyNodeMap[ (amp -> 1), (rate -> 0.79700189828873), (i_out -> 4), (out -> 4), (posRateMF -> c0),
(posRateMD -> c1), (buf -> Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)), (tFreqMF -> c2), (tFreqMD -> c3), (fadeTime -> 0.02),
(posRate -> c4) ]
arg argArray = [ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, amp, 1, nil, nil, rate, 0.79700189828873, nil, nil, nil, nil, nil, nil, nil, nil, i_out, 4, nil, nil, nil, nil, out, 4, posRateMF, c0, posRateMD, c1, buf, Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav), tFreqMF, c2, tFreqMD, c3, fadeTime, 0.02, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, posRate, c4, nil, nil, nil, nil ]
arg function = a Function
var i = 38
var j = 7
var key = nil
var val = nil
var arraySize = nil
Dictionary:keysValuesDo 0x363d640
arg this = ProxyNodeMap[ (amp -> 1), (rate -> 0.79700189828873), (i_out -> 4), (out -> 4), (posRateMF -> c0),
(posRateMD -> c1), (buf -> Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)), (tFreqMF -> c2), (tFreqMD -> c3), (fadeTime -> 0.02),
(posRate -> c4) ]
arg function = a Function
ProxyNodeMap:controlNames 0x3660200
arg this = ProxyNodeMap[ (amp -> 1), (rate -> 0.79700189828873), (i_out -> 4), (out -> 4), (posRateMF -> c0),
(posRateMD -> c1), (buf -> Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)), (tFreqMF -> c2), (tFreqMD -> c3), (fadeTime -> 0.02),
(posRate -> c4) ]
var res = [ ControlName P nil amp control 1, ControlName P nil rate control 0.79700189828873, ControlName P nil i_out control 4, ControlName P nil out control 4, ControlName P nil posRateMF control c0, ControlName P nil posRateMD control c1 ]
NodeProxy:addNodeMapControlNames 0x2a545c0
arg this = Ndef('gran_fx')
arg objCtlNames = [ ControlName P 0 buf control 0, ControlName P 1 tFreq control 20, ControlName P 2 posRate control 1, ControlName P 3 rate control 1, ControlName P 4 tFreqMF control 0, ControlName P 5 tFreqMD control 0, ControlName P 6 posRateMF control 0, ControlName P 7 posRateMD control 0, ControlName P 8 rateMF control 0, ControlName P 9 rateMD control 0, ControlName P 10 startPos control 0, ControlName P 11 overlap control 2, ControlName P 12 amp control 1 ]
arg except = [ out, i_out, gate, fadeTime ]
a FunctionDef 0x3b65740
sourceCode = "<an open Function>"
a FunctionDef 0x36657c0
sourceCode = "<an open Function>"
Function:prTry 0x29e9680
arg this = a Function
var result = nil
var thread = a Routine
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>
Thread:handleError
arg this = <instance of Routine>
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>
Environment:use
arg this = <instance of Event>
arg function = <instance of Function>
var result = nil
var saveEnvir = <instance of Environment>
Event:play
arg this = <instance of Event>
Event:playAndDelta
arg this = <instance of Event>
arg cleanup = <instance of EventStreamCleanup>
arg mute = false
EventStreamPlayer:prNext
arg this = <instance of EventStreamPlayer>
arg inTime = 289.494147082
var nextTime = nil
var outEvent = <instance of Event>
< FunctionDef in Method EventStreamPlayer:init >
arg inTime = 289.494147082
Routine:prStart
arg this = <instance of Routine>
arg inval = 279.494147082
^^ ERROR: Message 'rate' not understood.
Perhaps you misspelled 'rank', or meant to call 'rate' on another receiver?
RECEIVER: Buffer(3, 21520356, 1, 44100.0, /home/jordan/Documents/music-work/LBD/aug_21/samples/git_recordings-004.wav)
s.boot;
(
~git = Array.new;
~folder = PathName.new("/home/jordan/Documents/music-work/LBD/aug_21/samples");
~folder.entries.do {
|path|
~git = ~git.add(Buffer.read(s, path.fullPath) );
};
)
(
Ndef(\gran_fx, {
|buf = 0, tFreq = 20, posRate = 1, rate = 1|
var phasor, t, sig;
var bufFrames = BufFrames.kr(buf);
var tFreqMod = { SinOsc.ar(\tFreqMF.kr(0), Rand(0.0, 2pi)) * \tFreqMD.kr(0) };
var rateMod = { SinOsc.ar(\rateMF.kr(0), Rand(0.0, 2pi)) * \rateMD.kr(0) };
var posRateMod = { SinOsc.ar(\posRateMF.kr(0), Rand(0.0, 2pi)) * \posRateMD.kr(0) };
tFreq = tFreq + tFreqMod.dup;
posRate = posRate + posRateMod.dup;
rate = rate + rateMod.dup;
t = Impulse.ar(tFreq.lag(0.05));
phasor = Phasor.ar(
trig: 0.0,
rate: posRate * BufRateScale.kr(buf),
start: \startPos.kr(0),
end: bufFrames,
resetPos: \startPos.kr(0) * bufFrames
);
sig = GrainBuf.ar(
numChannels: 1,
trigger: t,
dur: tFreq.reciprocal * \overlap.kr(2),
sndbuf: buf,
rate: rate,
pos: phasor / bufFrames,
interp: 2,
pan: 0,
envbufnum: -1,
maxGrains: 512
);
sig = sig * \amp.kr(1);
// Out.ar(\out.kr(0), sig);
});
)
Ndef(\gran_fx).fadeTime = 2;
Ndef(\gran_fx).play;
Ndef(\gran_fx).set(\buf, ~git[1])
Ndef(\gran_fx)[1] = \xset -> Pbind(\buf, ~git[3], \dur, Pwhite(10, 60), \posRateMF, Pwhite(0.1, 10), \posRateMD, Pwhite(1, 10), \amp, 1, \rate, Pwhite(0.5, 2));
// with LFOs
Ndef(\gran_fx)[1] = \xset -> Pbind(\dur, 10, \posRate, Ndef(\lfo4).asMap, \posRateMF, Ndef(\lfo0).asMap, \posRateMD, Ndef(\lfo1).asMap, \amp, 1, \tFreqMF, Ndef(\lfo2).asMap, \tFreqMD, Ndef(\lfo3).asMap);
(
// posRateMF + MD
Ndef(\lfo0, { SinOsc.kr(0.011).linlin(-1, 1, 0.1, 10) });
Ndef(\lfo1, { SinOsc.kr(0.01).linlin(-1, 1, 1, 10) });
// tFreqMF + MD
Ndef(\lfo2, { SinOsc.kr(0.02).linlin(-1, 1, 0.001, 1) });
Ndef(\lfo3, { SinOsc.kr(0.021).linlin(-1, 1, 0.001, 1) });
Ndef(\gran_fx).xset(\tFreqMF, 0.01, \tFreqMD, 0.01);
// pos rate
Ndef(\lfo4, { SinOsc.kr(0.001).linlin(-1, 1, 1, 5) });
)
Thanks,
Jordan