MUSX Document Model
Loading...
Searching...
No Matches
musx::dom::EntryFrame::TupletInfo Struct Reference

class to track tuplets in the frame More...

#include <Entries.h>

Public Member Functions

 TupletInfo (const std::weak_ptr< const EntryFrame > &parent, const std::shared_ptr< const details::TupletDef > &tup, size_t index, util::Fraction start, bool forVoice2)
 Constructor.
 
bool calcIsTremolo () const
 Calculates if this tuplet represents a tremolo based on the following criteria.
 
bool calcCreatesSingletonRight () const
 Calculates if this tuplet is being used to create a singleton beam to the right.
 
bool calcCreatesSingletonLeft () const
 Calculates if this tuplet is being used to create a singleton beam to the left.
 
bool calcCreatesBeamContinuationRight () const
 Calculates if this tuplet creates a beam continuation over a barline to the right, as created by the Beam Over Barlines plugin.
 
bool calcCreatesBeamContinuationLeft () const
 Calculates if this tuplet creates a beam continuation over a barline to the left, as created by the Beam Over Barlines plugin.
 

Public Attributes

std::shared_ptr< const details::TupletDeftuplet
 the tuplet
 
size_t startIndex
 the index of the first entry in the tuplet
 
size_t endIndex
 the index of the last entry in the tuplet
 
util::Fraction startDura
 the actual duration where the tuplet starts
 
util::Fraction endDura
 the actual duration where the tuplet ends
 
bool voice2
 whether this tuplet is for voice2
 

Detailed Description

class to track tuplets in the frame

Member Function Documentation

◆ calcCreatesBeamContinuationLeft()

bool musx::dom::EntryFrame::TupletInfo::calcCreatesBeamContinuationLeft ( ) const

Calculates if this tuplet creates a beam continuation over a barline to the left, as created by the Beam Over Barlines plugin.

Note
The Beam Over Barlines plugin has poor support for v1/v2. This function detects v1/v2 correctly on the chance that a user may have manually setup v1/v2 the way Beam Over Barlines should have.
Returns
If the function returns true, you can treat the result similarly to the result from calcCreatesSingletonLeft. However, you simply extend a beam from the designated entry to the appropriate entries in the previous measure.

◆ calcCreatesBeamContinuationRight()

bool musx::dom::EntryFrame::TupletInfo::calcCreatesBeamContinuationRight ( ) const

Calculates if this tuplet creates a beam continuation over a barline to the right, as created by the Beam Over Barlines plugin.

Note
The Beam Over Barlines plugin has poor support for v1/v2. This function detects v1/v2 correctly on the chance that a user may have manually setup v1/v2 the way Beam Over Barlines should have.
Returns
If the function returns true, you can treat the result similarly to the result from calcCreatesSingletonRight. However, you simply extend a beam from the designated entry to the appropriate entries in the next measure.

◆ calcCreatesSingletonLeft()

bool musx::dom::EntryFrame::TupletInfo::calcCreatesSingletonLeft ( ) const
inline

Calculates if this tuplet is being used to create a singleton beam to the left.

See comments at calcCreatesSingletonRight.

Returns
True if this tuplet creates a singleton beam to the left. You may handle this as follows.
  • Skip the entry and its tuplet.
  • You can mark the next entry in the same voice as having a singleton beam left, if your application allows it.
  • The current entry with the 0-length tuplet will have its leger lines suppressed and non-visible notehead(s) and stem. Its hidden flag, however, will still be false. (This function guarantees these conditions if it returns true.)

◆ calcCreatesSingletonRight()

bool musx::dom::EntryFrame::TupletInfo::calcCreatesSingletonRight ( ) const
inline

Calculates if this tuplet is being used to create a singleton beam to the right.

Finale has no built-in support for beams on singleton notes. As a workaround, users and (especially) plugins such as Beam Over Barline create singleton beams using a 0-length tuplet and hiding either the tuplet note or its next neighbor, depending on whether the beam goes to the left or the right. You should never encounter a 0-length tuplet encompassing more than one entry, but these functions guarantee this if they return true.

Returns
True if this tuplet creates a singleton beam to the right. You may handle this as follows.
  • The entry with the tuplet is the visible entry to use. You can mark this entry as having a singleton beam right, if your application allows it.
  • Ignore the tuplet on the visible entry. If you need the entry's actual duration in context, its next neighbor in the same voice has the correct value.
  • Ignore the entry's next neighbor in the same voice. It will have its leger lines suppressed and non-visible notehead(s) and stem. Its hidden flag, however, will still be false. (This function guarantees these conditions if it returns true.)

◆ calcIsTremolo()

bool musx::dom::EntryFrame::TupletInfo::calcIsTremolo ( ) const

Calculates if this tuplet represents a tremolo based on the following criteria.

  • the tuplet ratio is a positive integral power of 2.
  • the tuplet contains exactly 2 entries of equal duration and actual duration.
  • the tuplet is invisible.
Note
The TGTools Tremolo plugin always creates beam extensions for both upstem and downstem cases. To detect the type of stem connections for the tremolo, it is recommended to look for either an upstem or a downstem extension. This covers the TGTools plugin as well as any that might have been created by hand. See details::BeamExtension.
Returns
true if the tuplet is a tremolo. If so, use EntryInfoPtr::calcNumberOfBeams on either entry to determine the number of beams. Use details::TupletDef::calcReferenceDuration to get the total length of the tremolo.