| Author |
Message |
Frostburn

Joined: Dec 12, 2007 Posts: 212 Location: Finland
Audio files: 7
|
Posted: Sat Feb 16, 2008 9:48 am Post subject:
GenX Subject description: what are these things? |
 |
|
They seem to be a class of waveshapers but I couldn't find any clear documentation on how they actually work...
I did manage to pull off a pitch to frequency waveshaper though:
| Code: | Gen5 midi_to_freq;
[Std.mtof(0.0)/Std.mtof(128.0),1.0,1.0] => midi_to_freq.coefs;
Std.mtof(128.0) => midi_to_freq.gain;
Step pitch => midi_to_freq => SinOsc s => dac;
0 => s.sync;
1.0/128.0 => pitch.gain; //Keep the signal between 0.0 and 1.0
60.0 => pitch.next; //Play midi note 60
second => now;
s =< dac;
second => now;
SinOsc s2 => dac;
Std.mtof(60.0) => s2.freq;
second => now; |
_________________ To boldly go where no man has bothered to go before. |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6248 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sun Feb 17, 2008 11:08 am Post subject:
|
 |
|
Yeah, I have the same issue. They look great but it's not so clear what they do, how and why.
I think Dan has said he'd document those and LiSa properly but like all of the official DEV's he seems to be a busy man....
I didn't spend a lot of time with the Gen's yet, my ChucK experiments have been more about namespace issues lately. _________________ while(!machine.crash() ) <<<"all is well">>>; |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 452 Location: bangkok, thailand
Audio files: 2
|
Posted: Sun Feb 17, 2008 9:58 pm Post subject:
|
 |
|
Hmm.. I've tried a little bit with GEN.
I was using it as
- waveshaper .. like f(input) that kinda thing. but with input range limited to 0 to 1
- oscillator .. i guess there is this kind of thing in the examples. |
|
|
Back to top
|
|
 |
Frostburn

Joined: Dec 12, 2007 Posts: 212 Location: Finland
Audio files: 7
|
Posted: Mon Feb 18, 2008 2:00 am Post subject:
|
 |
|
Here's a bit hackish hard limiter using Gen7:
| Code: | class Clipper{ //Works in [-100.0,100.0] range and clips to [-1.0,1.0] range
Gain in => Gen7 clipper => Gain out; 0.01 => in.gain;
[-1.0,0.49,-1.0,0.02,1.0,0.49,1.0] => clipper.coefs;
Step half => clipper; 0.5 => half.next;
fun void set_range(float min, float max){
[min,0.5+min*0.01,min,(max-min)*0.01,max,0.5-max*0.01,max] => clipper.coefs;
}
} |
_________________ To boldly go where no man has bothered to go before. |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 6248 Location: The Hague, NL
G2 patch files: 3
|
Posted: Mon Feb 18, 2008 2:50 am Post subject:
|
 |
|
Looked at them some more.... CrurveTable looks good for waveshaping/ waveform generation. The real fun will start with modulating the coefs.... which will glitch.... Unless we run the controlling shred at the same speed as the controlling Phasor to make sure it only updates at the exact moments of zero-crossings. :¬)
Tricky, maybe, but I think it'll work. _________________ while(!machine.crash() ) <<<"all is well">>>; |
|
|
Back to top
|
|
 |
|