hi list

I would like to simplify a block of code. At the moment evaluating it sends my CPU up to 40-50%. What I am trying to achieve is to have a set of Ndefs with selectable oscillators for modulation. The code example uses wavefold extension from Daniel Meyer’s MiSCellaneous.

```
(
~modulators = 3.collect{|k|
4.collect{|i|
Ndef(("mod_"++k++i).asSymbol, {
arg modSel = 0, modFrequency = 1, modIndex = 1, wfLo = 0, wfHi = 0;
var mod = Select.ar(modSel,
[
SmoothFoldS2.ar(
in: modIndex * SinOsc.ar(modFrequency, mul: 1),
lo: -1,
hi: 1,
foldRangeLo: wfLo,
foldRangeHi: wfHi
),
SmoothFoldS2.ar(
in: modIndex * LFSaw.ar(modFrequency, mul: 1),
lo: -1,
hi: 1,
foldRangeLo: wfLo,
foldRangeHi: wfHi
),
SmoothFoldS2.ar(
in: modIndex * LatoocarfianC.ar(
freq: modFrequency,
a: LFNoise2.kr(2,1.5,1.5),
b: LFNoise2.kr(2,1.5,1.5),
c: LFNoise2.kr(2,0.5,1.5),
d: LFNoise2.kr(2,0.5,1.5),
mul: 1, add: 0),
lo: -1,
hi: 1,
foldRangeLo: wfLo,
foldRangeHi: wfHi
),
SmoothFoldS2.ar(
in: modIndex * HenonC.ar(
freq: modFrequency,
a: LFNoise2.kr(1, 0.2, 1.2),
b: LFNoise2.kr(1, 0.15, 0.15),
mul: 1, add: 0),
lo: -1,
hi: 1,
foldRangeLo: wfLo,
foldRangeHi: wfHi
),
SmoothFoldS2.ar(
in: modIndex * Gendy3.ar(
ampdist: 6,
durdist: 3,
adparam: 0.9,
ddparam: 0.9,
freq: modFrequency,
ampscale: 1),
lo: -1,
hi: 1,
foldRangeLo: wfLo,
foldRangeHi: wfHi
)
]);
mod
})
}}
)
```

perhaps there is a way to define Ndef without activating it?

thanks for your help