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

Setting BPM on a Midi object #93

Closed
felixturner opened this issue Dec 20, 2019 · 2 comments
Closed

Setting BPM on a Midi object #93

felixturner opened this issue Dec 20, 2019 · 2 comments

Comments

@felixturner
Copy link

When I load a midi file, the BPM is assumed to be 120. If the actual BPM is not 120, the generated time values are incorrect. Is there a way to set the BPM on the generated midi object?

(Note: I don't have the entire Tone lib installed for this project, just '@tonejs/midi')

thanks for Tone.js!

@felixturner
Copy link
Author

felixturner commented Dec 20, 2019

figured it out:

midi = await Midi.fromUrl(path);
midi.header.setTempo(124);

might be worth adding to the docs?

@braebo
Copy link

braebo commented Nov 30, 2022

Been stuck for 2 days and this just saved me. Thank you!!

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