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

Note Timing Issue in Transcribed MIDI Files #13

Open
haveyouwantto opened this issue May 30, 2023 · 8 comments
Open

Note Timing Issue in Transcribed MIDI Files #13

haveyouwantto opened this issue May 30, 2023 · 8 comments

Comments

@haveyouwantto
Copy link

Hi there. I'm reaching out to report an issue with the latest version of Transkun. Although I'm not an expert in machine learning, I've noticed that when using Transkun to transcribe audio into MIDI files, the notes appear too close together. This results in a short and abrupt sound, regardless of the input audio or MIDI synthesizer used.

As a user, I rely on Transkun to generate accurate and usable MIDI files, so I wanted to bring this problem to your attention. I greatly appreciate your efforts in developing Transkun, and I kindly request your assistance in resolving this note timing issue.

Please let me know if you need any further information from me to address this matter. Thank you for your attention, and I look forward to your prompt response.

@Yujia-Yan
Copy link
Owner

Hi, can you provide some demonstrations like screenshots, audios, midi files, so that I can grab an idea of what the issue is?

@haveyouwantto
Copy link
Author

Sure, here is an example MIDI file transcribed by Transkun that demonstrates this issue. It's worth noting that this effect is more pronounced in MIDI systems with higher latency.
https://file.io/tqs8waOzGcAU

@Yujia-Yan
Copy link
Owner

Yujia-Yan commented May 31, 2023

Hi, I do not hear any abnormality from my piano synthesizer (pianoteq). It maybe implementation dependent. I guess what you are referring to is that certain boundaries of notes are close together? If so, it's a known treatment of all previous papers. They extend all pedal notes to reflect the sounding duration according to the pedal, which often results in very close note boundary. I also followed this to make the results comparable. Is that what you mean?

@haveyouwantto
Copy link
Author

Yes, however, I have tried using other transcription models that do not exhibit this issue. It appears that the problem lies in the close proximity of the note off and note on events in the transcribed MIDI files.

@Yujia-Yan
Copy link
Owner

The code actually uses an unusually large MIDI ticks. I wonder if it is causes the problem for some software. What software are you using?

@haveyouwantto
Copy link
Author

I am using FluidSynth as midi synthesizer

@haveyouwantto
Copy link
Author

Now I am unable to consistently reproduce this bug. There may have been a misunderstanding.

@xavriley
Copy link

I also suspect this is because the resolution transkun is very high (32k - for comparison Logic Pro X uses a resolution of 480). If this causes an issue you can copy the notes to a regular resolution file with PrettyMIDI

import pretty_midi as pm

orig_mid = pm.PrettyMIDI("path_to_transkun.mid")
new_mid = pm.PrettyMIDI(resolution=480)

new_mid.instruments.append(pm.Instrument(0))
for n in orig_mid.notes:
    new_mid.instruments[0].notes.append(n)

new_mid.write("path_to_lower_res_file.mid")

I haven't tested this code but it should work

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

3 participants