Package com.softsynth.jmsl
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.
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
-
Field Summary
Fields inherited from class com.softsynth.jmsl.MusicJob
repeatCount
-
Constructor Summary
Constructors Constructor Description MusicList()
-
Method Summary
Modifier and Type Method Description void
add(InstrumentPlayable p)
void
finishAll()
Doesn't contain Composable, so cannot propagate finishAll() to children, just calls finish() on itself insteadInstrumentPlayable
get(int i)
return the InstrumentPlayable at position ijava.util.Vector
getChildren()
double
internalRepeat(double playTime)
Execute all elements in list with instrument.static void
main(java.lang.String[] args)
Add some ad hoc InstrumentPlayable's to a MusicList and play it with the default (printing) Instrument.double
start(double startTime)
open() Instrument and return startTimedouble
stop(double stopTime)
close() Instrument and return stopTimeMethods inherited from class com.softsynth.jmsl.MusicJob
add, addPlayLurker, addRepeatPlayable, addStartPlayable, addStopPlayable, advanceCurrentTime, contains, elements, finish, getChild, getCurrentTime, getDataTranslator, getDuration, getInstrument, getName, getParent, getPlayLurkers, getRepeatCount, getRepeatPause, getRepeatPlayables, getRepeats, getStartDelay, getStartPause, getStartPlayables, getStartTime, getStopDelay, getStopPlayables, getTimeStretch, getTransposition, halt, indexOf, insert, isRunning, launch, launch, play, play, print, printHierarchy, printHierarchy, remove, remove, removeAll, removeAllPlayLurkers, removeAllRepeatPlayables, removeAllStartPlayables, removeAllStopPlayables, removePlayLurker, removeRepeatPlayable, removeStartPlayable, removeStopPlayable, repeat, run, setCurrentTime, setDataTranslator, setDuration, setInstrument, setName, setParent, setRepeatPause, setRepeats, setStartDelay, setStartPause, setStartTime, setStopDelay, setTimeStretch, setTransposition, size, timeStretch, transposition, waitForDone
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MusicList
public MusicList()
-
-
Method Details
-
getChildren
public java.util.Vector getChildren()- Overrides:
getChildren
in classMusicJob
- Returns:
- vector of Playable elements
-
add
-
get
return the InstrumentPlayable at position i -
start
public double start(double startTime) throws java.lang.InterruptedExceptionopen() Instrument and return startTime- Specified by:
start
in interfaceComposable
- Overrides:
start
in classMusicJob
- Returns:
- endTime
- Throws:
java.lang.InterruptedException
- thrown if Thread.interrupt() called.
-
stop
public double stop(double stopTime) throws java.lang.InterruptedExceptionclose() Instrument and return stopTime- Specified by:
stop
in interfaceComposable
- Overrides:
stop
in classMusicJob
- 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 interfaceComposable
- Overrides:
finishAll
in classMusicJob
-
internalRepeat
public double internalRepeat(double playTime) throws java.lang.InterruptedExceptionExecute all elements in list with instrument.- Specified by:
internalRepeat
in interfaceComposable
- Overrides:
internalRepeat
in classMusicJob
- 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.
-