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().
Comments
I can reproduce with cf50003262 on Mac OSX.
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.
https://github.com/musescore/MuseScore/pull/1430
Also found and fixed an issue with swing not being honored either if you exported without first listening to the playback.
Oh, btw, pedal does not seem to *import* either. Not sure if it's supposed to or not.
Pedal import from MIDI files is not implemented yet.
Fixed in 0091f23d95
Automatically closed -- issue fixed for 2 weeks with no activity.