Interface Composable

All Superinterfaces:
Playable, java.lang.Runnable
All Known Implementing Classes:
ClockTicker, DimensionNameSpaceEditorTest, FMNoodler, HardCodedMusicJob, Measure, MeasureMetronome, MidiNoteRecorder, MusicJob, MusicList, MusicShape, ParallelCollection, Player, PrintingJob, QueueCollection, SabbathBrideMusicShape, ScoreCollection, SeqGenDemo.SeqJob, SequentialCollection, Staff, TestSamplePitchbend, TextJob, Track

public interface Composable
extends Playable, java.lang.Runnable
Define the interface for Composable objects for JMSL. This interface is central to creating classes that can be placed in JMSL hierarchies. Any object that supports this interface can be placed in a JMSL hierarchy and scheduled.

See MusicJob, ParallelCollection, SequentialCollection, MusicShape, etc
Author:
Phil Burk and Nick Didkovsky
  • Method Summary

    Modifier and Type Method Description
    void finish()
    Finish playing ASAP.
    void finishAll()
    Finish playing ASAP, and tell all children to finish playing ASAP.
    java.lang.String getName()  
    Composable getParent()
    Return composable that is playing this Composable.
    double getTimeStretch()  
    double getTransposition()  
    void halt()
    Stop executing immediately.
    double internalRepeat​(double playTime)
    This will be called N times based on the setRepeat(N) This is overridden internally in JMSL to define classes like SequentialCOllection.
    java.lang.Thread launch​(double time, Composable parent)
    Start executing musical function.
    void printHierarchy​(int level)
    Very helpful printing function: print yourself and print all your children, who in turn print themselves and all THEIR children.
    double repeat​(double playTime)
    This will be called N times based on the setRepeat(N) Override this for custom operation.
    void setName​(java.lang.String name)
    Set name to be used by toString().
    void setTimeStretch​(double timeStretch)
    Set abstract value that can be used to stretch time durations.
    void setTransposition​(double transposition)
    Set abstract value that can be used to transpose pitches.
    double start​(double playTime)
    Setup method called once when run() begins.
    double stop​(double playTime)
    Cleanup method called once when run() ends.
    double timeStretch()  
    double transposition()  
    double waitForDone()
    Block until execution finished.

    Methods inherited from interface com.softsynth.jmsl.Playable

    play

    Methods inherited from interface java.lang.Runnable

    run
  • Method Details

    • finish

      void finish()
      Finish playing ASAP.
    • finishAll

      void finishAll()
      Finish playing ASAP, and tell all children to finish playing ASAP.
    • start

      double start​(double playTime) throws java.lang.InterruptedException
      Setup method called once when run() begins. Override this for custom setup.
      Returns:
      endTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • internalRepeat

      double internalRepeat​(double playTime) throws java.lang.InterruptedException
      This will be called N times based on the setRepeat(N) This is overridden internally in JMSL to define classes like SequentialCOllection.
      Returns:
      stopTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • repeat

      double repeat​(double playTime) throws java.lang.InterruptedException
      This will be called N times based on the setRepeat(N) Override this for custom operation. Called immediately after play() called.
      Returns:
      stopTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • stop

      double stop​(double playTime) throws java.lang.InterruptedException
      Cleanup method called once when run() ends. Override this for custom setup.
      Returns:
      endTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • launch

      java.lang.Thread launch​(double time, Composable parent)
      Start executing musical function. Return immediately.
      Returns:
      Thread for the child context.
    • waitForDone

      double waitForDone() throws java.lang.InterruptedException
      Block until execution finished.
      Returns:
      stopTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • halt

      void halt()
      Stop executing immediately. Halt any children in hierarchy.
    • setName

      void setName​(java.lang.String name)
      Set name to be used by toString().
    • getName

      java.lang.String getName()
      Returns:
      name to be used by toString().
    • printHierarchy

      void printHierarchy​(int level)
      Very helpful printing function: print yourself and print all your children, who in turn print themselves and all THEIR children. Use indenting to show hierarchy.
    • setTimeStretch

      void setTimeStretch​(double timeStretch)
      Set abstract value that can be used to stretch time durations. Values above 1.0 will slow things down.
    • getTimeStretch

      double getTimeStretch()
    • timeStretch

      double timeStretch()
      Returns:
      timeStretch of all parents multiplied together
    • setTransposition

      void setTransposition​(double transposition)
      Set abstract value that can be used to transpose pitches.
    • getTransposition

      double getTransposition()
    • transposition

      double transposition()
      Returns:
      transposition of all parents added together
    • getParent

      Composable getParent()
      Return composable that is playing this Composable.
      Returns:
      composable that is playing this Composable or null.