Skip to content
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

Review sound levels and any other sound design aspects #155

Closed
jbphet opened this issue Dec 5, 2018 · 4 comments
Closed

Review sound levels and any other sound design aspects #155

jbphet opened this issue Dec 5, 2018 · 4 comments
Assignees

Comments

@jbphet
Copy link
Contributor

jbphet commented Dec 5, 2018

@Ashton-Morris - I've published a dev version of friction that includes the first cut at the sound design implementation. Please review and let me know if some of the levels should be changed and, if so, to what values. I've marked all places in the code where levels are set with a comment of the form:

  // TODO: Ashton - ...

If you have other feedback on the implementation, please log that as well.

Link: https://phet-dev.colorado.edu/html/friction/1.5.0-dev.23/phet/friction_en_phet.html

Tagging @emily-phet so that she is aware in case she'd like to take a look at this.

For reference, the issue for implementing the sound design is #148.

@emily-phet
Copy link

Thoughts on having the 'thud' sound when chemistry book contacts physics book be a little lower in volume? Listening without my headphones on my Mac it sounds a little loud. Not sure how it feels for others.

@jbphet
Copy link
Contributor Author

jbphet commented Dec 17, 2018

Here is the feedback that I received from @Ashton-Morris via email:

BookNode.js line 43

  let SOUND_LEVEL = 0.1; // TODO: Ashton - level for non-magnified book pickup and drop, review and modify if needed

Magnifier.js line 56

  let SOUND_LEVEL = 0.1; // TODO: Ashton - level for magnified book pickup and drop, review and modify if needed

FrictionScreenView.js lines 98-191

    // create and hook up the sound that will be produced when the books come into contact with one another
    // TODO: Ashton - review and modify level if needed
    const bookContactSoundClip = new SoundClip( bookContactSound, { initialOutputLevel: 0.060 } );
    soundManager.addSoundGenerator( bookContactSoundClip );
    model.contactProperty.link( contact => {
      if ( contact ) {
        bookContactSoundClip.play();
      }
    } );

    // @private {BookRubSoundGenerator} - sound generator for when the books rub together
    // TODO: Ashton - review and modify level if needed
    this.bookRubSoundGenerator = new BookRubSoundGenerator( model.topBookPositionProperty, model.contactProperty, {
      maxOutputLevel: 0.5
    } );
    soundManager.addSoundGenerator( this.bookRubSoundGenerator );

    // @private - add magnifier
    this.magnifierNode = new MagnifierNode( model, 195, 425, chemistryString, tandem.createTandem( 'magnifierNode' ), {
      x: 40,
      y: 25,
      layerSplit: true
    } );
    this.addChild( this.magnifierNode );

    // add thermometer
    this.addChild( new ThermometerNode(
      THERMOMETER_MIN_TEMP,
      THERMOMETER_MAX_TEMP,
      model.amplitudeProperty,
      {
        x: 690,
        y: 250,
        tubeHeight: 160,
        tickSpacing: 9,
        lineWidth: 1,
        tubeWidth: 12,
        bulbDiameter: 24,
        majorTickLength: 4,
        minorTickLength: 4,
        fluidMainColor: THERMOMETER_FLUID_MAIN_COLOR,
        fluidHighlightColor: THERMOMETER_FLUID_HIGHLIGHT_COLOR,
        fluidRightSideColor: THERMOMETER_FLUID_RIGHT_SIDE_COLOR,
        backgroundFill: THERMOMETER_BACKGROUND_FILL_COLOR
      }
    ) );

    let playAreaNode = new PlayAreaNode();
    this.addChild( playAreaNode );

    // a11y
    playAreaNode.accessibleOrder = [ chemistryBookNode, this.magnifierNode ];

    // add reset button
    let resetAllButton = new ResetAllButton( {
      listener: function() {
        model.reset();
        self.reset();
      },
      radius: 22,
      x: model.width * 0.94,
      y: model.height * 0.9,
      touchAreaDilation: 12,
      tandem: tandem.createTandem( 'resetAllButton' )
    } );
    this.addChild( resetAllButton );

    // add sound generator for reset
    soundManager.addSoundGenerator( new ResetAllSoundGenerator( model.resetInProgressProperty, {
      initialOutputLevel: 0.7
    } ) );

    // create and register the sound that will be played to indicate changes to the rate of molecule motion
    // TODO: Ashton - review and modify level if needed
    soundManager.addSoundGenerator( new MoleculeMotionSoundGenerator( model.amplitudeProperty, {
      maxOutputLevel: 0.2
    } ) );

    // create and hook up the sound that is played when molecules break off from the top book
    // TODO: Ashton - review and modify level if needed
    const moleculeBreakOffSoundClip = new SoundClip( moleculeBreakOffSound, { initialOutputLevel: 0.05 } );
    soundManager.addSoundGenerator( moleculeBreakOffSoundClip );
    model.evaporationEmitter.addListener( () => {

      // don't play for every evaporated molecule or it's too noisy
      if ( model.numberOfAtomsEvaporated % 4 === 0 ) {

        // choose a playback rate
        moleculeBreakOffSoundClip.playbackRate = FrictionConstants.GET_RANDOM_PENTATONIC_PLAYBACK_RATE();

        // play the sound
        moleculeBreakOffSoundClip.play();
      }
    } );

jbphet added a commit that referenced this issue Dec 17, 2018
@zepumph
Copy link
Member

zepumph commented Dec 19, 2018

Should this block publication? Adding the label until I hear otherwise.

@jbphet
Copy link
Contributor Author

jbphet commented Jan 7, 2019

I implemented the provided feedback, I think it's safe to close this one.

@jbphet jbphet closed this as completed Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants