Class SongChordSequence

All Implemented Interfaces:
Serializable, Cloneable, Comparable<ChordSequence>, Iterable<CLI_ChordSymbol>, Collection<CLI_ChordSymbol>, NavigableSet<CLI_ChordSymbol>, SequencedCollection<CLI_ChordSymbol>, SequencedSet<CLI_ChordSymbol>, Set<CLI_ChordSymbol>, SortedSet<CLI_ChordSymbol>

public class SongChordSequence extends ChordSequence
A ChordSequence built for a song, or a part of a song.

When constructed a SongChordSequence always has a starting chord symbol.

See Also:
  • Constructor Details

  • Method Details

    • getSong

      public Song getSong()
    • getSongParts

      public List<SongPart> getSongParts()
      Get the SongParts (whole or partially) included in this SongChordSequence.
      Returns:
    • getBeatRange

      public FloatRange getBeatRange()
      Get the BeatRange of this SongChordSequence.
      Returns:
    • getSptBarRange

      public IntRange getSptBarRange(SongPart spt)
      Get the intersection between the specified SongPart and the bar range of this ChordSequence.
      Parameters:
      spt -
      Returns:
    • getChordDuration

      public float getChordDuration(CLI_ChordSymbol cliCs, TimeSignature ts)
      Return the duration in natural beats of the specified chord.

      This is the duration until next chord or the end of the SongChordSequence.

      Parameters:
      cliCs -
      ts - The TimeSignature of the section where chordIndex belongs to (a chord symbol can not span on 2 sections).
      Returns:
    • buildSimpleChordSequences

      public List<SimpleChordSequence> buildSimpleChordSequences(Predicate<SongPart> sptTester)
      Build a SimpleChordSequence for each sequence of contiguous SongParts which match the predicate.

      Returned SimpleChordSequences are limited to the bar range of this SongChordSequence.

      Parameters:
      sptTester - All the accepted SongParts must have the same TimeSignature
      Returns:
      An ordered list by bar. Can be empty.
      Throws:
      IllegalArgumentException - If all the accepted SongParts don't have the same TimeSignature
    • fillChordSequence

      public static void fillChordSequence(ChordSequence cSeq, Song song, IntRange barRange)
      Fill a ChordSequence with the chord symbols of the specified song (or part of the song).

      Use the song's SongStructure and ChordLeadSheet, limited to the specified bar range, to fill the specified ChordSequence. Process the alternate chord symbols when relevant.
      Example:
      - ChordLeadSheet: Section B1: bar0=Cm7, bar1=empty Section B2: bar2=Bb bar3=empty
      - SongStructure: B1 B2 B1
      - Range: [bar1; bar5] Method returns: Cm7(bar1), Bb(bar2), Cm7(bar4), empty(bar5)

      Parameters:
      cSeq -
      song -
      barRange - If null, use the whole song.
      Throws:
      IllegalArgumentException - If barRange is not contained in the song.