Class SongChordSequence

All Implemented Interfaces:
Serializable, Cloneable, Comparable<ChordSequence>, Iterable<CLI_ChordSymbol>, Collection<CLI_ChordSymbol>, NavigableSet<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:
    • split

      public <T> List<SongChordSequence.SplitResult<T>> split(Rhythm r, RhythmParameter<T> rp)
      Split this SongChordSequence in different SimpleChordSequences for each song contiguous Rhythm's SongParts which have the same specified RhythmParameter value.

      The resulting SimpleChordSequences will have a starting chord symbol.

      Example:
      Spt0 rpValue=Main A-1 chords=Cm7 F7
      Spt1 rpValue=Main A-1 chords=Bbm7 Eb7
      Spt2 rpValue=Main B-2 chords=F7M Dm7
      Then return 1 chordSequence for Main A-1=Spt0+Spt1="Cm7 F7 Bbm7 Eb7", and 1 chordSequence for Main B-2=Spt2=F7M Dm7

      Type Parameters:
      T - The type of the RhythmParameter value
      Parameters:
      r -
      rp - The Rhythm's RhythmParameter for which we will check the value
      Returns:
      The list of ChordSequences with their respective common rpValue, sorted by startBar.
    • 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.