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

getElementsAtTick() #383

Closed
craigsapp opened this issue Dec 11, 2016 · 0 comments
Closed

getElementsAtTick() #383

craigsapp opened this issue Dec 11, 2016 · 0 comments

Comments

@craigsapp
Copy link
Contributor

Related to issue #379, there should be a verovio/js toolkit function called getElementsAtTick(). This would allow the tempo in a MIDI file to be changed after it has been created by the verovio toolkit, but still have it align with the notation (although real-time change of the tempo while the MIDI is performed might be more complicated). Also this would require the MIDI playback device to know what MIDI tick it is currently playing. This should be trivial, since it has to convert this tick value into a time in seconds.

MIDI ticks are similar to score-time, and they remain constant regardless of the tempo. There is a data field in a MIDI file header which specifies how many ticks are in a quarter note, so this is close to the qstamp method I described in issue #379, so the new function could equivalently or alternatively be called getElementsAtQuarterNote() (which would not be MIDI-specific).

This functionality would allow users to change the tempo of a MIDI performance, such as through a tempo slider, and the MIDI file would not have to be recalculated by verovio in order for the audio playback to sync with the MIDI playback.

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

No branches or pull requests

2 participants