Importing a midi file and converting texts to chord symbol automatically

• Jun 1, 2022 - 10:33

I'm generating music in another application and importing it into MuseScore through a MIDI export/import.
I'd like to export not only the notes but also Chord Symbols texts.
For now, I'm passing these texts as regular "text" MIDI events.
MuseScore MIDI import interprets those texts as lyrics.
Is it a way to have MS interpreting those texts as Chord Symbol, whether from the MIDI import itself or from generated MIDI export ?


Comments

I guess I'll solved this with a plugin.

Anyway, after some investigations, MuseScore's MIDI import is not 100% correct IMO.
Take the midi file in annex.

It contains 2 kinds of text-related Midi Meta events: "text" events and "lyrics" events :
NegaFix004.jpg
In the example, the "bars!" are text events and the "foo!" are lyricsevents.

First observation:
All the texts are double, and laid out on top of each other (I moved them to make it explicit).

Second observation:
In the import in MuseScore all those texts are considered as "lyrics":
NegaFix002.jpg

Which is clear in the code: the midi imports considers both "text" events and "lyric" events as "lyric" event:

bool isLyricEvent(const MidiEvent& e)
    return e.type() == ME_META && (e.metaType() == META_TEXT
                                   || e.metaType() == META_LYRIC);
}

src/importexport/midi/internal/midiimport/importmidi_lyrics.cpp

This could be an opportunity to let the user decide what to do with the non lyric text events.

Attachment Size
test_export midi.alavolee.mid 373 bytes

In reply to by Jojo-Schmitz

I'm not a specialist of the MIDI format.
MuseScore seems to have the possibility import Chord Symbols from the Yamaha XF format.

This being said, when I spoke about on opportunity, is because the standard MIDI format has 2 texts events. It seems logical that Musescore converts the "Lyric" one into lyrics. But for the "text" one, we could imagine that the user could choose what to do we it. Must those be imported as staff texts, chord symbols, lyrics (as of today), ... ?

Do you still have an unanswered question? Please log in first to post your question.