electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » ChucK programming language
Connecting a long list of filters together, works until.....
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [6 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: Thu Jun 14, 2007 2:11 pm    Post subject: Connecting a long list of filters together, works until..... Reply with quote  Mark this post and the followings unread

I'm currently playing around with the various filters in ChucK as most of you would have probably guessed by now. So far I have a fair few all linked up that can be turned on or off with various commands and everyone works well except for the when I add a comb filter.

The comb filter just makes a horrible screeching sound and I have a feeling that I am connecting it wrong but have tried various methods and to no success.

Here's what Ive got...

Code:

SndBuf Buffer;
"Beat1[4,165].wav" => Buffer.read;
NRev Reverb => BPF BandPassFilter => BRF BandRejectFilter => HPF HighPassFilter => LPF LowPassFilter => Gain Gain => Pan2 Pan => dac;

// Above works fine but I add the following filter and bam!  ...horrible sound

DelayA CombFilter => Gain CombFilterFeedback => CombFilter;
CombFilter => Reverb;

Buffer => CombFilter;

0.2 => CombFilterFeedback.gain;
-1 => Reverb.op;
-1 => BandPassFilter.op;
-1 => BandRejectFilter.op;
-1 => CombFilter.op;
-1 => CombFilterFeedback.op;
-1 => HighPassFilter.op;
-1 => LowPassFilter.op;

10::second => now;


The horrible sound continues even if all the filters are set to -1 Op status.

I just know I'm doing something stupid but I cant see where I'm going wrong here? ...Please help!

Thanks

Rhys
Back to top
View user's profile Send private message
kijjaz



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

PostPosted: Thu Jun 14, 2007 2:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

I did test your code..
by feeding something into Reverb
.. this patch did crashes my miniAudicle many times on Linux ..
but anyway that's not the case.

I've fed an Impulse into it..
also a White noise..
and they work ok.
Is that horrible sound a kind of clipping or distortion added to your original loop?
or it remains constant after the sound has gone out?
.delay
and how do you set the .max and .delay time of the comb filter?
Or you haven't initialized the delay yet?

i'm figuring out more.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



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

PostPosted: Thu Jun 14, 2007 3:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Code:
Noise i => NRev Reverb => BPF BandPassFilter => BRF BandRejectFilter => HPF HighPassFilter => LPF LowPassFilter => Gain Gain => Pan2 Pan => dac;
dac => WvOut w => blackhole;
// Above works fine but I add the following filter and bam!  ...horrible sound

DelayA CombFilter => Gain CombFilterFeedback => CombFilter;
CombFilter => Reverb;

1.0 => CombFilterFeedback.gain;
-1 => Reverb.op;
-1 => BandPassFilter.op;
-1 => BandRejectFilter.op;
-1 => CombFilter.op;
-1 => CombFilterFeedback.op;
-1 => HighPassFilter.op;
-1 => LowPassFilter.op;

w.wavFilename("test.wav");
0.1 => i.gain;
2::second => now;
w.closeFile("");


This is how i max some adjustments to observe it.
even Comb Filter Feedback = 1 still didn't make it blow up right away..
-_-"

Oh hey that wasn't the way you connected them -_- sorry.
this must be it.

Code:
NRev Reverb => BPF BandPassFilter => BRF BandRejectFilter => HPF HighPassFilter => LPF LowPassFilter => Gain Gain => Pan2 Pan => dac;
dac => WvOut w => blackhole;
// Above works fine but I add the following filter and bam!  ...horrible sound

DelayA CombFilter => Gain CombFilterFeedback => CombFilter;
Noise i => CombFilter => Reverb;

// second => CombFilter.max;
// 10::ms => CombFilter.delay;

.1 => CombFilterFeedback.gain;
-1 => Reverb.op;
-1 => BandPassFilter.op;
-1 => BandRejectFilter.op;
-1 => CombFilter.op;
-1 => CombFilterFeedback.op;
-1 => HighPassFilter.op;
-1 => LowPassFilter.op;

w.wavFilename("test.wav");
0.1 => i.gain;
2::second => now;
w.closeFile("");


This is it! This does Blow Up!
hahah (that's a nice blow-up sound)

i'll check this routine:
Code:
DelayA f1 => Gain f1feedback => f1 => dac;

-1 => f1.op;
-1 => f1feedback.op;

2::second => now;


ok.. peaceful, expectable.
so let's add an impulse and see the result:

Code:
DelayA f1 => Gain f1feedback => f1 => dac;
Impulse i => f1;

// for recording to WAV
dac => WvOut w => blackhole;

-1 => f1.op;
-1 => f1feedback.op;

0.5 => i.next;

// start recording
w.wavFilename("test.wav");
2::second => now;
w.closeFile("");


Arrrgh.. this patch killed miniAudicle
let me run it again: Take Two..

Result wave in Audacity:
Posted Image, might have been reduced in size. Click Image to view fullscreen.
[/code]

Hmmm! this is just a start of us seeing a problem:
An impulse should jump to the value we set with .next only at the sample we set it.
It shouldn't has this kind of value sustain..

let me test more by adding another impulse:

Code:
DelayA f1 => Gain f1feedback => f1 => dac;
Impulse i => f1;

// for recording to WAV
dac => WvOut w => blackhole;

-1 => f1.op;
-1 => f1feedback.op;

0.5 => i.next;

// start recording
w.wavFilename("test.wav");
1::second => now;
-0.25 => i.next;
1::second => now;
w.closeFile("");


Posted Image, might have been reduced in size. Click Image to view fullscreen.

Ahhh so the result -0.25 is added to the accumulated value ...
so what we're experiencing is that this system did accumulate each input samples..

I'll figure out more. -_-
we should have Ge inspect into this issue.
i'll try with some different UGens later. take care.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
kijjaz



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

PostPosted: Thu Jun 14, 2007 3:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Oh YES!!

After i turned off the computer and go to pee in the bathroom..
I figured it out and has to turn the comp con again -_-"

It was the feedback loop that did this!

Actually now there's a feedback loop
that just "Bypass" the signal..

So it's gonna work like this:
Code:

Gain g => g;
1.0 => g.gain;


I guess it works like this:
Anything we feed into g
will be sent to the "next" value of g.
I mean.. in the next sample,
g will be set to its current value.

So this feedback loop would simply work just like an accumulater.
the output'll be the sum of all previous input value for every sample passed.
- - -

it'd be a problem for you now,
but when you stop bypassing it, it should work out fine.
(now it works just like a comb filter..!
with Delay Time = 1 sample and Feedback gain = 1 hahhaah)
- - -

Thanks for giving me this idea!
I'm finding a way to implement an easy accumulator.
and this is it! lol. Cool
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Dr. Spankenstein



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

PostPosted: Fri Jun 15, 2007 2:23 am    Post subject: Reply with quote  Mark this post and the followings unread

Got it!

So if when I dont want to use the comb filter I can set each part of the combfilter setup to -1 Op except for the feedback gain which can still be at 1 Op but the feedback gain can then be set to 0.0 until needed!

Thanks very much.

Rhys
Back to top
View user's profile Send private message
kijjaz



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

PostPosted: Fri Jun 15, 2007 3:39 am    Post subject: Reply with quote  Mark this post and the followings unread

Hmmm i also suggest another way:
split "dry" and "wet" into two channels.

So we'll have
SndBuf yoursample => Gain Dry => (series of effects needed) => dac;

plus

SndBuf yoursample => Delay combfilter => Gain combfilterfeedback => combfilter => Gain Wet => (the first effect in the above series) ..

So .. with this .. You'll also be able to control if you'd like to turn on - off or even fade the comb filter signal
(oh! in case you want to fade, an Envelope or ADSR instead of Gain would perform better)

and also still be able to set the gain of the original dry channel.
with that you can set the ratio of Dry:Wet also.
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 [6 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


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