Search results

Types

Classes
Interfaces
Enums
Functions
Type aliases
Constants

Members

Properties
Methods
Getters
Setters
Enum members
Show privates

Other

In this module only

Class Score

Defined in Score.ts

· undefined - =100 The bpm for the score.
· undefined - =[4,4] Time signature for the score.
· undefined - =my_score Name for the score.
· voiceNames - =[] Array with the names of the voices in the score.

Constructor

constructor(__namedParameters: ScorePropsinterface ScorePropsnotation/ScoreProps = {})

Properties

_voices: {[key: string]: Arrayexternal Array<Measureclass Measurenotation/Measure>}[src]

Methods

set name(name: string): void[src]

Set the score's name.

· name - undefined

Throws

InvalidInput
set bpm(bpm: number): void[src]

Set the score's BPM value.

· bpm - undefined

Throws

InvalidInput
get voices(): {[key: string]: Arrayexternal Array<Measureclass Measurenotation/Measure>}[src]

Returns an object with the scores voices.

Returns

undefined
get length(): string[src]

Returns the length of the score as the length if it's longest voice. The format is 'MM:QQ:SS' - Measures:Quarter-notes:Sixteenth-notes

Returns

undefined
static getMeasureSize(timeSignature: Arrayexternal Array<number>): number[src]

Returns the maximum size a measure has, calculated using the time signature.

· timeSignature - undefined

Throws

Error

Returns

undefined
static stringToScore(str: string): Scoreclass Scorenotation/Score[src]
setTimeSignature(timeSignature: [number, number]): void[src]

Set the score's time signature.

· timeSignature - undefined
getVoice(voiceName: string): Arrayexternal Array<Measureclass Measurenotation/Measure> | undefined[src]

Returns the voice with name. If the voice doesn't exist it throws an error.

Throws

InvalidInput

Returns

undefined
· voiceName - undefined
addVoice(
voiceName: string,
voiceData: Arrayexternal Array<Measureclass Measurenotation/Measure> = Arrayexternal Array<never>
): void
[src]

Adds a voice to the score.

· voiceName - The voice's name.
· voiceData - =[] An array of measures.
deleteVoice(voiceName: string): boolean[src]

Deletes a voice from the score.

Throws

Error
· voiceName - The name of the voice to delete.

Returns

undefined
getMeasure(
voiceName: string,
measureIndex: number
): Measureclass Measurenotation/Measure | undefined
[src]

Returns a measure from a voice

· voiceName - The voice name.
· measureIndex - The index of the measure.
addMeasure(
voiceName: string,
__namedParameters: {measure?: Measureclass Measurenotation/Measure, index?: number} = {}
): void
[src]

Add measure to a voice at an index. If no data object is sent it simply adds an empty measure to the end of the voice.

· voiceName - The voice name.
· data - undefined
addNote(
voiceName: string,
measureIndex: number,
position: number,
__namedParameters: {note: string, duration: string}
): boolean
[src]

Add note to measure.

· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· data - undefined

Returns

undefined
addNotes(
voiceName: string,
measureIndex: number,
position: number,
__namedParameters: MeasureDatainterface MeasureDatanotation/MeasureData
): boolean
[src]

Add notes to measure.

· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· data - undefined

Returns

undefined
addChord(
voiceName: string,
measureIndex: number,
position: number,
__namedParameters: MeasureDatainterface MeasureDatanotation/MeasureData
): boolean
[src]

Add chord to measure.

· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· data - undefined

Returns

undefined
addOperation(
operation: keyof Measureclass Measurenotation/Measure,
voiceName: string,
measureIndex: number,
position: number,
data: unknown
): boolean
[src]

Private function to handle addition operations. Should not be called.

· operation - Operation to execute.
· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· data - undefined

Returns

undefined
deleteNote(
voiceName: string,
measureIndex: number,
position: number,
note: string
): boolean
[src]

Delete note from measure.

· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· note - Note to delete.

Returns

undefined
deleteNotes(
voiceName: string,
measureIndex: number,
position: number,
notes: Arrayexternal Array<string>
): boolean
[src]

Delete notes from measure.

· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· notes - Array of notes to delete.

Returns

undefined
deleteOperation(
operation: keyof Measureclass Measurenotation/Measure,
voiceName: string,
measureIndex: number,
position: number,
data: unknown
): boolean
[src]

Private function to handle deletion operations. Should not be called.

· operation - Operation to execute.
· voiceName - The voice name.
· measureIndex - The measure's index.
· position - Position in the measure.
· data - undefined

Returns

undefined
deleteMember(
voiceName: string,
measureIndex: number,
position: number
): boolean
[src]

Deletes

· voiceName - The voice name.
· measureIndex - The measure index.
· position - Position in the measure.

Returns

undefined
clearMeasure(
voiceName: string,
measureIndex: number
): boolean
[src]

Clears a measure.

· voiceName - The voice name.
· measureIndex - The measure index.

Returns

undefined
deleteMeasure(
voiceName: string,
measureIndex: number
): Measureclass Measurenotation/Measure[] | boolean
[src]

Deletes a measure.

· voiceName - The voice name.
· measureIndex - The measure index.

Returns

undefined
cloneMeasure(
voiceName: string,
measureIndex: number
): boolean
[src]

Clones a measure inside a voice and adds the clone next to the original measure.

· voiceName - The voice name.
· measureIndex - The measure index.

Returns

`
transposeMeasure(
voiceName: string,
measureIndex: number,
interval: number
): boolean
[src]

Transpose a measure in one of the voices.

· voiceName - The voice name.
· measureIndex - The measure index.
· interval - The interval to transpose by.

Returns

undefined
transpose(voiceName: string, interval: number): void[src]

Transposes a voice in the score.

· voiceName - The voice name.
· interval - The interval to transpose by.