Opensheetmusicdisplay: Display Multi-Measure rests

Created on 28 Mar 2019  路  6Comments  路  Source: opensheetmusicdisplay/opensheetmusicdisplay

Added to Vexflow in November 2018 (PR 671).
https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-multiple-rest.htm

Currently, we render these measure for measure, because they are also still given like that in XML.
The starting multi-measure rest bar just has an added attribute:

    <measure number="6" width="0.00">
      <attributes>
        <measure-style>
          <multiple-rest>4</multiple-rest>
          </measure-style>
        </attributes>
      <note>
        <rest/>
        <duration>4</duration>
        <voice>1</voice>
      </note>
    </measure>
  • [ ] TODO: Add Vexflow.MultiMeasureRest to type definitions

Sample:
Multi-Measure-Rest_sample.musicxml.zip

Musescore Rendering:
image

OSMD 0.7 Rendering:
image

This will have a few small challenges like needing to skip creating GraphicalMeasures and incrementing measure number count for measureNumberLabel, but the Vexflow part should be easy.

feature

Most helpful comment

Fixed the measure number label generation.
The problem was that it checked for the measure in exactly that interval (e.g. in 2 measures), which can now be inside a multirest.
Now, it checks whether the measure number is greater or equals the previous label plus the interval.
image

All 6 comments

Done.

Added new OSMD Function Test - Multiple Rest Measures to the demo.

image

I suppose the measure number labels need a change now,
they should be drawn after a multi rest measure if the interval between labels (e.g. every 3 measures) fell into the multi rest measure.

@sschmidTU Yes makes sense to adapt the numbering, but is it really such a coincidence, that no numbering falls on a rendered measure?
Actually measure 9 is rendered in your image for example, but no number is shown - seems some other problem here...

Fixed the measure number label generation.
The problem was that it checked for the measure in exactly that interval (e.g. in 2 measures), which can now be inside a multirest.
Now, it checks whether the measure number is greater or equals the previous label plus the interval.
image

This is awesome! Very nice!!

By the way, you can disable multiple rest measures by setting:

osmd.EngravingRules.RenderMultipleRestMeasures = false;

This will render all rest measures individually.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

npmccallum picture npmccallum  路  5Comments

sschmidTU picture sschmidTU  路  3Comments

MilesMorel picture MilesMorel  路  3Comments

djae88 picture djae88  路  4Comments

conde2 picture conde2  路  4Comments