public class PlayData extends java.lang.Object implements java.lang.Iterable<Bar>
iterator returns a BarIterator which steps to each bar in the correct play sequence. The Bar returns each Part in the bar and also a virtual metronome part.
Part.iterator returns a NoteIterator which steps to each note in the bar in that part. The note returns a midi pitch and start time and duration in ms.
Modifier and Type | Class and Description |
---|---|
static interface |
PlayData.PlayControls |
Modifier and Type | Field and Description |
---|---|
int |
numBars
the number of bars in the score;
|
Constructor and Description |
---|
PlayData(SScore score,
UserTempo userTempo)
construct PlayData
|
PlayData(SScore score,
UserTempo userTempo,
int loopStart,
int loopBack,
int numRepeats)
construct PlayData
|
Modifier and Type | Method and Description |
---|---|
boolean |
createMIDIFile(java.lang.String midiFilePath)
generate a MIDI file from the play data
|
boolean |
createMIDIFileWithControls(java.lang.String midiFilePath,
PlayData.PlayControls controls)
generate a MIDI file from the play data with control of enabled parts
|
protected void |
finalize() |
boolean |
firstBarAnacrusis()
is the first bar an 'up-beat' or anacrusis partial bar?
|
BarIterator |
iterator()
get an iterator to the set of bars in the score.
|
float |
maxSoundDynamic()
get the maximum value of any sound dynamic in any bar.
|
int |
numParts()
get the number of playing parts in the score
|
static void |
scaleMIDIFileTempo(java.lang.String midiFilePath,
float tempoScaling)
scale the tempo in the MIDI file by writing tempo-defining bytes into it
NB This assumes that the file was written by createMIDIFile and by the same version of the SeeScoreLib
|
public PlayData(SScore score, UserTempo userTempo) throws ScoreException
score
- the scoreuserTempo
- an implementation of the UserTempo interface allowing the user eg with a slider
to define the tempo, or tempo scalingScoreException
- on errorpublic PlayData(SScore score, UserTempo userTempo, int loopStart, int loopBack, int numRepeats) throws ScoreException
score
- the scoreuserTempo
- an implementation of the UserTempo interface allowing the user eg with a slider
to define the tempo, or tempo scalingloopStart
- the index of the first bar to play in each looploopBack
- the index of the last bar to play in each loopnumRepeats
- the number of times to repeat the loopScoreException
- on errorpublic BarIterator iterator()
iterator
in interface java.lang.Iterable<Bar>
public int numParts()
public float maxSoundDynamic()
public boolean firstBarAnacrusis()
public boolean createMIDIFile(java.lang.String midiFilePath)
midiFilePath
- the full pathname of the MIDI file to createpublic boolean createMIDIFileWithControls(java.lang.String midiFilePath, PlayData.PlayControls controls)
midiFilePath
- the full pathname of the MIDI file to createcontrols
- define which parts should be output to the filepublic static void scaleMIDIFileTempo(java.lang.String midiFilePath, float tempoScaling)
midiFilePath
- the full pathname of the MIDI filetempoScaling
- the scaling (1.0 is unscaled)protected void finalize()
finalize
in class java.lang.Object