-
Notifications
You must be signed in to change notification settings - Fork 151
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
User-defined file loading #201
base: main
Are you sure you want to change the base?
Conversation
…rol over how mido loads the MIDI file.
I support this PR (assuming conflicts can be resolved in a straightforward way)! This is an extremely convenient way to implement stuff like changing the midi file tempo which appears to be quite complicated to do within the pretty-midi domain. |
Not sure how I missed this but thanks for flagging it @a-pillay . My only suggestion is just to provide a new argument rather than overloading midi_file since this certainly isn't a "midi file" when it's a mido object. |
Then you run into the trouble of having to check that both arguments weren't passed in. |
I wouldn't call that trouble - it's a single if statement, and adding a single if statement is better than making an argument's meaning ambiguous, because the arguments are user-facing. |
@a-pillay feel free to pick up this PR if you have time. |
Sure, I can take a look at it. To summarize, this change would involve:
Could you please confirm this logic before we implement the same? |
Yes, that would be fine. I don't think the order of the blocks is terribly important as long as all cases are handled. |
I have created #241 to implement this feature. |
Allow passing in a loaded mido object to allow more fine-grained control over how mido loads the MIDI file.