Breath control in MuseScore midi scores

• Dec 20, 2022 - 09:02

I am now trying to use Musescore 4 with virtual organs.
Organs do not use CC2 (breath control) or midi velocity for controlling note loudness.
I managed to persuade Musescore 3 to generate CC11's in place of CC2's however I can find now way to do this in Musescore 4. Is it possible? And if so how?
csw900


Comments

The playback engine of MS4 no longer uses MIDI internally.

According to the announcement video there are plans to bring back a bunch of automation and other controls in future updates.

In reply to by jeetee

Thanks, but it still uses midi internally and can still export a very useful and playable midi file. It can also output midi via its I/O port - also a very useful feature which is implemented much better in Version 4 than it was in Version 3.

I have just tested this I/O output and have discovered it is outputting CC11's rather than CC2's. This may be because I have an organ playing. What a pity it uses only midi channel 1 - It would be able to play an organ properly if it used channels 1,2 and 3. What a missed opportunity!!

I have also noticed it is outputting frequent "pitch bend" events. These ought to be suppressed as an organ never uses them. Presumably used for tremolo in some other instruments.

csw900

In reply to by csw900

> "Thanks, but it still uses midi internally"
But it doesn't... go check the code for the playback event system. Getting away from the limits of MIDI internally was one the big reasons for this version and the major refactoring it had..

In reply to by jeetee

I think you should say "It doesn't NECESSARILY use midi for PLAYBACK". I am using Musescore 4 on windows and have not installed your "Hub" or any other accessories.
Looking at the Mixer it says it is using "Ms Basic" output (with no other option) which I assume is the GM synth built in to windows. This synth has a midi input. It also says it is playing a "Pipe Organ" which actually sounds nothing like a real pipe organ would.
Don't you think it would be a good idea to make some minor changes (As I suggested above) so it could play a real organ?
csw900

In reply to by csw900

No, I shouldn't. This is what a big part of the MS4 refactoring was about. Prior versions used MIDI internally as the base for all playback. Since MuseScore 4 this is not longer so, the internal playback information is no longer MIDI.
There is an additional translation phase from that data into MIDI for those interfaces that would need it, but at the core, it no longer is MIDI.

MS Basic is not the GM synth from Windows, it is the name of the default SoundFont (sf3 format) that comes with MuseScore. The soundfont is rendered by an internal synthesizer. (for which I'm not sure anymore if it still is FluidSynth or if it was a rewrite as well) and yes, that one probably still uses the MIDI translation to receive its instructions.

The reason why this matters is that "just adding additional CCs" is not something that makes sense in the new playback events, because CCs don't really exist there currently.
As mentioned in my initial reply; yes there are plans to bring back a system that will allow controlling these things in the future. But the change is not "minor"; first the internal format needs a way of representing and interpreting that information; not just for MIDI, but also for the Muse Sounds interface. Then a translation into MIDI CCs needs to happen for those interfaces that use that. And of course a decently usable UI for configuring it all.

Side remark on the Hub: it's not mine, I'm just a normal user and occasional contributor to the MuseScore software itself.

In reply to by jeetee

Thanks - Very interesting!! We are now getting somewhere and I am learning a lot of details.
It is using fluidsynth-2.1.4 with no easy possibility of using anything else.
CC's must exist because they are being output in exported midi files and in the live midi output.
The Windows version of Musescore 4 may have an internal information format that is not midi but this format is being converted into midi by the "translation phase" and this must be what is being fed to fluidsynth. Do you know the .cpp name/s of the translator - This is not immediately findable in the code. Is ther a configuration file that could be patched to fine control the midi output details?
csw900

In reply to by csw900

There is no doubt nor discussion about whether MuseScore can output CC information. The thing you're asking for is making the internal information interpretation as such that additional CCs might be generated. I doubt patching just the translator logic without expanding/fixing the internal information will turn out to be feasible, but feel free to try; this is open source after all.

I don't know where the exact translation happens, but I'd start by looking either into src\playback\playbackcontroller which might aid at finding out where the generation of MIDI happens or how MIDI out links into this. Another possible approach is to look at the export module for MIDI (files), which likely calls upon the same translation-logic to create its data.

In reply to by jeetee

Thanls but you have misunderstood what I am after. The existing CC's already provide what an organ needs to control its volume - I have tested this and the results are perfectly satisfactory. All that is needed is to reliably output them as CC11 and not CC2 for midi file output.
The other need is for the organ to use a separate midi channel for each stave. This applies to both midi file output and the live midi output. This can currently be overcome by editing the midi file before playing it. BUT this is IMPOSSIBLE to overcome on the live midi output - making it useless for organs.
I suspect that both problems could be overcome by telling MS that three different instruments are playing, rather than one organ - but this would be an untidy method.
I will follow your suggestions above and try to find the translation module/s.
csw900

In reply to by csw900

I have now found where the CC values for midi file export are defined:
src/engraving/compat/midi/midicoreevent.h
CTRL_VOLUME = 07
CTRL_BREATH = 02 (This need top be changed to =11 for organs)
There is no reference to CTRL_EXPRESSION = 11

Thus all are fixed at compile time and can be changed only by recompiling.

CC values for the live midi output are defined in:
src/framework/midi/miditypes.h
EXPRESSION_CONTROLLER = 11

Thus this is fixed (for some reason correctly) at compile time with no other means to change it.

I have been unable to find any means to change the midi channels of either exported or live midi output other than by adding (I think they call it!!) additional parts.

Thus I conclude that Musescore 4 currently has no value to an organist whether player or composer.

csw900

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