class HardLimit extends Chugen {
2 => float limit;
fun float tick(float in) {
return Math.min(Math.max(in, -limit), limit);
}
fun float setLimit(float limit) {
limit => this.limit;
}
}
I think this is a serious issue for mac users and that it should be addressed in the next build. My suggestion is to have a parameter of the dac ugen called dac.limit, which is automatically set to 2 or 3 or so, and which acts as a hard limit applied to the audio data going into the dac. A user could set their own limit or set it to -1 or something to indicate no limit. But I think the default should be something that will not destroy anyone's hearing. :-)
Marc
Hey, Robert!On 26 February 2015 at 06:50, Robert Poor <rdpoor@gmail.com> wrote:On Wed, Feb 25, 2015 at 11:18 AM, Kassen <signal.automatique@gmail.com> wrote:> [on windows] turning down the volume to a comfortable level won't help against that explosionAre you saying there's no way to turn down the *output* of the DACs?Let me first clarify; where you wrote "[on Windows]" I meant in systems using a floating point internal sound router. In our case that is really only OSX.Clearly you can turn the dac up or down using dac.gain( float).What I meant is that we have some sort of issue in our code that sends a signal with a huge amplitude, let's assume some signal with 10 digits worth of amplitude, it is hard to turn that down in a meaningful way. If we set the dac's gain to 0.1 then there will still be 9 digits worth of amplitude left; still orders of magnitude louder than what our hardware can deal with.Under normal conditions we would not make such a mistake, but runaway feedback, such as we might encounter in a unstable filter, will rapidly approach the max of what can be expressed in double-precission floats.There ways to deal with that. We could use a limiter or clipper. You can also use a external hardware gain and leave your system volume at 100%.I hope that clarifies how I believe it all works. If you are on Windows or Linux I don't believe this will matter to you, sorry if I was unclear there.Yours,Kas.
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users