-
Notifications
You must be signed in to change notification settings - Fork 11
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
Instantaneous tempo changes #34
Comments
In theory an event with |
I was thinking more on having e.g. |
Well, You're correct that it's not currently possible, at least through cl-patterns' exported API. The clock keeps track of time by recording the beat and timestamp of the last tempo change (the (defun immediate-tempo-change (new-tempo &optional (clock *clock*))
"Immediately change the tempo of CLOCK to NEW-TEMPO.
Note that this function may stop working in future versions of cl-patterns, after which the following should be used instead:
(play (event :type :tempo :tempo new-tempo :quant 0))"
(let ((beat (beat clock)))
(setf (slot-value clock 'cl-patterns:tempo) new-tempo
(slot-value clock 'cl-patterns::timestamp-at-tempo) (local-time:now)
(slot-value clock 'cl-patterns::beat-at-tempo) beat
(slot-value clock 'beat) beat))) It's possible that this function could result in clock glitches, but just from testing a bit it seems to work. As its docstring says, this function may stop working in the future, once I finish the clock refactor, but after that point just using |
Is it possible to have a new tempo start immediately (restarting/resyncing the clock), instead of only changing on the next beat?
The text was updated successfully, but these errors were encountered: