Class Measure
Defined in Measure.ts
· maxDuration - =0 Max duration of the measure(determined by time signature)
constructor(maxDuration = 64) get maxDuration(): number[src]Returns the maximum sum of durations for the measure as a number,
where each unit is 1/64 bit.
undefined
get data(): Arrayexternal Array<NormalizedMeasureDatainterface NormalizedMeasureDatanotation/NormalizedMeasureData>[src]Returns the data of the measure - an array of objects where each
object has a set of notes and the duration for those notes.
undefined
get length(): number[src]Returns the number of sixteenth notes in the measure.
undefined
clone(): Measureclass Measurenotation/Measure[src]Returns a deep clone of the measure.
undefined
addNote(): boolean[src]Adds a note to the measure at some position.
· data - undefined
· position - The position in the data to add the note to.
undefined
addNotes(__namedParameters: MeasureDatainterface MeasureDatanotation/MeasureData,
position: number ): boolean[src]Adds notes to the note set at the position.
· notes - An array of raw notes.
· duration - undefined
· position - The position in the data to add the notes to.
undefined
addChord(__namedParameters: MeasureDatainterface MeasureDatanotation/MeasureData,
position: number ): boolean[src]Adds notes to the measure plus a name that represents the chord and is saved in
the data at the position as name
· notes - undefined
· name - undefined
· duration - undefined
· position - undefined
measure.addChord({
notes: ['C3', 'E3', 'G3'],
name: 'C Major',
duration: '4n'
}, 0) // Adds a C major chord at the start of the measure.
deleteNote(note: string, position: number): boolean[src]Delete note at the position.
· note - raw note.
· position - The position in the data to delete the note at.
undefined
deleteNotes(): boolean[src]Deletes notes from the noteset at the position.
· notes - An array of raw notes.
· position - The position in the data to delete the notes at.
undefined
deleteMember(position: number): boolean[src]Delete member from the measure's data - removes all the notes from it
and initializes a new data member with the measure's duration.
· position - Position of the member to delete.
isFull(duration: string): boolean[src]Returns true if the duration has space, else false.
· duration - undefined
undefined
transpose(interval: number): Measureclass Measurenotation/Measure[src]Returns a new measure where all the notes are transposed by the interval.
· interval - Interval to transpose by.
undefined
private initNext(position: number, duration = "4n"): void[src]Creates a slot for the next notes that will be added in the measure if there is space.
Should not be called as it's called automatically when needed.
· position - Position to initialize the next notes to.
· duration - duration to create for the notes
private canInsertToMeasure(): boolean[src]Checks whether a new data member can be added at a certain position in the measure.
· position - The position to check for.
· duration - duration of new notes
undefined