pausing project with play frequency sometimes keeps an oscillator running

Please fill out these questions for all feature requests and bug reports. If you're requesting a feature, please let us know why this feature is important or useful, not just what it should do.
Thanks!

  1. What browsers show this problem?
    Chrome
  2. Please share an example project (if possible).
    It happened while I was experimenting with SCP's in my Kevin MacLeod Music Repository project, but it might happen with other projects.
  3. Describes the steps to reproduce this issue. [@ego-lay_atman-bay found specific steps to better reproduce the bug]
    Pause a project while playing a frequency, e.g.

[scratchblocks]
play frequency (440) Hz :: sound
pause all :: control
[/scratchblocks]

  1. What does Snap! currently do?
    Sometimes when the project is played, the oscillator plays 440 Hz and nothing I try (stop button, stop block, pause button, pause block, stop freq block) stops the oscillator.
  2. What should Snap! do instead?
    Keep track of the oscillator so that it can be stopped

can you post link to a project that shows the problem?

I was able to reproduce the bug.

Here's how to reproduce it

  1. Run the play frequency block
  2. Click the pause all block
  3. Click the pause all block again
  4. Click the unpause button (pause button next to the green flag)
  5. Run the play frequency block again
  6. Click the pause all block again
  7. Click the unpause button
  8. Stop the frequency any way you want.

These steps the most consistent way I found to reproduce the bug. What I think is happening is that the first time you run the play frequency block, and then pause it, but when you click the pause all block again, and then click the unpause button, the frequency doesn't start again, so when you run it the second time, and you click the unpause button again, it plays along with the first one that was supposed to stop earlier.

This is just my theory (because it sounds like there's 2 layers of frequency playing at the same time, and when you stop the frequency, it gets quieter, which means one layer stopped)

2 Likes

I could, but that script shown above is so simple, I don't think I need to create a new project and share it.

it seems simple, but I tried it and the bug didn't show up (is that the right word?)