-
Notifications
You must be signed in to change notification settings - Fork 2
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
Chords with time to generate a midi file #56
Comments
This can be done by creating a There is some example code in this unit test (requires jchord version 0.2.1): https://github.com/jonathangjertsen/jchord/blob/f3a63c949118e9261b761a5145073d12593be006/test/test_5_issues.py In your case the What did you use to extract the chords from audio? Depending on what kind of data it returns, it could be more efficient to use mido directly. |
Thank you for your example. I used MADMOM for extracting the chords. I think I have to individually change the chord names. Anything else you recommend? |
From looking at the documentation for that library, it seems like you could combine the note processor https://madmom.readthedocs.io/en/latest/modules/features/notes.html with the midi utilities https://madmom.readthedocs.io/en/latest/modules/io/midi.html to do the audio-to-midi conversion. |
Yes, exactly. Unfortunately, their chord notations are different than jchord. |
What I was thinking is that it could be possible to just pass the output of the RNNPianoNoteProcessor/NotePeakPickingProcessor into the That said, the only difference seems to be that madmom adds a |
May be.. I will check that. I can share you my code,
|
I got something reasonable by putting that code in a notebook and adding a new cell with this (using some other piano-based audio files): from jchord.progressions import ChordProgression
from jchord.chords import ChordWithRoot, InvalidChord
chord_objects = []
durations = []
for start, stop, name in chords:
name = name.replace(":", "")
try:
chord = ChordWithRoot.from_name(name)
except InvalidChord:
chord = ChordProgression.DUMMY_CHORD
chord_objects.append(chord)
durations.append(stop - start)
ChordProgression(chord_objects).to_midi("out.mid", beats_per_chord=durations) |
That works perfectly. But did you notice a delay(may be half beat) in your case? Too many experiments with code. sorry about that. See the bottom. |
The main issue here seems to be solved, created #71 for the issue with delay in generated midi files |
Hi,
I have a code that extracts the chords from the audio. It returns the following
(Image attached)
I want to recreate a MIDI file based on that information. How can I do that?
Thanks,
Suti
The text was updated successfully, but these errors were encountered: