<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Yes, you don't blow the speaker. I've done it many times, and actually use that filter blowing up sound as a musical tool (routed through an external mixer). It's so unpredictable that it's really fun. In fact, this awesome sound was one of the reasons I got into ChucK and the primary reason I keep my old PowerBook around.</div><div><br></div><div>Seems that ChucK can crash brains, not just computers!</div><div><br></div><div>Actually, my other solution was to run the audio through Jack and into Logic, where I can do a much better job of controlling the volume. This actually doesn't distort (since the distortion comes at the dac level), and changes the sound entirely. Anyway, just an option.</div><div><br></div><div>-Andrew</div><br><div><div>On Feb 16, 2010, at 5:03 PM, Kassen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">2010/2/16 Stefan Blixt <span dir="ltr"><<a href="mailto:stefan.blixt@gmail.com">stefan.blixt@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If you do SinOsc s=> dac and the 100.0 => s.gain, are you then able to blow a speaker on a Mac laptop even if it's main volume is turned down? That's the curious thing to me, how the filter messes up so badly it makes my MacBook's speaker scream even though the volume is almost down to zero.<br>

<br></blockquote><div><br></div><div>100? Try something like this value for a output; <span class="Apple-style-span" style="font-family: Courier, 'Courier New', sans-serif; font-size: 11px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">242210436022272.0 </span></div>
<div><span class="Apple-style-span" style="font-family: Courier, 'Courier New', sans-serif; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">That's a actual recorded output of .last(). I'm not sure what would happen if something of that volume would be played back on real speakers; there is probably a UN convention against that kind of thing ;-).</span></div>
<div><span class="Apple-style-span" style="font-family: Courier, 'Courier New', sans-serif; font-size: 11px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Courier, 'Courier New', sans-serif; font-size: 11px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br>
</span></div><div>From what I understand of the situation you wouldn't blow the speaker. If Apple was smart they put in a pre-amp that's slightly smaller than the maximum load of the speaker yet slightly over-speced for the output of the dac to keep repairs down. But yes; apparently you will can get a very high volume even though the (software) fader is down.</div>
<div><br></div><div>This is what we know.</div><div><br></div><div>Then from that I speculated (and unless something more credible comes by I think it's a good theory) that Apple is doing everything in float (with virtually unlimited headroom for practical applications), setting the master volume with a floating point multiplication, and handing the resultant value to the dac where inevitably it will be turned into a plain integer. In this case that integer will be the highest volume the poor little dac can take. If that's not it I can't imagine why +/- some 15 digit number would have a higher amplitude than +/-1, as a final output, post master fader.</div>
<div><br></div><div>This is cheap compared to tweaking the voltage on the final hardware amp (which would always preserve the full bit-range) and probably sounds a lot better than going integer and throwing away a lot of bits at low volume, but it fails to take into account that we may not just turn the volume down for a more pleasant listen but also to protect our ears. Combine that with with potentially very sensitive studio or DJ headphones and you have a situation that may lead to hearing damage. I know that my own pro DJ headphones will output a lot more volume than my mid-range earbuds at the same volume setting for a headphone jack.</div>
<div> </div><div>IMHO this would be a oversight by Apple and I'm a bit surprised there hasn't been a storm of practical joke mails aimed at OSX users featuring videoclips embedding floating-point audio. I'd offer at least a optional output limiter like what has been proposed for mp3 players. I don't believe in those for protecting children's ears through mandatory regulation because of the differences in headphone output volume, but for user-set protection it might be a good idea. Of course ChucK is a bit more likely to cause this sort of issue than the average off-the-shelf audio player.</div>
<div><br></div><div>Here is the original topic if you'd like to try to reproduce the findings so far; <a href="http://electro-music.com/forum/viewtopic.php?t=37921">http://electro-music.com/forum/viewtopic.php?t=37921</a></div>
<div><br></div><div>Yours,</div><div>Kas.</div></div>
_______________________________________________<br>chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br></blockquote></div><br></body></html>