com.softsynth.jmsl.score
Class ScoreCollection

java.lang.Object
  extended by com.softsynth.jmsl.MusicJob
      extended by com.softsynth.jmsl.ParallelCollection
          extended by com.softsynth.jmsl.SequentialCollection
              extended by com.softsynth.jmsl.score.ScoreCollection
All Implemented Interfaces:
Composable, Playable, java.lang.Runnable

public class ScoreCollection
extends SequentialCollection

ScoreCollection contains the playable structure of a Score. It is a SequentialCollection of Measure. Measure is a ParallelCollection of Staff. Staff is a ParallelCollection of Track. Track is a PlayableList of Note. Note implements Playable.

Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved

Field Summary
static java.lang.String copyright
           
 
Fields inherited from class com.softsynth.jmsl.MusicJob
repeatCount
 
Constructor Summary
ScoreCollection(Score parent, int numStaffs)
           
 
Method Summary
 Note addInterval(DimensionNameSpace dimensionNameSpace, double[] data)
          add an interval.
 Measure addMeasure()
           
 Measure addMeasure(int tsNumer, int tsDenom)
           
 Note addNote(DimensionNameSpace dimensionNameSpace, double[] data)
           
 Note addNote(double[] data)
           
 Note addNote(double dur, double midipitch, double vel, double hold)
           
 Note addNote(Note note)
          Add Note to current Track of current Staff of current Measure.
 Note addNote(Note n, int measureNum, int staffNum, int trackNum)
           
 void clearLastAddedNote()
           
 void deleteMeasure(Measure measure)
           
 int getCurrentMeasureNumber()
           
 int getCurrentStaffNumber()
           
 Note getLastAddedNote()
           
 Measure getMeasure(int n)
           
 void insertMeasure(Measure measure)
           
 void resetAllRepeats()
           
 void setCurrentMeasureNumber(int m)
          set measure number for adding/editing
 void setCurrentStaffNumber(int s)
          set staff number for adding/editing
 void setCurrentTrackNumber(int t)
          set track number for adding/editing
 double start(double playTime)
          Setup method called once when run() begins.
 
Methods inherited from class com.softsynth.jmsl.SequentialCollection
getBehavior, internalRepeat, main, print, setBehavior
 
Methods inherited from class com.softsynth.jmsl.ParallelCollection
get, halt, printHierarchy, set
 
Methods inherited from class com.softsynth.jmsl.MusicJob
add, addPlayLurker, addRepeatPlayable, addStartPlayable, addStopPlayable, advanceCurrentTime, contains, elements, finish, finishAll, getChild, getChildren, getCurrentTime, getDataTranslator, getDuration, getInstrument, getName, getParent, getPlayLurkers, getRepeatCount, getRepeatPause, getRepeats, getStartDelay, getStartPause, getStartTime, getStopDelay, getTimeStretch, getTransposition, indexOf, insert, isRunning, launch, launch, play, play, 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, stop, timeStretch, transposition, waitForDone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values
Constructor Detail

ScoreCollection

public ScoreCollection(Score parent,
                       int numStaffs)
Method Detail

resetAllRepeats

public void resetAllRepeats()

start

public double start(double playTime)
Description copied from class: MusicJob
Setup method called once when run() begins. Override this for custom setup.

Specified by:
start in interface Composable
Overrides:
start in class MusicJob
Returns:
endTime

addNote

public Note addNote(Note n,
                    int measureNum,
                    int staffNum,
                    int trackNum)

addNote

public Note addNote(double dur,
                    double midipitch,
                    double vel,
                    double hold)

addNote

public Note addNote(double[] data)

addNote

public Note addNote(DimensionNameSpace dimensionNameSpace,
                    double[] data)

addInterval

public Note addInterval(DimensionNameSpace dimensionNameSpace,
                        double[] data)
add an interval.

Returns:
Note for interval added, or null if interval could not be added (either a duplicate or a rest)

addNote

public Note addNote(Note note)
Add Note to current Track of current Staff of current Measure. If there is no more room in the Track, see if there is room on the next Measure's Track. If there is, update the currentMeasureNum and add it there. If there is none, insert a new Measure there.


getLastAddedNote

public Note getLastAddedNote()

clearLastAddedNote

public void clearLastAddedNote()

addMeasure

public Measure addMeasure()

addMeasure

public Measure addMeasure(int tsNumer,
                          int tsDenom)

getMeasure

public Measure getMeasure(int n)

setCurrentMeasureNumber

public void setCurrentMeasureNumber(int m)
set measure number for adding/editing


getCurrentMeasureNumber

public int getCurrentMeasureNumber()
Returns:
current measure number (entry point for adding notes, editing, etc)

setCurrentStaffNumber

public void setCurrentStaffNumber(int s)
set staff number for adding/editing


getCurrentStaffNumber

public int getCurrentStaffNumber()

setCurrentTrackNumber

public void setCurrentTrackNumber(int t)
set track number for adding/editing


deleteMeasure

public void deleteMeasure(Measure measure)

insertMeasure

public void insertMeasure(Measure measure)