Section Play
Play utility functions: play the score, play a sound...
Summary
| Return type | Function and summary |
|---|---|
| PlayFromBar(Score score, int barNumber, boolean showKaraoke, boolean scrollMusic, boolean followMusic, int metronomeBars) Start playing music from specified bar. | |
| PlayNote(Symbol symbol) Plays a note, shortcut and fix for Staff.PlayNotes(). | |
| PlayThemeSound(string soundName, boolean wait) Play a "theme" sound, if set to active. |
Functions
PlayFromBar(Score score, int barNumber, boolean showKaraoke, boolean scrollMusic, boolean followMusic, int metronomeBars)
Start playing music from specified bar.
Target.PlayMusic() is bogus; here is a work-around.
| Parameter | Type | Default | Description |
|---|---|---|---|
| score | Score | The score to play | |
| barNumber | int | The bar to start from, could be Target.Bar | |
| showKaraoke | boolean | user prefs | Display karaoke if score has lyrics? |
| scrollMusic | boolean | user prefs | Scrolls the score while playing? |
| followMusic | boolean | user prefs | Open follow tune dialog? |
| metronomeBars | int | user prefs | Number of metronome bars to play before the music |
- Usage
PlayFromBar(FrontScore(), 2)
PlayNote(Symbol symbol)
Plays a note, shortcut and fix for Staff.PlayNotes().
Play only one note (the symbol parameter), in its context (tempo at its Time position), duration, velocity and pitch. Fix the no-sound bug when pitch==0 on grid drum staves.
| Parameter | Type | Default | Description |
|---|---|---|---|
| symbol | Symbol | (note) to play |
PlayThemeSound(string soundName, boolean wait)
Play a "theme" sound, if set to active.
| Parameter | Type | Default | Description |
|---|---|---|---|
| soundName | string | One of "open", "close", "bell", "error", "confirmation", "message", "toggle-off", "toggle-on", "window-slide" | |
| wait | boolean | false | If true, wait until sound file if played to continue script execution. If false, script continue immediately. A new call to PlayThemeSound(...) or Application.PlayWavFile(...) may interrupt and replace the first played sound. |