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>
When constructed a SongChordSequence always has a starting chord symbol.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSongChordSequence(Song song, IntRange barRange) Build a ChordSequence for the specified song, or part of the song. -
Method Summary
Modifier and TypeMethodDescriptionbuildSimpleChordSequences(Predicate<SongPart> sptTester) Build a SimpleChordSequence for each sequence of contiguous SongParts which match the predicate.static voidfillChordSequence(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.floatgetChordDuration(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.Methods inherited from class org.jjazz.rhythmmusicgeneration.api.ChordSequence
clone, compareTo, equals, getBarRange, getChordSymbol, getFirstAfter, getLastBefore, getRootAscIntervals, hasChordAtBeginning, hashCode, removeRedundantStandardChords, subSequence, toStringMethods inherited from class java.util.TreeSet
add, addAll, addFirst, addLast, ceiling, clear, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSetMethods inherited from class java.util.AbstractSet
removeAllMethods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArrayMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.NavigableSet
removeFirst, removeLast, reversed
-
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
-
getBeatRange
-
getSptBarRange
-
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:
-
buildSimpleChordSequences
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
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.
-