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

song object container #20

Open
wildmolasses opened this issue Jul 23, 2015 · 2 comments
Open

song object container #20

wildmolasses opened this issue Jul 23, 2015 · 2 comments

Comments

@wildmolasses
Copy link

I have been thinking of how to persist songs in lissajous as well as encapsulate the song as an object for sharing and more relevantly for collaborating in real time. I see that the clock object is keeping track of the song but that it also has methods that don't carry over into a JSON.stringify string. Therefore the clock can't be the container that gets updated to clients for collab nor the object that gets stringified for me to share my song.

@kylestetz
Copy link
Owner

So, this doesn't cover the entire scope of the problem, but:

In order to implement track.merge the track needs to keep a record of its state at a given time. To do that I implemented state getting and setting, which is called from all of the track's public API methods (with some exceptions). If you simply stored the name and arguments of each function call in an array alongside context.currentTime you would have a record of all the functions called through time.

Where this gets a little more complicated is in the fact that both AudioBuffer objects and generator functions get passed around as arguments. As you've pointed out, they can't be stringified. Not sure how to get around this for samples although I know that it's possible for generator functions.

@kylestetz
Copy link
Owner

To clarify, that all would make it possible to store a performance and play it back. Realtime collaboration is a different problem...

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

No branches or pull requests

2 participants