Removing items from only voiceTwo using a Scheme filter

Sometimes you have two voices combined on one staff, but you also want to generate a version for each voice separately. Thus, each voice has all dynamics, articulations, ornaments and markup text assigned. However, when combining them as two voices on the same staff, each voice will print its dynamics, articulations, etc. resulting in them printed twice.

To remove these markups from the second voice, you have two choices:

  1. Remove the corresponding engravers, which created the dynamics, markups, etc.
  2. Filter out the events from the music that describe these dynamics, markups, etc.

While the first approach is well-documented in the documentation, it is unable to remove the fermata from R1-\fermataMarkup, because the same engraver creates both the rest itself and all markup attached to it. Using the second approach, one can also filter out that fermata (which is of type MultiMeasureTextEvent).

The second approach can be easily implemented in Scheme by defining a filter function, that returns false for all events to be removed (e.g., for MultiMeasureTextEvent). This filter function is simply applied to the music of the second voice by the scheme function (music-filter filterfunction music).