Open jbphet opened 2 years ago
Doc created. It will continue to live here. Color Vision - Sound Design Doc
As of 8/30/2022, work on adding sound to this simulation is being paused. This is due primarily to some personnel changes that complicate some of the plans related to the sim.
I'll mark this issue as deferred, and we will hopefully return to it in the future.
I'm also going to mark this as blocking publication of the sim, since I'd like to leave the partially-implemented sound enabled in master for now, but we would need to turn it off prior to publication if there is a need to publish from master before we have the time to finish the sound implementation.
By the way, I just tried turning off sound by modifying the package.json
file and running grunt update
, and it seemed to work fine, though I only did minimal testing. This might be a good option if the sim needs to be republished from master before the sound implementation is completed.
A decision has been made to add sound to this sim. Here is the checklist, taken from the tambo repo, that is generally used to guide this process:
supportsSound
andsupportsExtraSound
can be used to turn sound on for testing during development.supportsSound: true
key-value pair to thephet
sub-object in the package.json file for this simulation. See https://github.com/phetsims/friction/blob/master/package.json. This portion will look something like this:supportsExtraSound: true
key-value pair to thephet
sub-object in the package.json file for this simulation. The main effect that this is has is to add the 'Extra Sound' item to the PhET menu. See https://github.com/phetsims/friction/blob/master/package.json.grunt update
to get the updated configuration into the HTML file.SoundPlayer.NO_SOUND
. Search through the code base for example usages.SoundPlayer
(often aSoundClip
instance) and passing it in as an option for the sound player.ScreenView
files. Both approaches have been used, and both are legit, and it probably depends on how much sound generation is needed and whether adding it all to theScreenView
file(s) is likely to make the file too large and/or difficult to maintain. As of this writing,WavesScreenSoundView
is an example of a separate class where the sounds are hooked to the model, andFrictionScreenView
is an example of where sound was interwoven with the visual view code. Note that in some cases it is necessary to know what the user was doing that triggered the need for sound generation, and in these cases the sound generation will need to be inside the view element so that the code has access to all the needed information. An example where this often comes up is if different behavior is needed when a value was changed via keyboard interaction versus mouse or touch interaction.SoundClip
, please search for usages of this type in the tambo demo and/or other sims to see examples of how it is generally used.assets
directory. Make sure the names match, e.g.bonk.mp3
in thesounds
directory andbonk.wav
in theassets
directory.team
or other lists in the credits, add them using thesoundDesign
key.ready-for-testing
and have it tested with the other aspects of the simulation through the publication process.