| Author |
Message |
wppk
Joined: Jan 25, 2008 Posts: 31 Location: Los Angeles
|
Posted: Tue Mar 18, 2008 12:33 pm Post subject:
How can i keep this from clipping? |
 |
|
it seems that everytime 1000::ms passes it sums the new pass to the old and therefore it eventually clips. Any idea how to prevent this?
[code]fun void solarwind() {
while(true){
BPF b => HalfRect r => LPF l2 => JCRev rev => Dyno limiter => dac;
Noise n2 => b;
//tried overall gain
1.0 => dac.gain;
n2.gain(.1);
//tried limiter but not sure exactly how to set this one
limiter.gain(.95);
//what argument type is used for .limit
limiter.limit();
rev.mix(.1);
b.Q(10);
b.freq(5000);
l2.freq(Std.rand2(500,100));
l2.Q(Std.rand2(50,1000));
1000::ms => now;
}
}
spork ~ solarwind();
while(true){100::ms => now;} |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 409 Location: bangkok, thailand
Audio files: 2
|
Posted: Tue Mar 18, 2008 6:02 pm Post subject:
|
 |
|
I've tried messing around with the patch..
but I suspected that the thing that causes this clipping character..
are those Qs in BPF and LPF -_-"
How about trying other kinds of more basic filters and see? |
|
|
Back to top
|
|
 |
wppk
Joined: Jan 25, 2008 Posts: 31 Location: Los Angeles
|
Posted: Tue Mar 18, 2008 9:08 pm Post subject:
|
 |
|
I'm not so sure. it seems that even without the Qs the loop just keeps getting louder every time 1000::ms passes. It's kind of like feedback. I'm baffled.
Thanks for having a look Kijjaz. By the way, what type of argument does the .limit member take? doesn't seem to like float or int. |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 409 Location: bangkok, thailand
Audio files: 2
|
Posted: Tue Mar 18, 2008 9:37 pm Post subject:
|
 |
|
liimt() is just a function to load a preset.
it sets various values.. see http://chuck.cs.princeton.edu/doc/program/ugen_full.html#Dyno
HEY...! ..
I thought HalfRect is always absolute, and the value of l2 might be building up..
hmmm.. but it didn't.
ok let me see more...
ahh...
OH!
HEY...
Hahhahahha oooohhhhh oh..... I know -_-"
You see the BPF b => HalfRect r => LPF l2 => JCRev rev => Dyno limiter => dac; and also the Noise?
that's in the while loop..
so every time it run in there,
there's a brand new instant of that whole row of UGens.
So those all adds up to DAC.
also all the values of the limiters are added to dac, so the values are added up.
here's a fix i made:
| Code: | fun void solarwind() {
Noise n2 => BPF b => HalfRect r => LPF l2 => JCRev rev => Dyno limiter => dac;
//tried overall gain
1.0 => dac.gain;
n2.gain(.1);
//tried limiter but not sure exactly how to set this one
limiter.gain(.95);
//what argument type is used for .limit
limiter.limit();
rev.mix(0.5);
b.Q(10);
b.freq(5000);
while(true){
l2.freq(Std.rand2(500,100));
l2.Q(Std.rand2(50,1000));
1000::ms => now;
}
}
spork ~ solarwind();
while(true){100::ms => now;} |
Another example: (very psychedelic indeed)
| Code: | Dyno limiter => dac;
limiter.limit();
limiter.thresh(.8);
limiter.ratio(10000);
while(true)
{
// new SinOsc instants will build up in memory each time this is run.
SinOsc s => limiter;
.2 => s.gain;
Std.rand2f(0, 127) => Std.mtof => s.freq;
500::ms => now;
} |
warning!! not good for memory! hahahh -_- |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 5961 Location: The Hague, NL
G2 patch files: 3
|
Posted: Wed Mar 19, 2008 2:46 am Post subject:
|
 |
|
I think you may need it move the definitions of the Ugens out of the "while" loop (so above it). I think that right now it keeps re-defining Ugens. _________________ while(!machine.crash() ) <<<"all is well">>>; |
|
|
Back to top
|
|
 |
Antimon

Joined: Jan 18, 2005 Posts: 876 Location: Sweden
Audio files: 6
G2 patch files: 48
|
Posted: Wed Mar 19, 2008 9:26 am Post subject:
|
 |
|
Wait a minute! That means that code like this:
| Code: | 1 => int tjohej;
while (tjohej) {
SinOsc s => dac;
1::second => now;
0 => tjohej;
}
while(true) {
1::second => now;
} |
will leave a tone ringing with no possibility to turn it off, right? Hmm...
/Stefan _________________ You are Wendy Mackaye, first girl on the red planet. |
|
|
Back to top
|
|
 |
wppk
Joined: Jan 25, 2008 Posts: 31 Location: Los Angeles
|
Posted: Thu Mar 20, 2008 9:23 am Post subject:
|
 |
|
| Right. Duh. Thanks Guys. |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 5961 Location: The Hague, NL
G2 patch files: 3
|
Posted: Fri Mar 21, 2008 5:45 am Post subject:
|
 |
|
| Antimon wrote: | Wait a minute! That means that code like this:
will leave a tone ringing with no possibility to turn it off, right? Hmm...
|
Kinda.
If you feel the urgent need you can in fact shoot yourself in the foot.
Still, I think the tone will stop if you exit the shred so I don't think it's a really big deal. _________________ while(!machine.crash() ) <<<"all is well">>>; |
|
|
Back to top
|
|
 |
|