Skip to content

Commit

Permalink
went back to exponential level changes due to problems with consisten…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Apr 8, 2019
1 parent 60ec254 commit e15b1b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/friction/view/BookRubSoundGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ define( function( require ) {

// set the output level based on the velocity of the book
const noiseAmplitude = options.maxOutputLevel * Math.pow( normalizedVelocity, 0.5 );
this.setOutputLevel( noiseAmplitude, 0.1 );
this.setOutputLevel( noiseAmplitude, 0.02 );
}
else {
if ( this.isPlaying ) {
this.stop( this.audioContext.currentTime + STOP_DURATION );
}
this.setOutputLevel( 0, STOP_DURATION );
this.setOutputLevel( 0, 0.02 );
}
}
);
Expand Down
6 changes: 3 additions & 3 deletions js/friction/view/CoolingSoundGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define( function( require ) {

// start the noise generator - it will remain on and the output level will be controlled by the code below
this.start();
this.setOutputLevel( 0 );
this.setOutputLevel( 0, 0 );

// @private {number} - max output level, used in the step function that updates the sound output level
this.maxOutputLevel = options.maxOutputLevel;
Expand Down Expand Up @@ -117,12 +117,12 @@ define( function( require ) {
}

// set the output level using an empirically determined time constant such that changes sound smooth
this.setOutputLevel( targetOutputLevel, 0.2 );
this.setOutputLevel( targetOutputLevel, 0.07 );
}
else {

// stop the noise generator in a way that fades rapidly but not TOO abruptly
this.setOutputLevel( targetOutputLevel, 0.5 );
this.setOutputLevel( targetOutputLevel, 0.2 );
this.stop( this.audioContext.currentTime + 0.01 );
}
}
Expand Down

0 comments on commit e15b1b9

Please sign in to comment.