Add ability to have a different MIDI pitch for drum instrument based on articulation or tremolo

• May 11, 2018 - 13:49
Reported version
2.3
Type
Functional
Severity
S5 - Suggestion
Status
closed
Project

Currently, MuseScore renders articulations for all instruments in two ways: it changes the length of the notes (gate time for staccato) or it changes MIDI velocity (accent for example). These behaviors are currently configurable in instruments.xml at the instrument level.

Unfortunately, a popular way to notate an open hi-hat for drums for example is to use a "open" symbol on top of the note. In this case, MuseScore should use a different MIDI pitch based on this "articulation" instead of changing the velocity or the length of the note. It also common to use accents or stacattos to notate different sound.

In a similar manner, MuseScore renders tremolos by sending several MIDI events. For drums, a possibility to send a single event on a different pitch would be useful.

I would propose to add a new concept of "variants" for a given drum instrument.Currently a drum instrument is defined as a [MIDI pitch + notehead + line] triple. In the drum palette, the user chooses one of this element and that's it.
My proposal is to add one or more variant would be added to this triplet: a variant would have a pitch and an articulation and/or a tremolo. If the user chooses a drum instrument from the palette, it would work exactly the same. If it adds an articulation and/or a tremolo to the chord, MuseScore would then play the matching MIDI pitch defined in the variant.

Questions are :

  • What do we do with articulations defined at the instrument level ? Do we stop rendering them for drums? or Do we render them for drum instrument without variants? Or do we render them only when there is no matching variants for a given tremolo/articulation? At least, for articulations we have control on the instrument in instruments.xml, so we can just keep on rendering them.
  • Same question for tremolos. Unfortunately, tremolos are currently always rendered and this is not modifiable on an instrument basis in instruments.xml.

Comments

What do we do with articulations defined at the instrument level ? Do we stop rendering them for drums? or Do we render them for drum instrument without variants? Or do we render them only when there is no matching variants for a given tremolo/articulation? At least, for articulations we have control on the instrument in instruments.xml, so we can just keep on rendering them.

In the above PR, I chose to not deal with articulation. It will be the responsability of the user when creating instruments.xml to choose suitable values for articulations.

Same question for tremolos. Unfortunately, tremolos are currently always rendered and this is not modifiable on an instrument basis in instruments.xml.

For tremolo, they will be played in the legacy way if all the notes of a chord don't have a variant with a matching tremolo type. Put differently, If one of the notes has one matching variant with a matching tremolo type then the tremolo will not be played in the legacy way.

In reply to by [DELETED] 5

I'm curious if you could make the articulations respond to the articulation properties Channel and midi action. Does midi action mean a different midi channel? These appear if you right click the articulation and select "Articulation Properties..." but I have seen no documentation on this dialog box. I would suggest, in a similar way that you have already done, leave it to the user to define the action and put it in his own palette. I just discovered this box, so I haven't tried anything with it yet.

MIDI Actions are defined at the instrument level in instruments.xml. There was plan in the code to associate them with articulations but the implementation is not complete. That's why we see Channels and MIDI actions in articulation properties.
Currently MIDI action can only trigger CC message on staff text (and it's the most tested feature of MuseScore).

Status (old) patch (code needs review) fixed
Status fixed

Fixed in branch master, commit b8138c1629

fix #272276: Add ability to have a different MIDI pitch for drum instrument based on articulation or tremolo

Quick doc, the above commit adds the ability to define variants in instruments.xml. There is no UI for it right now (and no plan to add one for 2.3).

Let's say you have an open hi-hat defined as follow in instruments.xml

<Drum pitch="42">
   <head>1</head>
   <line>0</line>
   <voice>0</voice>
   <name>Closed Hi-hat</name>
   <stem>1</stem>
</Drum>

You want to adhere to whatever standard that requires "Open hi-hat" to be notated the same but with a "open" articulation marking, but of course played on pitch 46 and not 42. You can now do it by defining it like this.

<Drum pitch="42">
   <head>1</head>
   <line>0</line>
   <voice>0</voice>
   <name>Closed Hi-hat</name>
   <stem>1</stem>  
   <variants>
     <variant pitch="46">
        <articulation>open</articulation>
      <variant>
  </variants>
</Drum>

Valid name for articulations are: staccatissimo, staccato, portato, tenuto, marcato, sforzato, open, closed, harmonic

You also have a sample for roll on hi hat ? And you want two strike tremolo to be played with this sample trigger on midi pitch 47 ? No problem. If you don't mention any variant for tremolo, they will be played the same than in 2.2 by repeating the note several times.

<Drum pitch="42">
   <head>1</head>
   <line>0</line>
   <voice>0</voice>
   <name>Closed Hi-hat</name>
   <stem>1</stem>  
   <variants>
    <variant pitch="46">
        <articulation>open</articulation>
      <variant>
     <variant pitch="47">
        <tremolo>r16</tremolo>
      <variant>
  </variants>
</Drum>

Valid name for tremolos are: r8, r16, r32, r64. Buzz still needs to be implemented. See #256021: Add buzz roll tremolo stem

You can also use one articulation and one tremolo tag for the same variant. It will trigger if the chord has both the tremolo and the articulation.

Status (old) active fixed
Status active fixed

Fixed in branch 2.3, commit 53ce87fb51

fix #272276: Add ability to have a different MIDI pitch for drum instrument based on articulation or tremolo

@LuckyLion, unfortunately, this implementation is only for notehead/line/articulation. We don't have articulations for sticking. We could use staff text and change CC, but staff text (just like articulations) would be a pain to add. I guess sticking would need its own implementation, similar to lyrics...