Class MusicList

java.lang.Object
com.softsynth.jmsl.MusicJob
com.softsynth.jmsl.MusicList
All Implemented Interfaces:
Composable, Playable, java.lang.Runnable
Direct Known Subclasses:
Track

public class MusicList
extends MusicJob
MusicList
A MusicList's children are InstrumentPlayable's. InstrumentPlayables implement public double play(double playTime, Composable parent,Instrument ins)
method which returns an updated playTime (such as playTime + parent.getTimeStretch * duration) A MusicList's Instrument gets handed to each of its children as it enumerates them over time.
Author:
Nick Didkovsky and Phil Burk (C) 1997 Phil Burk and Nick Didkovsky, All Rights Reserved JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.
See Also:
InstrumentPlayable
  • Constructor Details

    • MusicList

      public MusicList()
  • Method Details

    • getChildren

      public java.util.Vector getChildren()
      Overrides:
      getChildren in class MusicJob
      Returns:
      vector of Playable elements
    • add

      public void add​(InstrumentPlayable p)
    • get

      public InstrumentPlayable get​(int i)
      return the InstrumentPlayable at position i
    • start

      public double start​(double startTime) throws java.lang.InterruptedException
      open() Instrument and return startTime
      Specified by:
      start in interface Composable
      Overrides:
      start in class MusicJob
      Returns:
      endTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • stop

      public double stop​(double stopTime) throws java.lang.InterruptedException
      close() Instrument and return stopTime
      Specified by:
      stop in interface Composable
      Overrides:
      stop in class MusicJob
      Returns:
      endTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • finishAll

      public void finishAll()
      Doesn't contain Composable, so cannot propagate finishAll() to children, just calls finish() on itself instead
      Specified by:
      finishAll in interface Composable
      Overrides:
      finishAll in class MusicJob
    • internalRepeat

      public double internalRepeat​(double playTime) throws java.lang.InterruptedException
      Execute all elements in list with instrument.
      Specified by:
      internalRepeat in interface Composable
      Overrides:
      internalRepeat in class MusicJob
      Returns:
      stopTime
      Throws:
      java.lang.InterruptedException - thrown if Thread.interrupt() called.
    • main

      public static void main​(java.lang.String[] args)
      Add some ad hoc InstrumentPlayable's to a MusicList and play it with the default (printing) Instrument.