Record Class CompositeMusicGenerator.DelegateUnit

java.lang.Object
java.lang.Record
org.jjazz.rhythmmusicgeneration.api.CompositeMusicGenerator.DelegateUnit
Record Components:
songPart -
rvBase - The base RhythmVoice
mg - The MusicGenerator delegate
rv - The delegate RhythmVoice to be used by mg.
rpVariationValue - The delegate rhythm's variation to be used by mg. Will be ignored if delegate rhythm does not use the RP_SYS_Variation parameter.
postProcessor - An optional post-processor of the phrase generated by mg. If null no postprocessing is done. For example this can be used to harmonize notes velocities.
Enclosing class:
CompositeMusicGenerator

public static record CompositeMusicGenerator.DelegateUnit(SongPart songPart, RhythmVoice rvBase, MusicGenerator mg, RhythmVoice rv, String rpVariationValue, Consumer<Phrase> postProcessor) extends Record
A delegate unit for a base RhythmVoice in the songPart context.
  • Constructor Details

    • DelegateUnit

      public DelegateUnit(SongPart songPart, RhythmVoice rvBase, MusicGenerator mg, RhythmVoice rv, String rpVariationValue, Consumer<Phrase> postProcessor)
      Creates an instance of a DelegateUnit record class.
      Parameters:
      songPart - the value for the songPart record component
      rvBase - the value for the rvBase record component
      mg - the value for the mg record component
      rv - the value for the rv record component
      rpVariationValue - the value for the rpVariationValue record component
      postProcessor - the value for the postProcessor record component
    • DelegateUnit

      public DelegateUnit(SongPart songPart, RhythmVoice rvBase, MusicGenerator mg, String rpVariationValue)
      Constructor to use when rvBase has no delegate (delegates to itself).
      Parameters:
      songPart -
      rvBase -
      mg -
      rpVariationValue -
  • Method Details

    • getBaseRhythm

      public Rhythm getBaseRhythm()
    • getDelegateRhythm

      public Rhythm getDelegateRhythm()
    • toDebugString

      public String toDebugString()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • songPart

      public SongPart songPart()
      Returns the value of the songPart record component.
      Returns:
      the value of the songPart record component
    • rvBase

      public RhythmVoice rvBase()
      Returns the value of the rvBase record component.
      Returns:
      the value of the rvBase record component
    • mg

      public MusicGenerator mg()
      Returns the value of the mg record component.
      Returns:
      the value of the mg record component
    • rv

      public RhythmVoice rv()
      Returns the value of the rv record component.
      Returns:
      the value of the rv record component
    • rpVariationValue

      public String rpVariationValue()
      Returns the value of the rpVariationValue record component.
      Returns:
      the value of the rpVariationValue record component
    • postProcessor

      public Consumer<Phrase> postProcessor()
      Returns the value of the postProcessor record component.
      Returns:
      the value of the postProcessor record component