phetsims / resistance-in-a-wire

"Resistance in a Wire" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/resistance-in-a-wire
GNU General Public License v3.0
1 stars 4 forks source link

Distortion occurring in sound when sliders moved quickly #182

Closed jbphet closed 5 years ago

jbphet commented 5 years ago

While working on #180, I thought I was hearing some distortion of the sound, likely due to clipping, if I moved the sliders up and down quickly. I recorded the sound and measured it with an app called Total Recorder, then examined it using Audacity. Indeed, it's clipping. Here are a couple of screenshots that illustrate.

Big picture view - this shows several rapid up-and-down movements of the resistivity slider with the other two sliders in their default positions:

image

Here is a zoom in on the most clipped portion:

image

This should probably be addressed, potentially by adding a dynamics compressor somewhere in the signal chain.

jbphet commented 5 years ago

Note: I tried uploading the .wav files that capture the effect in an audio recording, but GitHub doesn't support that file type.

jbphet commented 5 years ago

I discussed the approach for this with @Ashton-Morris today because I wanted some input from someone with sound engineering experience. He pointed out that having a compressor/limiter at the end of the signal chain is a pretty common process when mixing, so that has given me more confidence that the idea of having a Web Audio DynamicsCompressorNode as the last element of the signal chain makes sense.

jbphet commented 5 years ago

I'm going to go ahead and close this and will create the 1.6 branch and publish with this fix in place.

jbphet commented 5 years ago

Reopening - I'd like to get this tested on multiple platforms during the 1.6 RC testing.

phet-steele commented 5 years ago

@jbphet I'm getting some wacky and cool sounds when I very tightly flam home + end (with keyboard nav).

Heard on Win 10 Chrome. For phetsims/QA/issues/219.

Troubleshooting Information URL: https://phet-dev.colorado.edu/html/resistance-in-a-wire/1.6.0-rc.1/phet/resistance-in-a-wire_en_phet.html Version: 1.6.0-rc.1 2018-11-07 18:26:25 UTC Features missing: touch User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36 Language: en-US Window: 1920x938 Pixel Ratio: 1/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 4095 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"928741cf","branch":"HEAD"},"axon":{"sha":"ff00a0bb","branch":"HEAD"},"brand":{"sha":"1fd6682e","branch":"HEAD"},"chipper":{"sha":"fa2fbadf","branch":"HEAD"},"dot":{"sha":"bbbd8526","branch":"HEAD"},"joist":{"sha":"82521d0c","branch":"HEAD"},"kite":{"sha":"380cef53","branch":"HEAD"},"phet-core":{"sha":"1b90ac2f","branch":"HEAD"},"phet-io":{"sha":"38d7b161","branch":"HEAD"},"phet-io-wrapper-classroom-activity":{"sha":"246085c1","branch":"HEAD"},"phet-io-wrapper-hookes-law-energy":{"sha":"7479b0ec","branch":"HEAD"},"phet-io-wrapper-lab-book":{"sha":"c46f7839","branch":"HEAD"},"phet-io-wrappers":{"sha":"a6bc62ca","branch":"HEAD"},"phetcommon":{"sha":"cd63d89a","branch":"HEAD"},"query-string-machine":{"sha":"06ed6276","branch":"HEAD"},"resistance-in-a-wire":{"sha":"38ae25d0","branch":"HEAD"},"scenery":{"sha":"51716674","branch":"HEAD"},"scenery-phet":{"sha":"15dec251","branch":"HEAD"},"sherpa":{"sha":"2cd50500","branch":"HEAD"},"sun":{"sha":"5244d45e","branch":"HEAD"},"tambo":{"sha":"ad355580","branch":"HEAD"},"tandem":{"sha":"4f37a910","branch":"HEAD"}}
jbphet commented 5 years ago

I tried a lot of home-end key flams and didn't hear anything other than fast tone combinations, none of which caused clipping distortion, and all of which seemed entirely reasonable. I also recorded the output and looked at it, and all peaks were well below 0 dBFS. I was testing on Win 10 and Chrome, as was @phet-steele.

@phet-steele - this is a bit of an unusual test case, but if you think that it is enough of a concern to warrant further investigation, please download and install the demo version of "Total Recorder" and make a recording of what you're hearing that seems problematic. You won't be able to attach the file to the GitHub issue, but you can post it on Google Drive and put a link in this issue.

KatieWoe commented 5 years ago

I may be hearing something in Mac 10.14 safari, mostly in the middle slider, but its hard to tell.

KatieWoe commented 5 years ago

https://github.com/phetsims/resistance-in-a-wire/issues/198

jbphet commented 5 years ago

This is addressed, but I'll be leaving the issue linked in the comment above for some more scrutiny at a later date. Closing this one.