Hi everyone -

I'm a new MuseScore user and would-be developer. I'm using MuseScore to
annotate some scores for use in a custom program that reads MIDI.
Specifically I'm manually separating the score into musical phrases and want
the start of each phrase to be indicated in the MIDI file.

Right now, as a hack, I'm adding a certain unused note number (e.g. C7 or
whatever, something much higher than any notes in the score) to the chord
for the first note of each phrase. Then, I export MIDI and read MIDI from my
custom program, which I have written to treat C7 as the start of a new
phrase rather than as a real note.

To make this whole thing cleaner, especially as I am planning to use
MuseScore to make other kinds of annotations to be exported to MIDI, I want
to find a way to create MIDI SYSEX messages to indicate phrases starts and
the other annotations. 

From my investigation of the MuseScore source, here's what I've found, which
I want to run by everyone here to make sure I'm on the right track:

-- MidiFile::writeEvent supports writing SYSEX messages (
midi/midifile.cpp:139
<https://github.com/musescore/MuseScore/blob/master/midi/midifile.cpp#L139> 
). (Incidentally, why are there two MidiFile definitions and two
midifile.cpp filess, one in the midi folder, another in the miditools
folder?)

-- However, ExportMidi::write, which invokes MidiFile::write (which leads to
writeEvent being called) only handles ME_NOTEON and ME_CONTROLLER messages (
exportmidi.cpp:287
<https://github.com/musescore/MuseScore/blob/master/mscore/exportmidi.cpp#L287-L306>
 
)

-- That's because it calls Score::createPlayEvents ( exportmidi.cpp:226
<https://github.com/musescore/MuseScore/blob/master/mscore/exportmidi.cpp#L226> 
) to create the play events and simply converts them to MIDI Note On
messages.

-- So to get custom annotations into MIDI, I need to (1) designate a score
symbol other than a special note to indicate the start of a phrase, (2) get
ExportMidi::write to create a meaningful ME_SYSEX MidiEvents for that symbol
before sending the events to MidiFile::write.

Does that sound right? Anything I'm missing or should keep in mind?

Further, to really do this correctly, I should create an actual phrase start
symbol, which would involve adding it to the MuseScore UI and Score data
model (which I don't understand yet). Any pointers on getting my head around
how the MuseScore UI handles the palette of symbols and stores them in the
data model?

Thanks for any help you can offer a MuseScore dev newbie!

--Ien

P.S. By the way, my first impression of both the program and the code is
that this is really a very high quality open-source project. Kind of amazing
that this exists for all.






--
View this message in context: 
http://dev-list.musescore.org/Looking-for-a-reality-check-and-some-pointers-on-some-MuseScore-customizations-tp7579415.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to