Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Changing sampler settings on the fly #24

Open
gaearon opened this issue Aug 28, 2016 · 4 comments
Open

Changing sampler settings on the fly #24

gaearon opened this issue Aug 28, 2016 · 4 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Aug 28, 2016

I noticed that when I change sampler settings with props, the changes get applied only after it finishes the current run. I wonder if it’s possible to make it change right away, removing the scheduled beats and scheduling new (remaining) beats according to the new props.

So if I replace 0, 2, 10 with 0, 2, 12 while I’m on 8, I expect 10 to not be played, and 12 to be played.

@kenwheeler
Copy link
Contributor

Hmm. so for that to work right we'd have to reschedule. Right now, the full bars worth of notes are scheduled here https://github.com/FormidableLabs/react-music/blob/master/src/components/sampler.js#L129-L146 . In componentWillReceiveProps, it should probably cancel previously scheduled notes that are still pending, and then reschedule them against the new props. Right?

@gaearon
Copy link
Contributor Author

gaearon commented Aug 28, 2016

That’s what I was thinking.

@kenwheeler
Copy link
Contributor

Word, I'll look into tweaking the existing scheduling so that it's a bit easier to do this sort of thing

@xuezhma
Copy link

xuezhma commented Mar 16, 2017

Any update on this?

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

3 participants