Hi I'm just a simple guy, and I haven't got a clue what's up with the filters available in chuck. Poles and zeros and stuff... I'd appreciate if someone could: 1) Give an example of how to set up (something that in my simple brain is called) a low pass filter with/without resonance and a highpass filter with/without resonace. 2) Could direct me towards mind-expanding online information that might allow me to actually understand a fraction of what's going on? And while we're at it: I see no examples using either sawosc or sqrosc. I know how to use those though (just need some filters), but, still at the risk of seeming extremely conservative, wouldn't a classic, analog synth style patch (saw > low pass filter > envelope) or two be a nice and possible addition? Maybe someone even has such a simple example (involving filtering) that I could take a look at or we could throw on the wiki? -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Hi, There are a few examples of filtering that come with ChucK. The best ones are wind.ck and wind2.ck, as well as powerup.ck. To understand what is going on you will have to look at STK and/or Perry Cook's book Real Sound Synthesis. The general filter object is just a placeholder from my understanding. You can check out OnePole and TwoPole to do simple filtering. As for using other oscillators, in the manual there is a tutorial on extending basic patches that (I think) covers this topic. This is one of those really attractive features about ChucK. Since the api for each Subclass of UGen or object is fairly similar (if not exact) you can usually just change the type declaration and everything will work! sinosc s => dac; .... becomes sqrosc s => dac; ..... and most things will just work. I hope this helps. a On 30-Jun-06, at 1:48 PM, Atte André Jensen wrote:
Hi
I'm just a simple guy, and I haven't got a clue what's up with the filters available in chuck. Poles and zeros and stuff...
I'd appreciate if someone could:
1) Give an example of how to set up (something that in my simple brain is called) a low pass filter with/without resonance and a highpass filter with/without resonace.
2) Could direct me towards mind-expanding online information that might allow me to actually understand a fraction of what's going on?
And while we're at it: I see no examples using either sawosc or sqrosc. I know how to use those though (just need some filters), but, still at the risk of seeming extremely conservative, wouldn't a classic, analog synth style patch (saw > low pass filter > envelope) or two be a nice and possible addition? Maybe someone even has such a simple example (involving filtering) that I could take a look at or we could throw on the wiki?
-- peace, love & harmony Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/ compositions _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Adam Tindale wrote:
There are a few examples of filtering that come with ChucK. The best ones are wind.ck and wind2.ck, as well as powerup.ck.
I did have a look, and found that something like this gives a decent resonant low-pass filter: triosc tri => ADSR env => TwoPole filter => dac; sqrosc sqr => env; 1 => filter.norm; 1500 => filter.freq; .97=> filter.radius; Seems that the radius is "filter strength", setting it to 0 and the filter just passes the signal through. However I still need to be able to get rid of the resonance. And a high-pass version would be nice too. Could someone explain that the coefficients mean? (or link to some material that explains it)...
To understand what is going on you will have to look at STK and/or Perry Cook's book Real Sound Synthesis.
Yeah, that looks like a nice book, might pick it up. I imagine a lot of future users being just as ignorant as me about filer coefficients and the like. So may I propose that a couple of simple to use analog style filters is added to chuck + a bit of explanation about using the current filters + links (if possible) to background material.
As for using other oscillators, in the manual there is a tutorial on extending basic patches that (I think) covers this topic.
Well as I said I know how to use those. The two pages (24 + 25) of "Modifying Basic Patches" is not really that deep. Maybe I wasn't being clear, but I was more hoping for a few classic subtractive examples. You know like a pad, a moog style bass and a brass sound. With such a few examples I imagine most users familiar with subtractive synthesis would be able to more or less take it from there...
I hope this helps.
A bit... -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Could someone explain that the coefficients mean? (or link to some material that explains it)...
Well...... A digital filter is one big mathematical function, right? The coeficients are the numbers in the equation. Everything the filter does follows from those, the cutoff and the resonance follow from them but also wether or not the filter is stable (which kinda means "wether or not it works at all"). As I understand the theory what you have is very short delays and amplification factors and the coeficients are simply numbers like how much to amplify by at various stages before summing. The problem is that fimding what numbers represent the exact filter you need is quite hard and not so much fun to go do manually. If you want to go there I sugest a serious book on DSP. Beware that this stuff gets very serious very quickly. I wanted to have a good look at how ChucK implements this and actually started reading on DSP but then I saw that there is a plan to clean up how these work in a future version. This made me wait for this cleaning, I'd sugest you do the same.
Yeah, that looks like a nice book, might pick it up. I imagine a lot of future users being just as ignorant as me about filer coefficients and the like. So may I propose that a couple of simple to use analog style filters is added to chuck + a bit of explanation about using the current filters + links (if possible) to background material.
Yeah, I'd like to have that book too. I realise this post isn't much help but at least it should be somewhat clear *why* it's not so helpfull. What would be nice would be something like "how to deal with filters in ChucK without going insane over 1000 page tomes that asume you want to design a mobile phone". Maybe if the filters do get cleaned up Perry might write something on them, I can't imagine he designs a IIR filter for every musical piece he does. Kas.
Hi all,
Maybe if the filters do get cleaned up Perry might write something on them, I can't imagine he designs a IIR filter for every musical piece he does.
I did write something. It's my book. I intentionally went with a publisher that would put the book out at the lowest cost possible, so people wouldn't be scared by the price. I wrote it in such a way as to not frighten people as well. It's sort of the "STK manual." It's been out long enough that you can usually find used copies for really cheap (no royalties for me :-) I actually do (sort of) design IIR filters for each piece. Happy July!! PRC
On 7/1/06, Perry R Cook
I did write something. It's my book. I intentionally went with a publisher that would put the book out at the lowest cost possible, so people wouldn't be scared by the price. I wrote it in such a way as to not frighten people as well. It's sort of the "STK manual." It's been out long enough that you can usually find used copies for really cheap (no royalties for me :-)
Sounds like what I need, I'll have it ordered this week (meaning some royalties). It was on my list of "books that might be nice" anyway but so far I hadn't yet realised how strong the link between the book and ChucK was.
Happy July!!
It is! I just wish it was a little cooler, neither me nor my laptop can get much done in this heat. Thanks, Kas.
Kassen wrote:
Sounds like what I need, I'll have it ordered this week (meaning some royalties).
I just ordered it, can't wait for it to arrive... -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Kassen wrote:
The problem is that fimding what numbers represent the exact filter you need is quite hard and not so much fun to go do manually.
Tell me about it :-)
I wanted to have a good look at how ChucK implements this and actually started reading on DSP but then I saw that there is a plan to clean up how these work in a future version. This made me wait for this cleaning, I'd sugest you do the same.
Very, very good suggestion!
What would be nice would be something like "how to deal with filters in ChucK without going insane over 1000 page tomes that asume you want to design a mobile phone".
Right! -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
On Jul 1, 2006, at 11:38 AM, Atte André Jensen wrote:
Adam Tindale wrote:
There are a few examples of filtering that come with ChucK. The best ones are wind.ck and wind2.ck, as well as powerup.ck.
I did have a look, and found that something like this gives a decent resonant low-pass filter:
triosc tri => ADSR env => TwoPole filter => dac; sqrosc sqr => env; 1 => filter.norm; 1500 => filter.freq; .97=> filter.radius;
Seems that the radius is "filter strength", setting it to 0 and the filter just passes the signal through. However I still need to be able to get rid of the resonance. And a high-pass version would be nice too.
Could someone explain that the coefficients mean? (or link to some material that explains it)...
Try having a look at http://ccrma.stanford.edu/~jos/filters/ Pole_Zero_Analysis_I.html As a quick summary, think of poles as if they were peaks, and zeros as valleys. This way you will attenuate frequencies where you put zeros, and enhance them if you place poles. If you (or anyone who's willing to try) were on Mac OS X you can try playing with a filter design software I am working on, http://student- kmt.hku.nl/~eduard/qPOZE/qPoze_a01_pkg.tgz. It is still on an experimental phase and haven't (extensively) test it on other machines than mine, yet.... so if you try it out, please let me know of any issues you may encounter. If installation succeeds, you can place any number of poles/zeros in the z-plane (unit circle) and move them arround with the mouse. This way you may understand how poles and zeros affect the amplitude/phase response. hope this helps, Eduard
On 1-Jul-06, at 5:00 AM, eduard aylon wrote:
Try having a look at http://ccrma.stanford.edu/~jos/filters/
I was going to suggest the same thing. If you aren't familiar with the basis of this material you can start with this one: http://ccrma.stanford.edu/~jos/mdft/ You can also look at this: http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt You can use these equations and dump the output into the biquad object. On 1-Jul-06, at 2:38 AM, Atte André Jensen wrote:
Well as I said I know how to use those. The two pages (24 + 25) of "Modifying Basic Patches" is not really that deep. Maybe I wasn't being clear, but I was more hoping for a few classic subtractive examples. You know like a pad, a moog style bass and a brass sound. With such a few examples I imagine most users familiar with subtractive synthesis would be able to more or less take it from there...
It isn't meant to be too deep. When writing this stuff I try to show the basics and let the programmer go. If I get time I will take a stab at something like this. If you get a cool patch send it along or you could write a tutorial and I could put it into the manual. Thanks to Perry for making your books cheap! --art
oK, here's a 10 sentence description of the BiQuad, which should cover TwoPole and TwoZero as well. Add to documentation if you like. A BiQuad (bi-quadratic) filter is a combination of a TwoPole and a TwoZero filter. Poles are resonances, and zeroes are anti-resonances. The coefficients of the TwoPole filter are defined as a1=-2*r*cos(2*pi*freq/srate) and a2=r*r, where r is the radius, between 0.0 and 1.0, and freq is the center frequency of the resonance. The r value controls the resonance of the filter, so r= 0.0 makes the filter disappear, and an r value of 1.0 makes the filter oscillate at the resonance frequency. Values greater than 1.0 make the filter unstable and the universe is eventually destroyed. The b coefficients of the TwoZero filter are set exactly the same way, but an r value of 1.0 creates a zero at the resonance frequency, meaning that no information at that frequency can get through the filter. It's OK to have r values greater than 1.0 in a TwoZero filter. The .eqzs (Equal Gain Zeroes) flag puts a zero at DC (0 frequency) and 1/2 sample rate, and serves to keep the gain of the filter somewhat automatically in check when moving the poles around. This simple example chuck code shows how the coefficients relate to the frequency and resonance parameters. Note that this filter doesn't do anything, because the zeroes exactly cancel out the poles (resonances); noise n => BiQuad f => dac; 0.9 => f.prad; 1000.0 => f.pfreq; 0.9 => f.zrad; 1000.0 => f.zfreq; <<< f.a0(), f.a1(), f.a2(), f.b0(), f.b1(), f.b2() >>>; // END Filter Code Example On Sat, 1 Jul 2006, Adam Tindale wrote:
On 1-Jul-06, at 5:00 AM, eduard aylon wrote:
Try having a look at http://ccrma.stanford.edu/~jos/filters/
I was going to suggest the same thing. If you aren't familiar with the basis of this material you can start with this one:
http://ccrma.stanford.edu/~jos/mdft/
You can also look at this:
http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
You can use these equations and dump the output into the biquad object.
On 1-Jul-06, at 2:38 AM, Atte André Jensen wrote:
Well as I said I know how to use those. The two pages (24 + 25) of "Modifying Basic Patches" is not really that deep. Maybe I wasn't being clear, but I was more hoping for a few classic subtractive examples. You know like a pad, a moog style bass and a brass sound. With such a few examples I imagine most users familiar with subtractive synthesis would be able to more or less take it from there...
It isn't meant to be too deep. When writing this stuff I try to show the basics and let the programmer go. If I get time I will take a stab at something like this. If you get a cool patch send it along or you could write a tutorial and I could put it into the manual.
Thanks to Perry for making your books cheap!
--art _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Perry R Cook wrote:
oK, here's a 10 sentence description of the BiQuad,
Thanks for the explanation. I got some of it. I spend quite a lot of time playing with the filters, and one of my experiments is attached. The first round sounds like a candidate for a non-resonant low pass filter. Am I right in deducting from this (quite brain dead) experiment(s) that in order to do such a filter sweep one has to adjust the radius while taming the volume? Or am I totally missing something here? -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Atte André Jensen wrote:
and one of my experiments is attached.
Well, now it is, sorry...
--
peace, love & harmony
Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk
http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
sawosc osc1 => BiQuad f => dac;
[
[.0009, .97, 200, .1957, 0],
[.003, .95, 400, .1957, 0],
[.01, .9, 800, .1957, 0],
[.04, .8, 1600, .1957, 0],
[.1, .7, 3200, .1957, 0],
[.3, .4, 6400, .1957, 0],
[.009, .9693, 200, .57, 825],
[.02, .95 , 400, .57, 825],
[.07, .9, 800, .57, 825],
[.2, .8, 1600, .57, 825],
[.4, .7, 3200, .57, 825],
[.8, .4, 6400, .57, 825],
[.1, .999, 100, .957, 200],
[.1, .999, 100, .957, 400],
[.08, .999, 100, .957, 800],
[.01, .999, 100, .957, 1600],
[.005, .999, 100, .997, 3200],
[.1, .999, 800, .957, 200],
[.1, .999, 800, .957, 400],
[.08, .999, 800, .957, 800],
[.01, .999, 800, .957, 1600],
[.005, .999, 800, .997, 3200]
] @=> float try[][];
for(0=>int i;i
Nope, if you use 1=> filt.eqzs, it keeps the gain pretty much tame at any frequency. No explanation as to why here (that's a course worth of stuff). Look upon it as magic :-) PRC On Sun, 2 Jul 2006, Atte Andr� Jensen wrote:
Perry R Cook wrote:
oK, here's a 10 sentence description of the BiQuad,
Thanks for the explanation. I got some of it.
I spend quite a lot of time playing with the filters, and one of my experiments is attached. The first round sounds like a candidate for a non-resonant low pass filter. Am I right in deducting from this (quite brain dead) experiment(s) that in order to do such a filter sweep one has to adjust the radius while taming the volume? Or am I totally missing something here?
-- peace, love & harmony Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Perry R Cook wrote:
Nope, if you use 1=> filt.eqzs, it keeps the gain pretty much tame at any frequency. No explanation as to why here (that's a course worth of stuff). Look upon it as magic :-)
I will...
However: I didn't use 1=> filt.eqzs because I couldn't make it do
nothing. Now I found that it must be set *after* the other values are
updated (for a nice heavy metal guitar sound, try putting it before the
updates). Is that a bug or a feature?
With eqzs (partly) working, I suddenly saw a pattern. I might not be
supposed to do this, but these simple relationships could (however
inconvenient) be updated along side a filter frequency during a sweep...
--
peace, love & harmony
Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk
http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
sawosc osc1 => BiQuad f => dac;
for(20=>float i; i<20000; i*1.1 => i){
i => float pfreq;
pfreq / 8000 => float gain;
math.max(0,1 - (pfreq / 5000)) => float prad;
0 => int zrad;
0 => int zfreq;
<<
participants (5)
-
Adam Tindale
-
Atte André Jensen
-
eduard aylon
-
Kassen
-
Perry R Cook