Pedal marks do not export to MIDI

• Nov 1, 2014 - 19:58
Type
Functional
Severity
S4 - Minor
Status
closed
Project

The pedal marks do not export to MIDI in MuseScore 2.0.


Comments

In Score::renderMidi() - which is called for playback but *not* for export - we call Score::renderStaff() for each staff. That gives us note events only. There is then a separate pass through the measure list to produce the metronome tick events and then another pass through the spanner map to add the pedal events.

For export, we don't use Score::renderMidi. Instead, we use ExportMidi::write(). I guess this to happen to get port channel & stuff right. But we don't currently do the separate pass to collect pedal events.

While I assume we could solve this by duplicating the pedal code from Score::renderMidi() to ExportMidi::write(), I'm not crazy about that idea. I think it makes more sense to re-factor things. So I propose adding Score::renderControllers to collect pedal events (named a bit more generically in hopes that someday we can add volume / legato controller events here) and call that from both Score::renderMidi() and ExportMidi::write().

I'll try that and if it works, I'll submit a PR.