Section Dynamics

Dynamics utility functions

See
Dynamic

Summary

Return typeFunction and summary
booleanDynamicIsOttava(Dynamic dynamic)
Is dynamic an ottava (8va, 8vb, 15va or 15vb)?
booleanDynamicIsPedal(Dynamic dynamic)
Is dynamic an pedal (Ped.
booleanDynamicIsTempo(Dynamic dynamic)
Is dynamic a Tempo?
booleanDynamicIsVelocity(Dynamic dynamic)
Is dynamic a velocity (power) change?
booleanEnsureObjectInStaffArea(Score score, Staff staff, obj)
Ensure an object is in the Staff area, move it vertically if needed.
CollectionGetDynamicsThatApplyToStaff(Score score, Staff staff)
Get all Dynamic that apply to the specified Staff.
number, int, DynamicGetTempoAtTime(Score score, int time)
Get tempo value and its Dynamic object (if applicable) at specified time of the score

Functions

GetTempoAtTime(Score score, int time)

Get tempo value and its Dynamic object (if applicable) at specified time of the score

ParameterTypeDefaultDescription
scoreScore score
timeint 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, decrescendo, pppp to fff)
  • Tempo change
  • Pedal on/off
  • Ottava

ParameterTypeDefaultDescription
scoreScore score
staffStaff staff
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 group, or to the whole score.
Error
if score or staff are nil

DynamicIsTempo(Dynamic dynamic)

Is dynamic a Tempo?

ParameterTypeDefaultDescription
dynamicDynamic dynamic
Return
boolean: true if dynamic.Type==DYNAMIC_TEMPO

DynamicIsOttava(Dynamic dynamic)

Is dynamic an ottava (8va, 8vb, 15va or 15vb)?

ParameterTypeDefaultDescription
dynamicDynamic dynamic
Return
boolean: true if dynamic is 8va, 8vb, 15va or 15vb

DynamicIsPedal(Dynamic dynamic)

Is dynamic an pedal (Ped.

or *)?

ParameterTypeDefaultDescription
dynamicDynamic dynamic
Return
boolean: true if dynamic is Ped. or *

DynamicIsVelocity(Dynamic dynamic)

Is dynamic a velocity (power) change?

ParameterTypeDefaultDescription
dynamicDynamic dynamic
Return
boolean: true if dynamic is crescendo, decrescendo, ppp to fff... i.e. not a pedal, not a tempo, not a ottava

EnsureObjectInStaffArea(Score score, Staff staff, obj)

Ensure an object is in the Staff area, move it vertically if needed.

ParameterTypeDefaultDescription
scoreScore score
staffStaff staff
obj  Object: Dynamic, StaffText, FXProcessor, Picture
Return
boolean: true if object has been moved vertically, false otherwise.