|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.score.transcribe.BeatDivision
public class BeatDivision
This class handles one beat of music events. Is characterized by a BeatDivisionScheme and a beat number on which to start examining note events. Refers to a time signature, a beat in the measure upon which to start, number of divisions (5 for quintuplet, etc), duration of a division (0.20 for 1/16th note quintuplet for example), total error, minimal number of events to be satisfied (for example, reject it if this is a septuplet but only 3 events fall into its grid. Examines events within a beat's time window and scores their error from the division's ideal grid. The events within this measure are prepared for it by MeasureExtractor, which are stored in a MusicShape. MusicShape's absolute durations are already normalized to start at time = 0 = start of measure. If there are no hits starting on this beat in this time span, then if it is not a tuplet, its score is 0, else if it is a tuplet, set its score to worst possible. This ensures that 16th and 32nds get chosen instead of something crazy like 3 triplet rests.
Field Summary | |
---|---|
static double |
TUPLET_REWARD_FACTOR
reward tuplets if all are present, to compete with hogs like 16ths and 32nds |
static double |
WORST_POSSIBLE_SCORE
|
Constructor Summary | |
---|---|
BeatDivision()
|
Method Summary | |
---|---|
void |
calculateScore()
run through *all* events in measure and drop them into a grid that fits this division scheme. |
int |
getBeatNumber()
|
java.util.Vector |
getCollectedTimePoints()
For this BeatDivision, collect the durations of rests following each non-empty timepoint and add these to the timepoint's duration. |
boolean |
getConformToBeat()
tuplets to not conform to beats. |
java.util.Vector |
getIndexes()
|
int |
getNumberOfBeats()
|
int |
getNumberOfDivisions()
|
int |
getNumTimePointsHit()
|
double |
getScore()
|
java.util.Vector |
getTimePoints()
|
double |
getTimeSpan()
|
static void |
main(java.lang.String[] args)
|
java.lang.String |
printTimePoints()
|
void |
setBeatDivisionScheme(BeatDivisionScheme scheme)
|
void |
setBeatNumber(int beatNumber)
|
void |
setMeasure(MusicShape s)
|
void |
setTimeSignature(TimeSignature ts)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double WORST_POSSIBLE_SCORE
public static final double TUPLET_REWARD_FACTOR
Constructor Detail |
---|
public BeatDivision()
Method Detail |
---|
public void setBeatDivisionScheme(BeatDivisionScheme scheme)
public void setTimeSignature(TimeSignature ts)
public void setMeasure(MusicShape s)
public void setBeatNumber(int beatNumber)
public boolean getConformToBeat()
public int getBeatNumber()
public int getNumberOfBeats()
public void calculateScore()
public int getNumTimePointsHit()
public int getNumberOfDivisions()
public double getScore()
public double getTimeSpan()
public java.util.Vector getIndexes()
public java.lang.String printTimePoints()
public java.util.Vector getTimePoints()
public java.util.Vector getCollectedTimePoints()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |