Constructor
new ParsedOutputManipulator(mainObj)
Creates a new ParsedOutputManipulator
Parameters:
Name | Type | Description |
---|---|---|
mainObj |
ParsedOutputPackage | The main ParsedOutputPackage object |
- Source:
Methods
getLyricArray(staff, firstMeasureNumber) → {Array.<string>}
Creates a new lyrics array for the given Staff starting the first lyric at the provided measure number
Parameters:
Name | Type | Description |
---|---|---|
staff |
Staff | The Staff object to be accessed |
firstMeasureNumber |
number | The first measure number to access. Note: The index into staff.measures = firstMeasureNumber - 1 |
Returns:
- Type
- Array.<string>
getMeasure(staff, measureIndex) → {Measure}
Gets the Measure object of the provided Staff object at the given index
Parameters:
Name | Type | Description |
---|---|---|
staff |
Staff | The Staff to be serached |
measureIndex |
number | The index of the measure to be accessed |
Returns:
The found Measure or null if not found
- Type
- Measure
getMeasureEnd(trackName, staffNumber) → {number}
Gets the end measure number of the given staff number of the Track with the given name
Parameters:
Name | Type | Description |
---|---|---|
trackName |
string | The name of the Track to be accessed |
staffNumber |
number | The number of the Staff to be accessed. NOTE: This is a number (i.e. index + 1) |
Returns:
The ending measure number
- Type
- number
getMeasureTimeLength(trackName) → {Array.<number>}
Gets an array where the ith index contains the length in seconds of the i+1 Measure of the first Staff of the given Track
Parameters:
Name | Type | Description |
---|---|---|
trackName |
string | The name of the Track to be accessed |
Returns:
A collection of the lengths of each Measure. The ith index contains the length in seconds of the i+1 Measure
- Type
- Array.<number>
getStaff(track, staffIndex) → {Staff}
Gets the Staff object of the provided Track object at the given index
Parameters:
Name | Type | Description |
---|---|---|
track |
Track | The track to be searched |
staffIndex |
number | The index of the staff to be accessed |
- Source:
Returns:
The found Staff object or null if not found
- Type
- Staff
getTrack(trackIndex) → {Track}
Gets the Track object at the provided index from the main AlphaTexStructure object
Parameters:
Name | Type | Description |
---|---|---|
trackIndex |
number | The index to be retrieved |
- Source:
Returns:
The found Track object or null if not found
- Type
- Track
getTrackByName(trackName) → {Track}
Gets the Track object with the given name
Parameters:
Name | Type | Description |
---|---|---|
trackName |
string | Track name to be found |
- Source:
Returns:
The found Track object or null if not found
- Type
- Track
getTrackIndexByName(trackName) → {number}
Gets the index of the Track with the provided track name
Parameters:
Name | Type | Description |
---|---|---|
trackName |
string | The name of the track to be found |
- Source:
Returns:
The index of the track or null if not found
- Type
- number
indexObj(obj, attribute, index) → {object}
Finds the provided index of the provided attribute in the provided object if present
Parameters:
Name | Type | Description |
---|---|---|
obj |
object | The object to be searched. It's expected that obj.attribute is a string[] where attribute is the provided parameter |
attribute |
string | The attribute to be searched in the provided object |
index |
number | The index of the attribute to be retrieved |
- Source:
Returns:
Either the found value of obj[attribute][index] or null
- Type
- object
visitMeasure(staff) → {MeasureTempoAndTSPackage}
Iterates over a Staff collecting an array showing what the tempo of each measure is and the final time signature recorded
Parameters:
Name | Type | Description |
---|---|---|
staff |
Staff | The Staff object to be visited |
Returns:
Tempo data per measure at the latest read time signature.