Hello everybody.
I’m tinkering again with Ndefs and it is still difficult.
I want to use a SynthDef as a \filter for the the Ndef. Is this possible?
I documented this very well in the following code, i hope it becomes clear what i want. I am also using a SynthDef as the initial Ndef, now i just want another SynthDef for the effect chaining. This can be theoretically done with \filter → {…}, but I dont know how to apply this for my problem.
Here is the Example Code:
//making a SynthDef
(
//simple Synth
SynthDef(\sins, {
|freq=440, out = 0, amp=1|
Out.ar(out,amp*SinOsc.ar(freq!2)*((Saw.kr(1).range(0,1))**10))
}).add;
//simple Reverb
SynthDef(\rev, {
|amp=0.2, in=0 ,out=0|
var sig;
//instead of the In.ar, the in argument of the filter
//could also be used? somehow? i dont know...
sig = In.ar(in,2);
sig = FreeVerb.ar(sig,0.6);
Out.ar(out,sig)
}).add;
)
//This is on one way of making it work with synths
a=Synth(\rev,[\in: 10]);
b=Synth(\sins,[\out: 10]);
a.free;b.free;
//now i want this with ndefs
Ndef(\sinn).add(\sins);
Ndef(\sinn).play;
//the next commented line is one way of making it work
//Ndef(\sinn).put(100,\filter -> {arg in; FreeVerb.ar(in,0.6)})
//however I want to make it work with the \rev SynthDef
//it doesn't work yet, but i hope the point gets accross...
Ndef(\sinn).put(100,\filter -> /*something \rev SynthDef*/)
//clear the Ndef
Ndef(\sinn).clear
Thank you very much