[JW Lua] Determine whether a tuplet has a bracket or not

Thomas Weber thomas.weber at notengrafik.com
Thu Jul 28 12:59:00 CEST 2016


I don't see a simple built-in method to determine whether a bracket is displayed for a tuplet or not.

Obviously, if FCTuplet's ShapeStyle is not set to TUPLETSHAPE_BRACKET, we won't get a bracket and I'm done.

Otherwise, if BracketMode is set to TUPLETBRACKET_ALWAYS, it is displayed and I'm done.

Otherwise, I need to find out whether there is a beam spanning all the notes.  However, I don't see a built-in method either for that task, so I think I need to iterate over them and make sure

  * neither the first nor the last note are a rest (unless FCMiscDocPrefs' ExtendBeamsOverRests is true)
  * for all but the first entry, BeamBeat is false (for the first entry, it may be either true or false)

If there is no beam spanning all the entries, the bracket is displayed and I'm done.

Otherwise, a bracket is not shown if either

  * the tuplet is placed on the same side as the beam
  * BracketMode is set to TUPLETBRACKET_UNBEAMEDONLY

This feels pretty involved for what feels like it should be a pretty trivial check.  Therefore I'd be interested to learn whether I'm actually missing something.

Thomas




More information about the JWLua mailing list