setTempo

Tempo and playback

[1]:
from maelzel.core import *
from maelzel.snd.audiosample import Sample

# A chromatic scale of eighth notes
scale = Chain(Note(m, dur=0.5)
              for m in range(60, 72))

csoundengine.magic extension loaded
Magics available: %csound, %%csound, %%definstr
[6]:
scale.rec('snd/setTempo-60bpm.flac', nchnls=1, wait=True, quiet=True)
[6]:
OfflineRenderer
outfile="snd/setTempo-60bpm.flac", 1 channels, 6.02 secs, 44100 Hz

[7]:
setTempo(120)
[8]:
scale.rec('snd/setTempo-120bpm.flac', nchnls=1, wait=True, quiet=True)
[8]:
OfflineRenderer
outfile="snd/setTempo-120bpm.flac", 1 channels, 3.02 secs, 44100 Hz

[18]:
setScoreStruct(ScoreStruct(r'''
    3/4, 120,
    4/4, 66
    .
    5/8, 132
'''))
setTempo(40)
getScoreStruct().show()
../_images/notebooks_setTempo_5_0.png
[19]:
setTempo(84, 2)
getScoreStruct().show()
../_images/notebooks_setTempo_6_0.png