-
Notifications
You must be signed in to change notification settings - Fork 821
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
pitchstairecase Bug Fix: Sound keeps playing even after closing the widget. #2837
Conversation
Please review @meganindya. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7ce1b200-0357-42e7-8bb5-54db7e2ce003.mp4
still playing
Hey @meganindya, thanks for the review. But it is getting stopped on closing as mentioned. I rechecked this. screen-capture3.mp4Can you please look into this? |
@meganindya |
FYI, I tried on the new Edge which is chromium based |
It was a minor mistake from my side. I fixed it. |
js/widgets/pitchstaircase.js
Outdated
logo.synth.setMasterVolume(0); | ||
logo.synth.stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why swapping these around works but not the other way round? Is the stop()
actually working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the stop()
function does not work at all. It shows in the debug logs that this does not work. So in many widgets like in the temperament and the timbre widget, the setMasterVolume(0)
is called so as to mute the sounds. However, it does not stop the already started trigger()
method. Thus, even if we comment out or delete the logo.synth.stop();
line, it would not have any effect on this functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, in the function stop()
of the file synthutils.js, the line Tone.Transport.stop();
does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I investigated. It won't work because .stop()
stops Tone.Transport
assignments. Since, notes are triggered by synth's (Tone.js) triggerAttackRelease
it needs to be released by a triggerRelease
itself. Since, there are inconsistencies all around, I made a hack fix to this.
5cd611e
to
17d6ef3
Compare
Issue Reference: #2767
The sound kept playing even after closing the pitch staircase widget.
Before:
screen-capture.mp4
After:
screen-capture1.mp4