OpenSheetMusicDisplay
    Preparing search index...

    Class GraphicalMusicSheet

    The graphical counterpart of a [[MusicSheet]]

    Index

    Constructors

    Properties

    Accessors

    Methods

    • Returns nearest object of type T near clickPosition. E.g. GetNearestObject(pos, GraphicalMeasure) returns the nearest measure. Note that there is also GetNearestStaffEntry(), which has a bit more specific code for staff entries.

      Type Parameters

      Parameters

      • clickPosition: PointF2D
      • classOrName: string | ClassType<T>

        The class of the object, e.g. GraphicalMeasure. Or its name (e.g. GraphicalMeasure.name), which is unreliable in minified builds: they can give other classes the same name, e.g. GraphicalNote (see AClassHierarchyTrackable.isInstanceOfClass()).

      • Optionalpage: GraphicalMusicPage

        The page to search, e.g. the one clicked on: each page has its own coordinates, so the position is on every page. By default, all pages.

      Returns T

    • Returns the index of the closest next (later) vertical container which has at least some visible staff entry, with respect to the given index.

      Parameters

      • index: number

      Returns number

    • Returns the index of the closest previous (earlier) vertical container which has at least some visible staff entry, with respect to the given index.

      Parameters

      • index: number

      Returns number

    • Get a List with the indices of all the visible GraphicalMeasures and calculates their corresponding indices in the first SourceMeasure, taking into account Instruments with multiple Staves.

      Parameters

      Returns number[]

    • Whether a staff entry's x position is a reliable anchor for mapping a timestamp to an x position (cursor positioning during playback, see calculateXPositionFromTimestamp). Two kinds of entries are excluded:

      • Entries without any graphical notes, e.g. staff entries only carrying a chord symbol (MusicXML harmony). These are never positioned by the layout (their relative x stays at the measure's left border regardless of their timestamp), so using them as anchors makes the cursor jump backwards to the measure start (e.g. chord symbols above a centered whole rest).
      • Entries positioned outside their measure's horizontal bounds. These occur when a note was never actually formatted/laid out (e.g. rests in some tablature edge cases) and carry meaningless coordinates.

      Parameters

      Returns boolean