Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Stopping, pausing and resuming playback #3

Closed
daveyarwood opened this issue Nov 23, 2016 · 3 comments
Closed

Stopping, pausing and resuming playback #3

daveyarwood opened this issue Nov 23, 2016 · 3 comments
Assignees
Milestone

Comments

@daveyarwood
Copy link
Member

Moved from alda-lang/alda#69.

A much-needed feature!

See the original issue for a spec of how these commands should work, as well as some implementation ideas.

@daveyarwood
Copy link
Member Author

daveyarwood commented Jun 5, 2017

  • sound engine: When you play a score, improve the returned stop! function so that it not only prevents further events from playing, but also mutes any audio that might currently be playing. This will vary depending on the implementation, e.g. for MIDI, we might call setMute on all of the channels.

    Should probably also perform the tear-down! actions when the stop! function is called (but only if the :one-off? option is true). Right now, this only happens when the score is finished playing, even if the stop! function is called.

  • sound engine: Maybe the return value should be the offset into the score where playback was stopped? We could use this to implement pause/resume. When playback is initiated, we could hold onto the current timestamp, and then when playback is stopped, we return (now - start), which should be the offset where playback was stopped. Then to unpause, the client could just say "play from this offset."

  • server/worker: handle a stop-playback message from the client by publishing a STOP message to all workers. Each worker would then call its stop! function that was returned by the play! call when it started playback.

  • I guess for the client to unpause, it would need to know the offset at which playback was stopped, which would require specifically pausing/unpausing a specific jobId and getting the offset back as a response. I think this would be difficult to do with our current architecture. I'm tempted to punt on pause/unpause for now until we have an architecture that makes this easier.

  • client: alda stop command

  • client: :stop REPL command

@daveyarwood
Copy link
Member Author

daveyarwood commented Jun 12, 2017

Stop functionality added in 1.0.0-rc60.

Leaving this issue open until we have pause/resume.

@daveyarwood
Copy link
Member Author

Alda v2 has full support for stop, pause and resume 🎉

Closing this, as Alda v2 will be released soon 🤞

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

No branches or pull requests

1 participant