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

Add sound for the predict mean pencil slider on screen one #173

Closed
Ashton-Morris opened this issue Mar 18, 2024 · 8 comments
Closed

Add sound for the predict mean pencil slider on screen one #173

Ashton-Morris opened this issue Mar 18, 2024 · 8 comments

Comments

@Ashton-Morris
Copy link
Contributor

I have two files in case the .mp3 doesn't loop perfectly. They are in the same folder as the other issues.

  • MSaBPredictMeanPencilLoop.wav
  • MSaBPredictMeanPencilLoop.mp3

I have a looping sound mocked op that plays when the pencil is moved. The mockup video is stored in the same folder as the other issues.

  • MSaBPredictMeanPencilVideoExample.mp4

But I do remember that we did something similar in another sim: To where if you hold the pencil it doesn't start playing the sound unless you start to move it. Do you remember that? I think thats the preferred mapping if we can remember how it's done.

@marlitas
Copy link
Contributor

marlitas commented Apr 1, 2024

To where if you hold the pencil it doesn't start playing the sound unless you start to move it.

It looks like we did this in CAV with a ContinuousPropertySoundClip. The documentation states the following:

It is implemented such that the sound fades in when changes
occur in the Property's value and fades out when the value doesn't change for some (configurable) amount of time.

I will move forward using the same strategy and see how it goes!

@marlitas
Copy link
Contributor

marlitas commented Apr 1, 2024

I was very quickly stopped in my tracks because ContinuousPropertySoundClip does not support a range that include 0. Below is the patch for where I got to... I think I should talk this over with @jbphet.

Subject: [PATCH] Update documentation, see: https://github.com/phetsims/center-and-variability/issues/617
---
Index: sounds/predictMeanPencilLoop_mp3.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sounds/predictMeanPencilLoop_mp3.js b/sounds/predictMeanPencilLoop_mp3.js
new file mode 100644
--- /dev/null	(date 1712004375425)
+++ b/sounds/predictMeanPencilLoop_mp3.js	(date 1712004375425)
@@ -0,0 +1,46 @@
+/* eslint-disable */
+import asyncLoader from '../../phet-core/js/asyncLoader.js';
+import base64SoundToByteArray from '../../tambo/js/base64SoundToByteArray.js';
+import WrappedAudioBuffer from '../../tambo/js/WrappedAudioBuffer.js';
+import phetAudioContext from '../../tambo/js/phetAudioContext.js';
+
+const soundURI = 'data:audio/mpeg;base64,//twxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAjAAAsFAAHBw4ODhUVFR0dHSQkJCsrKzMzOjo6QUFBSUlJUFBQV1dXX19fZmZtbW11dXV8fHyDg4OKioqSkpKZmaCgoKioqK+vr7a2tr6+vsXFxczM1NTU29vb4uLi6urq8fHx+Pj4//8AAAA8TEFNRTMuOTlyAc0AAAAAAAAAABRgJAK0QgAAYAAALBS3lPynAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/7cMQAAAgoA31UEYAzTDEuPzOQAaYLpSSRIMBCAIQQADjigQBDBDKAmD4P8QAgcSD4Pn/l4IOLggGP/4Pg+H+D4OAh0/ygPv/kJcH3lAQBAEAfB/+GMVTEHM4ZCEnNJEiUWkW5JDEtOSuyOu5MMFSwoCoa+zwreBRwUBclPPcNG20N0KWN0fRqbartc905RLZtu7hMuaRDckd1/KOMzjhNScZyoEp3fdCNvLLYu/juU0vhiK38KKWSSvLK2EcmKXPdyvY+cp5mxQ29VoemuSrD6OcfyXWt01Lz71itdlOdStUlVmZr1pR3Gxb7jl2znO2vrU+GF+m+zH/n95Wt7+kl89GZzCzFsq1nGxukxynMMrtvWHf1v+1q0u1uz21jl+dbmFrLtXaDYhXLSWJ2QySaCKckBuOYD0r/+3LEB4AOIPV5/PQAAh+hrRGGJLjCcoE5wwC3pZiNsTRFnScadDQuYDgwYaWLiCPsmg+kcXNCRox5uJ1JNGJ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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==';
+const soundByteArray = base64SoundToByteArray( phetAudioContext, soundURI );
+const unlock = asyncLoader.createLock( soundURI );
+const wrappedAudioBuffer = new WrappedAudioBuffer();
+
+// safe way to unlock
+let unlocked = false;
+const safeUnlock = () => {
+  if ( !unlocked ) {
+    unlock();
+    unlocked = true;
+  }
+};
+
+const onDecodeSuccess = decodedAudio => {
+  if ( wrappedAudioBuffer.audioBufferProperty.value === null ) {
+    wrappedAudioBuffer.audioBufferProperty.set( decodedAudio );
+    safeUnlock();
+  }
+};
+const onDecodeError = decodeError => {
+  console.warn( 'decode of audio data failed, using stubbed sound, error: ' + decodeError );
+  wrappedAudioBuffer.audioBufferProperty.set( phetAudioContext.createBuffer( 1, 1, phetAudioContext.sampleRate ) );
+  safeUnlock();
+};
+const decodePromise = phetAudioContext.decodeAudioData( soundByteArray.buffer, onDecodeSuccess, onDecodeError );
+if ( decodePromise ) {
+  decodePromise
+    .then( decodedAudio => {
+      if ( wrappedAudioBuffer.audioBufferProperty.value === null ) {
+        wrappedAudioBuffer.audioBufferProperty.set( decodedAudio );
+        safeUnlock();
+      }
+    } )
+    .catch( e => {
+      console.warn( 'promise rejection caught for audio decode, error = ' + e );
+      safeUnlock();
+    } );
+}
+export default wrappedAudioBuffer;
\ No newline at end of file
Index: js/intro/view/PredictMeanSlider.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/intro/view/PredictMeanSlider.ts b/js/intro/view/PredictMeanSlider.ts
--- a/js/intro/view/PredictMeanSlider.ts	(revision 328e3a2600524dd09186f55b6d52499f9f0ed1c5)
+++ b/js/intro/view/PredictMeanSlider.ts	(date 1712005079398)
@@ -23,6 +23,9 @@
 import Property from '../../../../axon/js/Property.js';
 import pencil_png from '../../../images/pencil_png.js';
 import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
+import ContinuousPropertySoundClip from '../../../../tambo/js/sound-generators/ContinuousPropertySoundClip.js';
+import predictMeanPencilLoop_mp3 from '../../../sounds/predictMeanPencilLoop_mp3.js';
+import soundManager from '../../../../tambo/js/soundManager.js';
 
 type SelfOptions = EmptySelfOptions;
 type ParentOptions = AccessibleSliderOptions & NodeOptions;
@@ -34,6 +37,7 @@
 export default class PredictMeanSlider extends AccessibleSlider( Node, 0 ) {
   private readonly predictMeanLine: Line;
   private readonly predictMeanHandle: Node;
+  private readonly continuousPropertySoundClip: ContinuousPropertySoundClip;
 
   public constructor( meanPredictionProperty: Property<number>, dragRange: Range, numberOfCupsProperty: Property<number>,
                       getActiveNotepadCups: () => Array<Cup>, modelViewTransform: ModelViewTransform2, providedOptions: PredictMeanNodeOptions ) {
@@ -69,6 +73,18 @@
       this.centerY = modelViewTransform.modelToViewY( prediction );
     } );
 
+    this.continuousPropertySoundClip = new ContinuousPropertySoundClip(
+      meanPredictionProperty,
+      dragRange,
+      predictMeanPencilLoop_mp3, {
+        trimSilence: false, // a very precise sound file is used, so make sure it doesn't get changed
+        fadeTime: 0.3,
+        delayBeforeStop: 0.25,
+        stopOnDisabled: true
+      }
+    );
+    soundManager.addSoundGenerator( this.continuousPropertySoundClip, { associatedViewNode: this } );
+
     this.addInputListener( dragListener );
 
     this.predictMeanLine = predictMeanLine;
@@ -97,6 +113,10 @@
     this.predictMeanHandle.leftCenter = this.predictMeanLine.rightCenter;
     this.setPointerAreas();
   }
+
+  public step( dt: number ): void {
+    this.continuousPropertySoundClip.step( dt );
+  }
 }
 
 meanShareAndBalance.register( 'PredictMeanSlider', PredictMeanSlider );
\ No newline at end of file
Index: sounds/license.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sounds/license.json b/sounds/license.json
--- a/sounds/license.json	(revision 328e3a2600524dd09186f55b6d52499f9f0ed1c5)
+++ b/sounds/license.json	(date 1712004368933)
@@ -30,5 +30,13 @@
     "projectURL": "https://phet.colorado.edu",
     "license": "contact [email protected]",
     "notes": "created by Ashton Morris (PhET Interactive Simulations)"
+  },
+  "predictMeanPencilLoop.mp3": {
+    "text": [
+      "Copyright 2024 University of Colorado Boulder"
+    ],
+    "projectURL": "https://phet.colorado.edu",
+    "license": "contact [email protected]",
+    "notes": "created by Ashton Morris (PhET Interactive Simulations)"
   }
 }
\ No newline at end of file

I went ahead and committed adding the mp3 file and update to the license.json.

@jbphet
Copy link
Contributor

jbphet commented Apr 9, 2024

I've added this using ContinuousPropertySoundGenerator, and I made a number of adjustments to it, but I'm not very fond of it. It's not bad for quick drags, but long drags sound odd. We can discuss at today's review meeting and decide on the next steps.

@jbphet
Copy link
Contributor

jbphet commented Apr 9, 2024

We discussed this in the 4/9/2024 sound design meeting, and we felt like there was a mismatch between the action on the screen and the sound. For the next round, we'd like to try integrating the sound generator used for the foot drag in the John Travoltage sim, which is based on filtered wide-spectrum noise, and alter the filter center frequency based on the height of the mean prediction line.

@jbphet
Copy link
Contributor

jbphet commented Apr 16, 2024

Reviewed the latest, which is based upon the FootDragSoundGenerator from John Travoltage, and are generally good with the results. Next things to try are:

  • Make the center frequencies slightly higher.
  • Some of the drags seem too loud, so we should see if this can be dialed down a bit
  • Get rid of any unnecessary parameterization

@jbphet jbphet removed the dev:help-wanted Extra attention is needed label Apr 19, 2024
@jbphet
Copy link
Contributor

jbphet commented Apr 20, 2024

I've made the changes listed in the previous comment and I think this is ready for review in the next design meeting.

@jbphet
Copy link
Contributor

jbphet commented Apr 23, 2024

We reviewed this in the 4/23/2024 sound design meeting, and we are all good with it. Assigning to @amanda-phet for one last check and, if she's good with it, this can be closed as completed.

@amanda-phet
Copy link
Contributor

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants