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

pitchstairecase Bug Fix: Sound keeps playing even after closing the widget. #2837

Merged
merged 6 commits into from
Feb 15, 2021

Conversation

daksh4469
Copy link
Member

@daksh4469 daksh4469 commented Feb 11, 2021

Issue Reference: #2767
The sound kept playing even after closing the pitch staircase widget.

Before:

screen-capture.mp4

After:

screen-capture1.mp4

@daksh4469
Copy link
Member Author

Please review @meganindya.
Thanks.

Copy link
Member

@meganindya meganindya left a 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

@daksh4469
Copy link
Member Author

Hey @meganindya, thanks for the review. But it is getting stopped on closing as mentioned. I rechecked this.

screen-capture3.mp4

Can you please look into this?

@daksh4469
Copy link
Member Author

@meganindya
I checked this on another browser, Firefox, and there, it is not stopping while in Chrome, it is stopping.
I am looking into this.

@meganindya
Copy link
Member

FYI, I tried on the new Edge which is chromium based

@daksh4469
Copy link
Member Author

It was a minor mistake from my side. I fixed it.
Can you please review it again? @meganindya

Comment on lines 611 to 612
logo.synth.setMasterVolume(0);
logo.synth.stop();
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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.

@meganindya meganindya merged commit 9211a0f into sugarlabs:master Feb 15, 2021
@daksh4469 daksh4469 deleted the daksh4469-main2 branch February 15, 2021 06:10
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

Successfully merging this pull request may close these issues.

2 participants