SmoScore is the container for the entire score: staves, measures, notes

### Hierarchy

- SmoScore

## Index

### Constructors

- constructor

### Methods

- addDefaultMeasureWithNotes
- addMeasure
- deleteMeasure
- getPrototypeMeasure
- isMultimeasureRest
- numberStaves
- replaceMeasure
- replaceStaff
- serialize
- serializeColumnMapped
- setNonTransposing
- setTransposing
- updateMeasureFormats
- deserialize
- deserializeColumnMapped
- getDefaultScore
- getEmptyScore
- measureFormatFromLegacyScore
- upConvertLayout

## Constructors

### constructor

- new SmoScore(params: SmoScoreParams): SmoScore

- - Defined in src/smo/data/score.ts:166

  #### Parameters

  - ##### params: SmoScoreParams

  #### Returns SmoScore

## Methods

### addDefaultMeasureWithNotes

- addDefaultMeasureWithNotes(measureIndex: number, parameters: SmoMeasureParams): void

- - Defined in src/smo/data/score.ts:642

  Add a measure to the score with the supplied parameters at the supplied index. The defaults per staff may be different depending on the clef, key of the staff.

  #### Parameters

  - ##### measureIndex: number

  - ##### parameters: SmoMeasureParams

  #### Returns void

### addMeasure

- addMeasure(measureIndex: number): void

- - Defined in src/smo/data/score.ts:692

  Give a measure prototype, create a new measure and add it to each staff, with the correct settings for current time signature/clef.

  #### Parameters

  - ##### measureIndex: number

  #### Returns void

### deleteMeasure

- deleteMeasure(measureIndex: number): void

- - Defined in src/smo/data/score.ts:653

  delete the measure at the supplied index in all the staves

  #### Parameters

  - ##### measureIndex: number

  #### Returns void

### getPrototypeMeasure

- getPrototypeMeasure(measureIndex: number, staffIndex: number): SmoMeasure

- - Defined in src/smo/data/score.ts:671

  get a measure 'compatible' with the measure at the given index, in terms of key, time signature etc.

  #### Parameters

  - ##### measureIndex: number

  - ##### staffIndex: number

  #### Returns SmoMeasure

### isMultimeasureRest

- isMultimeasureRest(measureIndex: number, start: boolean, forceRest: boolean): boolean

- - Defined in src/smo/data/score.ts:595

  determine if the measure at this index could be a multi-measure rest

  #### Parameters

  - ##### measureIndex: number

    the measure index we are considering to add

  - ##### start: boolean

    the measure index would be the start of the rest

  - ##### forceRest: boolean

  #### Returns boolean

### numberStaves

- numberStaves(): void

- - Defined in src/smo/data/score.ts:580

  Iteratively number the staves, like when adding a measure

  #### Returns void

### replaceMeasure

- replaceMeasure(selector: SmoSelector, measure: SmoMeasure): void

- - Defined in src/smo/data/score.ts:719

  Replace the measure at the given location. Probably due to an undo operation or paste.

  #### Parameters

  - ##### selector: SmoSelector

  - ##### measure: SmoMeasure

  #### Returns void

### replaceStaff

- replaceStaff(index: number, staff: SmoSystemStaff): void

- - Defined in src/smo/data/score.ts:766

  Probably due to an undo operation, replace the staff at the given index.

  #### Parameters

  - ##### index: number

  - ##### staff: SmoSystemStaff

  #### Returns void

### serialize

- serialize(): any

- - Defined in src/smo/data/score.ts:345

  Serialize the entire score.

  #### Returns any

  JSON object

### serializeColumnMapped

- serializeColumnMapped(): {}

- - Defined in src/smo/data/score.ts:254

  serialize the keySignature, tempo and time signature, which are mapped to a column at a measure index

  #### Returns {}

### setNonTransposing

- setNonTransposing(): void

- - Defined in src/smo/data/score.ts:812

  If the score is switching from transposing to non-transposing, update the index and pitches. This logic assumes we are changing from transposing to non-transposing.

  #### Returns void

### setTransposing

- setTransposing(): void

- - Defined in src/smo/data/score.ts:796

  If the part is a transposing part, remove the transposition from the notes/staff. This logic assumes the measures previously had transposeIndex set up by the instrument map.

  #### Returns void

### updateMeasureFormats

- updateMeasureFormats(): void

- - Defined in src/smo/data/score.ts:631

  Restore measure formats stored when a score is serialized

  #### Returns void

### Static deserialize

- deserialize(jsonString: any): SmoScore

- - Defined in src/smo/data/score.ts:446

  Deserialize an entire score

  #### Parameters

  - ##### jsonString: any

  #### Returns SmoScore

  SmoScore

### Static deserializeColumnMapped

- deserializeColumnMapped(scoreObj: any): void

- - Defined in src/smo/data/score.ts:294

  Column-mapped attributes stay the same in each measure until changed, like key-signatures. We don't store each measure value to make the files smaller

  #### Parameters

  - ##### scoreObj: any

    the json blob that contains the score data

  #### Returns void

### Static getDefaultScore

- getDefaultScore(scoreDefaults: SmoScoreParams, measureDefaults: null | SmoMeasureParams): SmoScore

- - Defined in src/smo/data/score.ts:553

  Return a default score with no notes or staves

  #### Parameters

  - ##### scoreDefaults: SmoScoreParams

  - ##### measureDefaults: null | SmoMeasureParams

  #### Returns SmoScore

### Static getEmptyScore

- getEmptyScore(scoreDefaults: SmoScoreParams): SmoScore

- - Defined in src/smo/data/score.ts:571

  Return an 'empty' score, with one measure of rests

  #### Parameters

  - ##### scoreDefaults: SmoScoreParams

  #### Returns SmoScore

### Static measureFormatFromLegacyScore

- measureFormatFromLegacyScore(score: SmoScore, jsonObj: any): null | SmoFormattingManager

- - Defined in src/smo/data/score.ts:528

  Convert measure formatting from legacy scores, that had the formatting per measure, to the new way that has a separate formatting object.

  #### Parameters

  - ##### score: SmoScore

  - ##### jsonObj: any

  #### Returns null | SmoFormattingManager

### Static upConvertLayout

- upConvertLayout(jsonObj: any): void

- - Defined in src/smo/data/score.ts:422

  Convert legacy score layout to layoutManager object parameters

  #### Parameters

  - ##### jsonObj: any

  #### Returns void

Generated using TypeDoc