I am trying to figure out how arguments work still. This is not the full code, just the aspect I’m trying to understand.
Here, you have the function lfo1 with 4 arguments: rate, low, high, and round.
in the “note” variable, for the “in” argument of DegreeToKey, you pass the lfo1 function, and you fill the arguments to lfo1 with:
rate: tempo2
low: 0
high: degreeNumoctRange
round: lfo1.(2,1,7,1) // This is what I’m asking about
I don’t understand what is happening second. First, you have the values being given to lfo1:
lfo1.(tempo*2,0,degreeNum*octRange,lfo1.(2,1,7,1))
And I can understand that, but I can’t seem to wrap my head around what’s happening in the “round” argument. It’s passed the whole of lfo1 again, and given a new set of values for the arguments. So which ones are used? How does the “round” argument take the whole lfo1 function?
var lfo1 = {arg rate,low,high,round; LFNoise0.ar(rate).range(low,high).round(round)};
var scale = Scale.melodicMinor;
var degreeNum = scale.size;
var note = DegreeToKey.ar(scale.as(LocalBuf),
in: lfo1.(tempo*2,0,degreeNum*octRange,lfo1.(2,1,7,1)), // arguments passed to lfo1 twice
octave:scale.stepsPerOctave,
mul: 1,
add: octOffset).midicps;