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

Misleading midi_tempo parameter in predict_and_save function #152

Open
WangHaoyuuu opened this issue Nov 18, 2024 · 0 comments
Open

Misleading midi_tempo parameter in predict_and_save function #152

WangHaoyuuu opened this issue Nov 18, 2024 · 0 comments

Comments

@WangHaoyuuu
Copy link

WangHaoyuuu commented Nov 18, 2024

Hello,

First, thank you for the incredible work on this tool—it has been invaluable during my workflow. However, I’ve encountered a potential issue that I would like to bring to your attention.

Description of the Issue:
The predict_and_save function includes a midi_tempo parameter, but it seems ineffective in controlling the playback speed of the generated MIDI file.

Current Behavior:
Setting the midi_tempo parameter (e.g., to 120 BPM) does not appear to adjust the playback speed as expected.
The generated MIDI file retains the original timing of the audio via time-value compensation.
As a result, the midi_tempo setting does not influence the playback speed.

Concerns:
This behavior might be confusing for users who expect the midi_tempo parameter to directly control playback speed.
The presence of the parameter suggests that it should perform this function, but it currently does not.
Additionally, there does not seem to be any documentation clarifying this limitation.

Code Context

Upon reviewing the relevant section of the code, it seems that the start_time and end_time values are calculated based on the original timing of the input, independent of the midi_tempo setting:

for start_time, end_time, note_number, amplitude, pitch_bend in note_events_with_pitch_bends:
    instrument = instruments[note_number] if multiple_pitch_bends else instruments[0]
    note = pretty_midi.Note(
        velocity=int(np.round(127 * amplitude)),
        pitch=note_number,
        start=start_time,  # Original time
        end=end_time,      # Original time
    )

I hope this feedback is helpful and would be happy to provide further details if needed. Thank you again for your excellent work!

Best regards,
Haoyu Wang

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

1 participant