Interface CLI_ChordSymbol

All Superinterfaces:
ChordLeadSheetItem<ExtChordSymbol>, Comparable<ChordLeadSheetItem<?>>, Transferable
All Known Implementing Classes:
CLI_ChordSymbol.ComparableCsItem

public interface CLI_ChordSymbol extends ChordLeadSheetItem<ExtChordSymbol>
A ChordLeadSheetItem which uses ExtChordSymbol objects as data.

  • Field Details

  • Method Details

    • toCLI_ChordSymbol

      static CLI_ChordSymbol toCLI_ChordSymbol(String str, Position defaultPos, ChordLeadSheet cls) throws ParseException
      Return a new CLI_ChordSymbol built from a string.

      Recognized strings:
      "C7" => C7 at pos=defaultPos
      "C7$lydian_b7" => same with lydian_b7 scale
      "C7[2]" => C7 at pos=defaultPos.getBar()/beat 2
      "Cm7[1:2]" => Cm7 at pos=bar 1/beat 2
      "Cm7[1:2]$phrygian" => same with phrygian scale

      NOTES:
      - bar and beat in string position string [bar:beat] must be 1-based.
      - scale name case does not matter. Scale must be compatible with the chord symbol, otherwise it is ignored.

      Parameters:
      str - As produced by toString(CLI_ChordSymbol).
      defaultPos - Used when position data is missing in str.
      cls - The container for this CLI_ChordSymbol. Can be null.
      Returns:
      Throws:
      ParseException
      See Also:
    • toCLI_ChordSymbolsNoPosition

      static List<CLI_ChordSymbol> toCLI_ChordSymbolsNoPosition(String str, TimeSignature ts, ChordLeadSheet cls, int barIndex, boolean swing) throws ParseException
      Analyze a string describing a bar like "C Fm7" and return the list of CLI_ChordSymbols.

      If 1 chord, beat=0.
      If 2 chords, second chord is at the "half" of the bar.
      If 3 chords, second chord is at the "half" of the bar and last one on last beat
      If more chords place them at regular intervals.

      Parameters:
      str -
      ts - Can be null if cls is non-null. If specified and cls is non-null, must be consistent with cls and time signature at barIndex.
      cls - Can be null if ts is non-null.
      barIndex - Must be consistent with cls (if cls is specified)
      swing - If true for example for 3/4 time signature place half-beat chord symbols at 1.666 (5/3) instead of 1.5
      Returns:
      Throws:
      ParseException - When thrown, GetErrorOffset() represents the faulty chord symbol index.
      See Also:
    • toBarString

      static String toBarString(TimeSignature ts, List<? extends CLI_ChordSymbol> items)
      Build a string representing the bar chord symbols.
      This string can be used as input for toCLI_ChordSymbols().
      Parameters:
      ts - The TimeSignature of the bar.
      items - The chord symbols in the bar.
      Returns:
    • toStringNoPosition

      static String toStringNoPosition(List<? extends CLI_ChordSymbol> items)
      A String like "C7 Am7 D"
      Parameters:
      items -
      Returns:
    • toString

      static String toString(CLI_ChordSymbol cli, CLI_ChordSymbol.PositionDisplay pDisplay)
      Return a CLI_ChordSymbol as a string.

      Returned String can be used as an input for toCLI_ChordSymbol().

      Parameters:
      cli -
      pDisplay - Define how position is represented.
      Returns:
      See Also:
    • createItemTo

      static CLI_ChordSymbol createItemTo(Position pos, boolean inclusive)
      Create an item right after the specified position for comparison purposes.

      For the Comparable interface, any item whose position is before (or equal if inclusive is true) to pos will be considered BEFORE the returned item.

      Parameters:
      pos -
      inclusive -
      Returns:
    • createItemTo

      static CLI_ChordSymbol createItemTo(int bar)
      Create an item at the end of the specified bar for comparison purposes.

      For the Comparable interface, any normal item in the bar will be considered BEFORE the returned item.

      Parameters:
      bar -
      Returns:
    • createItemFrom

      static CLI_ChordSymbol createItemFrom(Position pos, boolean inclusive)
      Create an item right before the specified position for comparison purposes.

      For the Comparable interface, any item whose position is after (or equal if inclusive is true) to pos will be considered AFTER the returned item.

      Parameters:
      pos -
      inclusive -
      Returns:
    • createItemFrom

      static CLI_ChordSymbol createItemFrom(int bar)
      Create an item at the beginning of the specified bar for comparison purposes.

      For the Comparable interface, any normal item in the bar will be considered AFTER the returned item.

      Parameters:
      bar -
      Returns: