Templates should recreate MIDI channel assignments when used

• May 23, 2020 - 01:19

Hi,
When I create a score or template (in my case for e.g. an orchestral score), I can set the MIDI channels in the mixer.
When I reopen a saved score, the MIDI channels are indeed preserved; this is good.
However, when I create a new score from a template that I created (with MIDI channels specifically assigned), that new score will not have the MIDI channels set to the previously assigned channels.
In my view, this is unexpected behaviour, as one of the ideas of templates is to have a pre-set, empty score, with all instruments working as expected.
When using the built-in synthesizer, it probably won't matter (as instrument definitions are preserved, regardless of MIDI channel), but if one wants to use external audio, e.g. by using LoopMIDI, with audio playing through e.g. Reaper, then this is a major annoyance, as all MIDI channels in MuseScore will have to be checked and amended after creating a new score.
Would it be possible to use the MIDI channels, as stored in the template, when creating a new score from them?
Kind regards :)
Matt.


Comments

Just thought I'd put some info here in case this gets looked at in the future as audio triggering capabilities are extended.

instruments.xml is probably the easiest place to put this, but it would have to be put there manually.

instruments.xml is clearly laid out for General MIDI, which is great for getting something simple outputting, but GM is completely useless for triggering anything more elaborate (VSTs, etc).

For example (had to put all the xml stuff in a pdf, not sure if there's a code bracket in the forum):
musescoreInstruments.pdf

Using those midi values for Mixer settings would be useful. Of course this doesn't fix the issue of MIDI settings not being saved in the template, but this might be an easy implementation and allows configuration (even though it's not easily alterable). Since it's possible to dynamically load an instruments.xml file in preferences, people would at least have the option of saving different customized setups and loading them up. I like the idea of having the MIDI configuration in a readable xml format, so that extending it would be possible. I'd like to write a script that would search for the instrument names and articulations and automatically make the various MIDI connections to a DAW, maybe even automatically create the tracks in a DAW.

If saving the midi configuration in a template is desired, musescore might need to save the instruments.xml along with the score settings.
Maybe instruments.xml could be appended to score settings, and allow the user to override it by instruments.xml that's listed in preferences?

For what it's worth.

edit: One last note, I'm fairly sure that adding an instrument to a score always has the settings that were present at the time of adding. I think that if you change the instruments.xml after an instrument has been added to the score, the instrument won't take on the new properties. That might have implications of trying to use instruments.xml as saving setup configuration. I'm not sure if that means that a portion of instruments.xml is saved in the score settings? If so, maybe that would solve the template problem of not saving MIDI settings if it's contained in instruments.xml?

In reply to by oscarcar

You can put xml code inside <xml>...</xml> tags

Like this (from your PDF):


Just thought I'd put some info here in case this gets looked at in the future as audio triggering
capabilities are extended.
instruments.xml is probably the easiest place to put this, but it would have to be put there manually.
instruments.xml is clearly laid out for General MIDI, which is great for getting something simple
outputting, but GM is completely useless for triggering anything more elaborate (VSTs, etc).
For example:

 <Instrument id="violins">
 <family>orchestral-strings</family>
 <longName>Violins</longName>
 <shortName>Vlns.</shortName>
 <description>Violins</description>
 <musicXMLid>strings.group</musicXMLid>
 <clef>G</clef>
 <barlineSpan>1</barlineSpan>
 <aPitchRange>55-88</aPitchRange>
 <pPitchRange>55-103</pPitchRange>
 <Channel name="arco">
 <controller ctrl="32" value="21"/> <!--Violins Fast Expr.-->. 
 <program value="48"/> <!--String Ensemble 1-->
 </Channel>
 <Channel name="pizzicato">
 <controller ctrl="32" value="20"/> <!--Violins Pizzicato-->. 
 <program value="45"/> <!--Pizzicato Strings-->
 </Channel>
 <Channel name="tremolo">
 <controller ctrl="32" value="21"/> <!--Violins Tremolo Expr.-->. 
 <program value="44"/> <!--Tremolo Strings-->
 </Channel>
 <genre>orchestra</genre>
 </Instrument>

What you could do is something like this snippet:

 <Channel name="pizzicato">
 <gm midi>
 <controller ctrl="32" value="20"/> <!--Violins Pizzicato-->. 
 <program value="45"/> <!--Pizzicato Strings-->
 </gm midi>
 <midi>
 <port value="16"/>
 <channel value="16"/>
 </midi>
 </Channel>

Using those <midi> values for Mixer settings would be useful. Of course this doesn't fix the issue of
MIDI settings not being saved in the template, but this might be an easy implementation and allows
configuration (even though it's not easily alterable). Since it's possible to dynamically load an
instruments.xml file in preferences, people would at least have the option of saving different
customized setups and loading them up. I like the idea of having the MIDI configuration in a readable
xml format, so that extending it would be possible. I'd like to write a script that would search for the
instrument names and articulations and automatically make the various MIDI connections to a DAW,
maybe even automatically create the tracks in a DAW.
If saving in a template is desired, musescore might need to save the instruments.xml along with the
score settings.
Maybe instruments.xml could be appended to score settings, and allow the user to override it by
instruments.xml that's listed in preferences.

In reply to by Jojo-Schmitz

Thanks for the tip. I'll try it out since I realize it probably would be better to have GM nested within MIDI, since likely the GM is a subset. Actually I'm not sure what makes most sense for extensibility. Right now, GM is sent thru the MIDI device that is assigned in Preferences IO setting, which can be PortAudio, ALSA MIDI, or JACK MIDI.

 <Channel name="pizzicato">
 <midi>
 <port value="16"/>
 <channel value="16"/>
 <gm>
 <controller ctrl="32" value="20"/> <!--Violins Pizzicato-->. 
 <program value="45"/> <!--Pizzicato Strings-->
 </gm>
 </midi>
 </Channel>

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