Author |
Message |
Dr. Spankenstein
Joined: Mar 03, 2007 Posts: 136 Location: Cambridge
Audio files: 1
|
Posted: Tue Apr 03, 2007 12:05 pm Post subject:
How do I bypass a filter? |
 |
|
How do I bypass a filter? For example...
Code: |
SndBuf buf => BPF filter => dac;
|
I have the sound filtered, but how could I turn off or change the filter for a different type of filter at any point during the code?
Thanks
Rhys |
|
Back to top
|
|
 |
moudi
Joined: Oct 07, 2006 Posts: 63 Location: Bern Switzerland
|
Posted: Tue Apr 03, 2007 12:59 pm Post subject:
|
 |
|
hi
every unitgenerator has some basic functionality.
(inherited by the basic ugen class).
the parameter .op(int) controls the behaviour of the ugen:
op(int) (of type int): set/get operation at the UGen. Values:
0 : stop - always output 0
1 : normal operation, add all inputs (default)
2 : normal operation, subtract inputs starting from the earliest connected
3 : normal operation, multiply all inputs
4 : normal operation, divide inputs starting from the earlist connected
-1 : passthru - all inputs to the ugen are summed and passed directly to output
i copy/pasted this directly from the chuck homepage here:
http://chuck.cs.princeton.edu/doc/language/ugen.html
jassas
/moudi |
|
Back to top
|
|
 |
Dr. Spankenstein
Joined: Mar 03, 2007 Posts: 136 Location: Cambridge
Audio files: 1
|
Posted: Tue Apr 03, 2007 1:28 pm Post subject:
|
 |
|
Thanks very much!
....dammit  |
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Apr 04, 2007 3:16 am Post subject:
|
 |
|
Don't feel too hard, the documentation is scattered a little so things can be hard to find.
As for changing the filter (as opposed to bypassing it), you could set it up like this;
SndBuf buf => BPF filter => dac;
LPF filter2 => dac;
then, any time you'd like to switch you can disconect the buf from the BPF filter by "unchucking" it from there, then connecting it to the LPF.
from memory; the unchuck operator is like this;
SndBuf buf =< BPF filter;
But that one doesn't seem to be on that page. _________________ Kassen |
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Wed Apr 04, 2007 12:50 pm Post subject:
|
 |
|
Another different idea i have in mind now:
For a smoother switching..
i think an Enveloping would be able to smooth things up.
Code: | // when activated, the fenv route will have gain = 1
// but when bypassed, it'll fade the filtered line down and dry signal up
SndBuf buf => BPF filter => Envelope fenv => dac;
buf => Envelope bypassenv => dac;
// set the fade time
10::ms => fenv.duration => bypassenv.duration;
// codes... etc.
// activate the filter route
fenv.keyOn(); bypassenv.keyOff();
// bypassing
fenv.keyOff(); bypassenv.keyOn(); |
i hope this implementation can prevent crackle when bypassing
by quite a simple method & some flexibility
(e.g. fade time can be set,
envelope can ramp to any value for a mixing of wet & dry signal,
many more filters can be inserted and mixed with more Envelopes) |
|
Back to top
|
|
 |
|