Section Tempo
Tempo utility functions
- See
- Dynamic
Summary
Return type | Function and summary |
---|---|
DeleteAllTargets(Score score, bool preserveScore) Delete all targets from a score. | |
Collection | GetDynamicsThatApplyToStaff(Score score, Staff staff) Get all Dynamic that apply to the specified staff. |
number, int, Dynamic | GetTempoAtTime(Score score, int time) Get tempo value and its Dynamic object (if applicable) at specified time of the score |
bool | SortTargets(Score score) Sort the targets by bar number. |
Functions
DeleteAllTargets(Score score, bool preserveScore)
Delete all targets from a score.
Parameter | Type | Default | Description |
---|---|---|---|
score | Score | ||
preserveScore | bool | false | Preserve an undo? |
SortTargets(Score score)
Sort the targets by bar number.
Targets may be sorted by creation date in your score, if the last inserted is B between A and C, order is A, C, B. Thiis function sorts by deleting and recreating targets as A, B, C.
Parameter | Type | Default | Description |
---|---|---|---|
score | Score |
- Return
- bool: false if no sort was needed, true if sort was done.
- Usage
SortTargets(FrontScore())
GetTempoAtTime(Score score, int time)
Get tempo value and its Dynamic
object (if applicable) at specified time of the score
Parameter | Type | Default | Description |
---|---|---|---|
score | Score | ||
time | int | Symbol.Time , Score.TimeBeginSelection |
- Returns
- number: Tempo value (floatting point number)
- int: Reference note length,
DURATION_QUARTER
for general tempo - Dynamic: nil if no tempo was added to the score, i.e. the returned value is general tempo
- Error
- if score is nil
GetDynamicsThatApplyToStaff(Score score, Staff staff)
Get all Dynamic
that apply to the specified staff.
Dynamics are:
- velocity changes (crescendo, descrendo, pppp to fff)
- Tempo change
- Pedal on/off
- Ottava
- Return
- Collection: of Dynamics that apply to staff are on attached to it, or one of merged staves with it, or one of the staves of the contain group, or to the whole score.
- Error
- if score or staff are nil
- See
- DYNAMIC_* constants in MSDefine
- Dynamic.Type