-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Deleting a clone stops its sounds #949
Comments
After discussion with @thisandagain we realized that getting this to work as in 2.0 (i.e. sounds played by clones continue after the clone is deleted) will require a re-factor in scratch-audio:
|
Just a quick note that the above behaviour in Scratch 2 is different if the sound is played "until done". In that case, deleting the clone does stop the sound. (That's because the script is still running, and stopping the script, when the clone gets deleted, also stops the sound currently being played by that script.) |
Actually, it's worth taking a look at this old project of mine: Now compare with Scratch 3 preview: (I think it'd be worth adding the above project for compatibility-testing – and not just for the sounds...) |
Fixed! |
This is still not quite working correctly. (EDIT: OTOH, maybe it is – but see next comment.) Here's a simple test project: It seems as though the notes for all clones of a sprite stop when one clone gets deleted...? As mentioned above, it's worth trying out https://scratch.mit.edu/projects/24414513 as a test project for the sound system in Scratch 3. |
Actually, looking more carefully, are all the instruments 'clipped' to fade away after some (fairly short) time in Scratch 3? In Scratch 2 several of the instruments don't fade (e.g. organ, cello, synth lead/pad), so you can play a note from them for as long as you want (unlike some other instruments, such as piano, guitar, etc., which fade away). The notes in the above test project don't last that long before fading to nothing, so I think that's what's happening (rather than the clone deletion causing problems)...? |
Hi @TheLogFather- Right, I think you are describing an unrelated issue. Clone deletion doesn't effect sounds played by the music extension. Basically, the music extension's instruments have a maximum duration, unlike in Scratch 2.0. This was a compromise that we made so that we could use a simpler system to synthesize their sounds (playing time-stretched samples, instead of using samples with loop points). If you'd like you can file an issue about the maximum duration of some of the instruments. |
OK, I see – I'll take a closer look and probably do that. However, I notice now that a clone's sound started with "play sound until done" now no longer gets stopped when a clone is deleted in Scratch 3, which (as I mentioned above) is not what happens in Scratch 2. Note that the difference (in Scratch 2) is down to whether or not the script was still running – if so (i.e. if playing "until done") then the sound gets stopped when the clone is deleted because the script that's still playing that sound gets stopped. (Similarly, in Scratch 2, "stop other scripts in sprite" stops a sound that's playing "until done" – no clones needed to test this one and see the behaviour in Scratch 3 is different...) |
Expected Behavior
In Scratch 2.0, if you start a sound in a clone, then delete the clone, and the sound will continue to play.
Actual Behavior
Currently in 3.0, because clones have their own audio players which get disposed on clone delete, the sound stops.
Steps to Reproduce
The meow should play when you create a clone:
Operating System and Browser
Mac OS 10.13.2 Chrome 64
The text was updated successfully, but these errors were encountered: