public class MetricalLpcfgTreeFactory
extends java.lang.Object
MetricalLpcfgTreeFactory
is a class whose static methods aid in the
creation of MetricalLpcfgTree
s. It cannot be instantiated.Modifier | Constructor and Description |
---|---|
private |
MetricalLpcfgTreeFactory()
Private constructor to ensure that no factory is instantiated.
|
Modifier and Type | Method and Description |
---|---|
private static void |
addNote(MidiNote note,
MetricalLpcfgQuantum[] quantums,
java.util.List<Beat> beats,
int firstBeatIndex,
int lastBeatIndex)
Add the given note into the given quantums array.
|
private static void |
addQuantum(MetricalLpcfgQuantum quantum,
MetricalLpcfgQuantum[] quantums,
int index)
Add the given quatnum into the given index of the given quantums array, if the type overrides that index's
current value.
|
private static MetricalLpcfgNonterminal |
makeBeatNonterminal(MetricalLpcfgQuantum[] quantums,
int subBeatsPerBeat)
Make and return a non-terminal representing a beat.
|
private static MetricalLpcfgNonterminal |
makeSubBeatNonterminal(MetricalLpcfgQuantum[] quantums)
Make and return a non-terminal representing a sub beat.
|
static MetricalLpcfgTree |
makeTree(java.util.List<MidiNote> notes,
java.util.List<Beat> beats,
Measure measure,
int subBeatLength,
int anacrusisLengthSubBeats,
int measureNum)
Make a new tree based on a List of MidiNotes.
|
static MetricalLpcfgTree |
makeTree(MetricalLpcfgQuantum[] quantums,
int beatsPerMeasure,
int subBeatsPerBeat)
Make and return a tree from the given quantums with the given structure.
|
private MetricalLpcfgTreeFactory()
public static MetricalLpcfgTree makeTree(java.util.List<MidiNote> notes, java.util.List<Beat> beats, Measure measure, int subBeatLength, int anacrusisLengthSubBeats, int measureNum)
notes
- A List of the notes which lie within the tree we want.beats
- A List of ALL of the beats of the current song.measure
- The measure type for the tree we will make.subBeatLength
- The sub beat length of the tree we will make.anacrusisLengthSubBeats
- The anacrusis length of the current song, measured in sub beats.measureNum
- The measure number of the tree we want.private static void addNote(MidiNote note, MetricalLpcfgQuantum[] quantums, java.util.List<Beat> beats, int firstBeatIndex, int lastBeatIndex)
note
- The note we want to add into our quantums array.quantums
- The quantums array for tracking the current tree's quantums. This array may be
changed as a result of this call.beats
- A List of ALL of the beats in the current song.firstBeatIndex
- The index of the beat which represents the first quantum in the quantum array.lastBeatIndex
- The index of the beat after the last quantum in the quantum array.private static void addQuantum(MetricalLpcfgQuantum quantum, MetricalLpcfgQuantum[] quantums, int index)
quantum
- The quantum we want to add to the quantums array.quantums
- The quantums array. This array may be changed as a result of this call.index
- The index at which we want to try to insert the given quantum.public static MetricalLpcfgTree makeTree(MetricalLpcfgQuantum[] quantums, int beatsPerMeasure, int subBeatsPerBeat)
quantums
- The quantums which will be contained by this tree, unreduced.beatsPerMeasure
- The beats per measure which should be in this tree.subBeatsPerBeat
- The sub beats per beat which should be in this tree.private static MetricalLpcfgNonterminal makeBeatNonterminal(MetricalLpcfgQuantum[] quantums, int subBeatsPerBeat)
quantums
- The quantums which lie in this non-terminal.subBeatsPerBeat
- The number of sub beats which lie in this non-terminal.private static MetricalLpcfgNonterminal makeSubBeatNonterminal(MetricalLpcfgQuantum[] quantums)
quantums
- The quantums which lie in this non-terminal.