[chuck-users] stk questions - SawOsc and filters

Kassen signal.automatique at gmail.com
Thu May 31 09:17:42 EDT 2007


On 5/31/07, Josh Lawrence <hardbop200 at gmail.com> wrote:
>
> Last night I sat down and was able to modify polyfony.ck to use a
> SawOsc instead of the Mandolin.


Cool!



  My next step was to try to connect
> that oscillator to a filter, but how do I do that?  My thinking was
> after I get done with defining my SawOsc parameters, I could just
> chuck the oscillator to the filter, like so?
>
> s => moog;
>
> (s is my SawOsc, and moog is Moog.)


Ah, yes. "moog" in this case refers to a emulation (a simple but fun one) of
a Moog synth, not to the Moog filter (think Minimoog v.s. Moogerfooger).
What you are looking for would run something like this;

SawOsc osc => LPF filt => ADSR env => dac;

That would be the basic layout of a traditional single oscilator synth. You
could elaborate on that, for example by adding a second oscilator and a
filter modulation envelope if you'd like to get more fancy.


>
> Does anyone have any examples of a more complete subtractive
> synthesizer that I can model mine after?


How about starting with the layout above? You can look up the Ugens used in
the manual and see how far those get you.



> Final question:  Is monophonic operation with glide out of the
> question with ChucK?


No, not at all, that's quite possible and indeed would likely be more simple
then polyphonic operation. The glide bit would be the hardest. How about
this;
-----------------------
//warning, unchecked code, might contain typos

//example signal
SawOsc s => dac;

//modulation source
//you might want to look up "blackhole" to see what it does,
//blackhole is quite usefull when using modulation.
Envelope slide => blackhole;

//this will be a 303-style slide that takes a second to reach any given
target
second => slide.duration;

//set initial frequency
330 =>  s.freq;
//making sure the modulation source fits this
330 => slide.value;

//let it sound for a bit
second => now;

//the actual slide starts here.
440 => slide.target;

//we run this untill the slide has reached it's goal
while(slide.value() != slide.target)
    {
    //this is where the actual modulation occurs
    slide.value() => s.freq;

    //this represents the "controll rate"
    //shorter values produce a smoother glide at a higher cpu cost
    10::ms => now;
    }

//let the new frequency sound for a bit too
second => now;
----------------------------
Hope that gets you started?

Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20070531/be6b80bd/attachment.htm 


More information about the chuck-users mailing list