Interface AdaptedRhythm

All Superinterfaces:
Comparable<Rhythm>, Rhythm
All Known Subinterfaces:
YamJJazzAdaptedRhythm

public interface AdaptedRhythm extends Rhythm
A marker interface for a rhythm which is an adapted version of an existing rhythm but for a different time signature.

This is used when there is e.g. a 2/4 bar in a 4/4 song (so with a 4/4 rhythm) and we don't want to have a specific 2/4 rhythm, but just the same 4/4 rhythm truncated to a 2/2 bar.

An AdaptedRhythm should have only RhythmVoiceDelegate instances as RhythmVoices, so that they do not take "Midi channel space" in a song's MidiMix.

  • Field Details

  • Method Details

    • buildUniqueId

      static String buildUniqueId(String rhythmProviderId, Rhythm sourceRhythm, TimeSignature newTs)
      Convenience method to build the UniqueId as required.
      Parameters:
      rhythmProviderId -
      sourceRhythm -
      newTs -
      Returns:
    • buildName

      static String buildName(Rhythm sourceRhythm, TimeSignature newTs)
      Convenience method to build the AdaptedRhythm name in a standard way.
      Parameters:
      sourceRhythm -
      newTs -
      Returns:
    • buildDescription

      static String buildDescription(Rhythm sourceRhythm, TimeSignature newTs)
      Convenience method to build the AdaptedRhythm description in a standard way.
      Parameters:
      sourceRhythm -
      newTs -
      Returns:
    • getSourceRhythm

      Rhythm getSourceRhythm()
      The source rhythm for this object.
      Returns:
      A rhythm with a different time signature than this rhythm.
    • getUniqueId

      String getUniqueId()
      A unique string identifier representing this adapted rhythm.

      As an AdaptedRhythm, the returned id must follow this syntax:
      <RhythmProviderId><RHYTHM_ID_DELIMITER><RhythmId><RHYTHM_ID_DELIMITER><TimeSignature>
      Example: "YamJJazzRhythmProviderID___BossaNova.s25.styID___3/4"
      RhythmId must a valid rhythm id for the rhythm provider identified by RhythmProviderId.

      It will be used by other serialized objects who want to refer this rhythm -typically a Song object. Use buildUniqueId() to make sure you use the right syntax.

      Specified by:
      getUniqueId in interface Rhythm
      Returns:
      See Also: