Keep Ndef filters sound after stopping

Hi,

I have an Ndef with a Pbind as source and some filters applied to it like this:

Ndef(\a, Pbindef(...));
Ndef(\a)[1] = \filter -> {|in| GVerb.ar(in)};

I’d like to stop the source but keep the filter’s sound until it fades away. If I do Ndef(\a).stop; the reverb gets cut. What is the best approach to achieving this?

Cheers!

I would just remove the source (in slot 0) that’s making the sound (thus leaving the filter object, at slot 1, still running).

Ndef(\a)[0] = nil;

If you have a fadeTime set for your Ndef, it will be used (so the source would fade out over fadeTime).

Note this obviously won’t automatically remove your Ndef when the sound “fades away”, or stop the filter from running. It would be up to you to do Ndef(\a).clear if you wanted that. Also, note that calling Ndef(\a).stop will just stop monitoring the sound of this proxy, it won’t stop its audio processing from running (for that, do clear).

It can be helpful to check which object slots you have defined for an Ndef. After setting the source in slot 0 to nil (above), you then have:

Ndef(\a).objects.indices
// -> [ 1 ]

I hope that’s helpful!

1 Like

Thanks!

I had done something like that, but was wondering if there was a more convenient way to do it. Glad to hear I was on the right track. : )