Class SongChordSequence
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<ChordSequence>
,Iterable<CLI_ChordSymbol>
,Collection<CLI_ChordSymbol>
,NavigableSet<CLI_ChordSymbol>
,Set<CLI_ChordSymbol>
,SortedSet<CLI_ChordSymbol>
When constructed a SongChordSequence always has a starting chord symbol.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A result of the split method. -
Constructor Summary
ConstructorDescriptionSongChordSequence
(Song song, IntRange barRange) Build a ChordSequence for the specified song, or part of the song. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
fillChordSequence
(ChordSequence cSeq, Song song, IntRange barRange) Fill a ChordSequence with the chord symbols of the specified song (or part of the song).Get the BeatRange of this SongChordSequence.float
getChordDuration
(CLI_ChordSymbol cliCs, TimeSignature ts) Return the duration in natural beats of the specified chord.getSong()
Get the SongParts (whole or partially) included in this SongChordSequence.getSptBarRange
(SongPart spt) Get the intersection between the specified SongPart and the bar range of this ChordSequence.<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.Methods inherited from class org.jjazz.rhythmmusicgeneration.api.ChordSequence
clone, compareTo, equals, getBarRange, getChordSymbol, getFirstAfter, getLastBefore, getRootAscIntervals, hasChordAtBeginning, hashCode, subSequence, toString
Methods inherited from class java.util.TreeSet
add, addAll, ceiling, clear, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSet
Methods inherited from class java.util.AbstractSet
removeAll
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
SongChordSequence
Build a ChordSequence for the specified song, or part of the song.The constructor relies on fillChordSequence() to add the chord symbols, then it makes sure that the created object has a ChordSymbol at beginning.
- Parameters:
song
-barRange
- If null, use the whole song.- Throws:
IllegalArgumentException
- If barRange is not contained in the song.UserErrorGenerationException
- If no chord found to be the 1st chord of the ChordSequence- See Also:
-
-
Method Details
-
getSong
-
getSongParts
Get the SongParts (whole or partially) included in this SongChordSequence.- Returns:
-
getBeatRange
Get the BeatRange of this SongChordSequence.- Returns:
-
getSptBarRange
Get the intersection between the specified SongPart and the bar range of this ChordSequence.- Parameters:
spt
-- Returns:
-
getChordDuration
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
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
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.
-