public class MetricalLpcfgGenerator
extends java.lang.Object
MetricalLpcfgGenerator class will generate and calculate probabilities
for a MetricalLpcfg.| Modifier and Type | Field and Description |
|---|---|
private int |
beatsPerMeasure
The number of beats per measure, used in the
parseSong(JointModel, TimeTracker) method. |
private MetricalLpcfg |
grammar
The grammar which we are building.
|
private int |
notes32PerMeasure
The number of 32nd notes per measure, used in the
parseSong(JointModel, TimeTracker) method. |
private int |
subBeatsPerBeat
The number of subBeats per beat, used in the
parseSong(JointModel, TimeTracker) method. |
| Constructor and Description |
|---|
MetricalLpcfgGenerator()
Create a new default MetricalGrammarGenerator.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addNote(MidiNote note,
java.util.List<Beat> beats,
MetricalLpcfgQuantum[][] quantums,
int[] notes32PerMeasure)
Add the given note into our tracking arrays.
|
private void |
addQuantum(MetricalLpcfgQuantum quantum,
MetricalLpcfgQuantum[][] quantums,
int measure,
int beat,
int notes32PerMeasure)
Add the given quantum into the quantums array.
|
MetricalLpcfg |
getGrammar()
Get the MetricalGrammar we have generated.
|
int |
getTerminalLength()
Get the current terminal length.
|
void |
parseSong(JointModel jm,
TimeTracker tt)
Parse a song, given its JointModel (which has already been run), and its TimeTracker.
|
private void |
updateTimeSignature(TimeSignature timeSig)
Update the time signature tracking fields based on the given TimeSignature..
|
private final MetricalLpcfg grammar
private int beatsPerMeasure
parseSong(JointModel, TimeTracker) method.private int subBeatsPerBeat
parseSong(JointModel, TimeTracker) method.private int notes32PerMeasure
parseSong(JointModel, TimeTracker) method.public MetricalLpcfgGenerator()
public void parseSong(JointModel jm, TimeTracker tt)
jm - The JointModel, which has already been run. We will get the voices and beats from here.tt - The TimeTracker, which will be used to get gold standard beat divisions.private void addNote(MidiNote note, java.util.List<Beat> beats, MetricalLpcfgQuantum[][] quantums, int[] notes32PerMeasure)
note - The note we want to add into the tracking arrays.beats - The beats of the song we are parsing.quantums - The quantums tracking array, indexed first by measure and then by quantum.notes32PerMeasure - The number of quantums per measure for each measure.private void addQuantum(MetricalLpcfgQuantum quantum, MetricalLpcfgQuantum[][] quantums, int measure, int beat, int notes32PerMeasure)
quantum - The quantum we want to add into the array. Should be either ONSET or TIE.quantums - The quantums tracking array, indexed first by measure and then by quantum.measure - The measure at which we want to add the given quantum.beat - The beat at which we want to add the given quantum.notes32PerMeasure - The number of quantums in the given measure of the song.private void updateTimeSignature(TimeSignature timeSig)
timeSig - The new TimeSignature we will use.public int getTerminalLength()
public MetricalLpcfg getGrammar()
grammar