electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Faux Pas Quartet and friends Music From Last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software » ChucK programming language
How do I bypass a filter?
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Tue Apr 03, 2007 12:05 pm    Post subject: How do I bypass a filter? Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
moudi



Joined: Oct 07, 2006
Posts: 63
Location: Bern Switzerland

PostPosted: Tue Apr 03, 2007 12:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
Dr. Spankenstein



Joined: Mar 03, 2007
Posts: 136
Location: Cambridge
Audio files: 1

PostPosted: Tue Apr 03, 2007 1:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks very much!

Quote:


i copy/pasted this directly from the chuck homepage here:
http://chuck.cs.princeton.edu/doc/language/ugen.html



....dammit Embarassed
Back to top
View user's profile Send private message
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Apr 04, 2007 3:16 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Apr 04, 2007 12:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
AmbiphonicDSP

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use