-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about sound implementation in WaveInterferenceSlider.js #523
Comments
From the keyboard, there should be a sound with every keypress. For mouse/pointer, there should only be a sound when you reach a tickmark.
From my testing, it doesn't appear to be needed in either code path. It was described in 0b93187 but that doesn't seem accurate any more.
Same as the response to (1). Also, for mouse/touch you can move quickly and get too many sounds to play at the same time, so it has to be throttled.
Because hitting the extrema is rare (compared to passing over tick marks). For example, it would be difficult for a user to hit the boundary more than 1-2 times per frame, but it could be easy to cross many tick marks in one frame.
Yes, it's the delta between start times.
Yes
Yes, because longer sounds would be more prone to overlapping.
Yes. That being said, it may not require exact fine tuning. For example, if one sound is 0.3sec and the new sound is 0.2sec, then the same inter click time would probably be OK. It's just about making sure that not too many sounds play at the same time, which would increase the volume. |
Thanks for the answers!
It sounds like you're assuming that /**
* Specifies whether or not the SceneryEvent came from alternative input.
...
*/
isFromPDOM() { .... and I can certainly imagine an input device that has the same "too many sounds to play at the same time" problem as mouse/touch. So this solution is not future-proof. Closing. |
Some questions, to help proceed with phetsims/fourier-making-waves#56 and phetsims/sun#697
WaveInterference.js adds sound support to
HSlider
.For the
if ( event.isFromPDOM() )
code path:(1) Why is a different code path required when
event.isFromPDOM()
?(2) Why is
TOLERANCE
needed in this code path, and not the mouse/touch code path?(3) Why is there no need to verify the elapsed time between sounds, as in the mouse/touch code path?
For the mouse/touch code path:
(4) Why is it not necessary to check elapsed time before playing
generalBoundaryBoopSoundPlayer
?(5)
MIN_INTER_CLICK_TIME
is documented as "min time between clicking sounds", and I interpret "between" to mean the gap between sounds. But it actually appears to be the min time sinceplay
was called for a clicking sound. Do I understand that correctly?(6)
MIN_INTER_CLICK_TIME
is "set empirically" for the specific sound files used, correct? If I used a longer/shorter sound, then I'd need to adjust it? And if SoundClip had agetDuration
method (see phetsims/tambo#141) would that make it possible to compute this programmatically, as "duration + gap"?The text was updated successfully, but these errors were encountered: