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>

public class SourcePhrase extends Phrase
A source Phrase is a Phrase associated to a source chord symbol and possibly with some client properties.
See Also:
  • Constructor Details

    • SourcePhrase

      public SourcePhrase(int channel, ExtChordSymbol ecs)
    • SourcePhrase

      public SourcePhrase(Phrase p, ExtChordSymbol ecs)
      Build a new SourcePhrase .
      Parameters:
      p -
      ecs -
  • Method Details

    • setClientProperty

      public void setClientProperty(String propName, String propValue)
      Set a client property to this object.
      Parameters:
      propName -
      propValue - If null, this removes the property.
    • getClientProperty

      public String getClientProperty(String propName)
      Get a client property.
      Parameters:
      propName -
      Returns:
      Null if property not set.
    • getSourceChordSymbol

      public ExtChordSymbol 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 class Phrase
      Parameters:
      tester -
      mapper -
      Returns:
    • getUsedDegrees

      public List<Degree> getUsedDegrees()
      Get all the source chord symbol degrees used in this source phrase.
      Returns:
      An ordered list of Degrees.
    • getDestDegrees

      public Map<Degree,Degree> 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.

      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

      public SourcePhrase clone()
      Description copied from class: Phrase
      A deep clone: returned phrase contains clones of the original NoteEvents.
      Overrides:
      clone in class Phrase
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Phrase