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 voidadd(InstrumentPlayable p)voidfinishAll()Doesn't contain Composable, so cannot propagate finishAll() to children, just calls finish() on itself insteadInstrumentPlayableget(int i)return the InstrumentPlayable at position ijava.util.VectorgetChildren()doubleinternalRepeat(double playTime)Execute all elements in list with instrument.static voidmain(java.lang.String[] args)Add some ad hoc InstrumentPlayable's to a MusicList and play it with the default (printing) Instrument.doublestart(double startTime)open() Instrument and return startTimedoublestop(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, waitForDoneMethods 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:
getChildrenin 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:
startin interfaceComposable- Overrides:
startin 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:
stopin interfaceComposable- Overrides:
stopin 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:
finishAllin interfaceComposable- Overrides:
finishAllin classMusicJob
-
internalRepeat
public double internalRepeat(double playTime) throws java.lang.InterruptedExceptionExecute all elements in list with instrument.- Specified by:
internalRepeatin interfaceComposable- Overrides:
internalRepeatin 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.
-