Interface SongPart

All Superinterfaces:
Transferable

public interface SongPart extends Transferable
A song part defines how a rhythm is played for a number of bars starting at startBarIndex.

Rhythm generation is controlled by the RhythmParameters values. Rhythm can not be changed but a SongPart can be cloned using a new rhythm.

  • Field Details

    • PROP_RP_VALUE

      static final String PROP_RP_VALUE
      Fired when a rhythm parameter value has changed.

      Occurs when value was replaced by another value (for immutable values), or value state has changed (for RpMutableValue instances).

      oldValue=rhythm parameter, newValue=value.

      See Also:
    • PROP_RP_MUTABLE_VALUE

      static final String PROP_RP_MUTABLE_VALUE
      Fired when a mutable value has changed (in addition to the PROP_RP_VALUE change event).

      Occurs when the value state of a RpMutableValue instance has changed.

      oldValue=rhythm parameter, newValue=value.

      See Also:
    • PROP_START_BAR_INDEX

      static final String PROP_START_BAR_INDEX
      See Also:
    • PROP_NB_BARS

      static final String PROP_NB_BARS
      See Also:
    • PROP_NAME

      static final String PROP_NAME
      See Also:
    • DATA_FLAVOR

      static final DataFlavor DATA_FLAVOR
  • Method Details

    • getStartBarIndex

      int getStartBarIndex()
    • getNbBars

      int getNbBars()
      The size of the song part in bars (same as the parentSection size).
      Returns:
    • getBarRange

      default IntRange getBarRange()
      Convenience method.
      Returns:
      The range [getStartBarIndex(); getStartBarIndex()+getNbBars()-1]
    • getName

      String getName()
      By default set to the parentSection's name
      Returns:
    • getParentSection

      CLI_Section getParentSection()
      An optional CLI_Section associated to this SongPart.
      Returns:
    • getRPValue

      <T> T getRPValue(RhythmParameter<T> rp)
      Get the RhythmParameter value.
      Type Parameters:
      T -
      Parameters:
      rp -
      Returns:
      the java.lang.Object
    • getRhythm

      Rhythm getRhythm()
    • getContainer

      SongStructure getContainer()
      Returns:
      The SongStructure this object belong to. Set by SongStructure when the SongPart is added.
    • getClientProperties

      StringProperties getClientProperties()
    • clone

      SongPart clone(Rhythm r, int startBarIndex, int nbBars, CLI_Section parentSection)
      Create a new SongPart with same name based on this object.

      Parameters of the new SongPart can be adjusted.
      If using a different rhythm, try to adapt the value of compatible RhythmParameters.

      Parameters:
      r - The new Rhythm to be used. If null Rhythm is unchanged.
      startBarIndex - The startBarIndex of the new SongPart
      nbBars - The nbBars of the new SongPart
      parentSection - The parentSection of the new SongPart. TimeSignature must match the specified rhythm. Can be null.
      Returns:
      A new SongPart.
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener l)
    • removePropertyChangeListener

      void removePropertyChangeListener(PropertyChangeListener l)