Package org.jjazz.phrase.api
Class SourcePhrase
java.lang.Object
org.jjazz.phrase.api.Phrase
org.jjazz.phrase.api.SourcePhrase
- All Implemented Interfaces:
Serializable
,Iterable<NoteEvent>
,Collection<NoteEvent>
,NavigableSet<NoteEvent>
,Set<NoteEvent>
,SortedSet<NoteEvent>
A source Phrase is a Phrase associated to a source chord symbol and possibly with some client properties.
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.jjazz.phrase.api.Phrase
PARENT_NOTE, PROP_NOTES_ADDED, PROP_NOTES_ADDED_ADJUSTING, PROP_NOTES_MOVED, PROP_NOTES_MOVED_ADJUSTING, PROP_NOTES_REMOVED, PROP_NOTES_REMOVED_ADJUSTING, PROP_NOTES_REPLACED, PROP_NOTES_REPLACED_ADJUSTING
-
Constructor Summary
ConstructorDescriptionSourcePhrase
(int channel, ExtChordSymbol ecs) SourcePhrase
(Phrase p, ExtChordSymbol ecs) Build a new SourcePhrase . -
Method Summary
Modifier and TypeMethodDescriptionclone()
A deep clone: returned phrase contains clones of the original NoteEvents.getClientProperty
(String propName) Get a client property.getDestDegrees
(ExtChordSymbol ecsDest, SourcePhrase.ChordMode chordMode) Map each degree of this source phrase (as returned by getUsedDegrees()) to a degree of the specified destination chord symbol.Overridden to return a SourcePhrase.Get all the source chord symbol degrees used in this source phrase.void
setClientProperty
(String propName, String propValue) Set a client property to this object.toString()
Methods inherited from class org.jjazz.phrase.api.Phrase
add, add, add, add, addAll, addAll, addPropertyChangeListener, addUndoableEditListener, ceiling, clear, comparator, contains, containsAll, descendingIterator, descendingSet, dump, equalsNearPosition, first, floor, getBeatRange, getCeilNote, getChannel, getFloorNote, getLastEventPosition, getNotes, getNotes, getProcessedPhrasePitch, getProcessedPhraseVelocity, headSet, headSet, higher, isAdjustingEvent, isDrums, isEmpty, iterator, last, loadAsString, lower, move, move, moveAll, pollFirst, pollLast, processNotes, processPitch, processVelocity, remove, remove, removeAll, removeAll, removePropertyChangeListener, removeUndoableEditListener, replace, replace, replaceAll, retainAll, saveAsString, shiftAllEvents, size, subSet, subSet, subSet, tailSet, tailSet, toArray, toArray
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.SortedSet
spliterator
-
Constructor Details
-
SourcePhrase
-
SourcePhrase
Build a new SourcePhrase .- Parameters:
p
-ecs
-
-
-
Method Details
-
setClientProperty
Set a client property to this object.- Parameters:
propName
-propValue
- If null, this removes the property.
-
getClientProperty
Get a client property.- Parameters:
propName
-- Returns:
- Null if property not set.
-
getSourceChordSymbol
- Returns:
- The chordSymbol associated to this source phrase.
-
getProcessedPhrase
public SourcePhrase getProcessedPhrase(Predicate<NoteEvent> tester, Function<NoteEvent, NoteEvent> mapper) Overridden to return a SourcePhrase.- Overrides:
getProcessedPhrase
in classPhrase
- Parameters:
tester
-mapper
-- Returns:
-
getUsedDegrees
Get all the source chord symbol degrees used in this source phrase.- Returns:
- An ordered list of Degrees.
-
getDestDegrees
Map each degree of this source phrase (as returned by getUsedDegrees()) to a degree of the specified destination chord symbol.If chordMode==false:
Destination degrees are the source phrase degrees fitted to the destination chord symbol.If chordMode==true:
Destination degrees are the first most important notes of the destination chord symbol.
If destination chord symbol is less complex than the source chord symbol(eg C7M=>C) then one or more destination degrees are reused.- Parameters:
ecsDest
- The destination chord symbol.chordMode
-- Returns:
- A map with key="a source chord symbol degree" and value="a destination chord symbol degree".
-
clone
Description copied from class:Phrase
A deep clone: returned phrase contains clones of the original NoteEvents. -
toString
-