-
Notifications
You must be signed in to change notification settings - Fork 3
Shorthand timing notation
Numula provides a shorthand notation for adjusting timing: accelerandi/ritarandi, pauses, and so on. These adjustments are represented as piecewise functions of time (PFTs).
As with Numula's other shorthand notations, you can use iteration, substitution, and measure-number checking.
For example:
from numula.notate_nuance import *
sh_tempo('60 8/4 80 4/4 60')defines a tempo that varies linearly from 60 to 80 BPM (beats per minute) over 8 beats,
then back to 60 over 4 beats.
This returns a PFT that you can apply to a score using tempo_adjust_pft():
ns = Score()
...
ns.tempo_adjust_pft(
sh_tempo('60 8/4 80 4/4 60')
)A tempo function can have discontinuities:
sh_tempo('60 8/4 80 90 4/4 60')defines a tempo that varies linearly from 60 to 80 BPM over 8 beats, then from 90 to 60 over 4 beats. Unlike volume, closure is irrelevant.
By default, sh_tempo() uses linear segments.
You can also use exponential curves:
sh_tempo('exp3.0 60 8/4 80 linear 4/4 60'specifies a exponential with curvature 3, followed by a linear change.
You can add pauses (think of these as Dirac deltas in the PFT):
sh_tempo('60 8/4 80 .03p 4/4 60')The .03p adds a pause of .03 seconds at the 8-beat mark.
The pause goes before notes that start then.
To put the pause after these notes, use p.03.
You can have pauses both before and after the beat;
this is denoted .02p.03.
A tempo PFT may contain a mixture of continuous changes and pauses. It may be convenient to put all the pauses in a separate PFT, with no continuous changes (i.e. a constant tempo of 60). This can be notated compactly as follows:
sh_tempo('.2p 4/4 . . p.1 .')This defines a PFT consisting of a .2-second pause, two 4/4 measures with no change, a .1-second pause, and another measure with no change.
A performer can bring out a note by playing it slightly before or after its notated time; this is called an 'agogic accent'. Numula lets you notate such shifts as follows:
s = sh_shift('.2 2/4 .1 2/4')
ns.start_adjust_pft(s, selector=lambda n: 'melody' in n.tags)This specifies a pattern in which the note on the downbeat is delayed by .2 sec and the note on the 3rd beat is delayed by .1 sec. This pattern is then applied to the notes tagged as 'melody'.
This is different from pauses because subsequent notes are not shifted.