[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Newb question - creating subclass for audio signals
Thanks for the responses so far. James, I'm not seeing why using a dictionary
is better than just declaring ~filter1, ~filter2, etc.? Except for namespace
clutter. But really, my main goal is to be able to write simply:
signal.doTheFiltering()
Maybe not worth it/impossible to get that, but at least I'll learn from
trying (as I already have from this example). I thought about subclassing
the "In" Ugen, and sending all audio in from another synth? That's not too
intuitive though and probably won't work...?
James Harkins-2 wrote:
>
> ~filters = (
> // see the Environment helpfile under "prototypes" for more about
> 'self'
> filter1: { |self, input ... args|
> LPF.ar(input, *args)
> },
> filter2: { |self, input ... args|
> HPF.ar(input, *args)
> },
> ...
> );
>
> SynthDef( "Filtering", {
> var signal1, signal2;
>
> signal1 = PlayBuf.ar( 2, bufNum );
> signal2 = PinkNoise.ar(1.0);
>
> signal1 = ~filters.filter1(signal1);
> signal2 = ~filters.filter2(signal2);
> } );
>
> hjh
>
--
View this message in context: http://www.nabble.com/Newb-question---creating-subclass-for-audio-signals-tp21225372p21227440.html
Sent from the Supercollider - User mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/