Tempo marks

Is there an example showing how to put metronom marks to the score?
pymusicxml.directions — scamp 0.8.7 documentation is not very clear to me :frowning:

In general in SCAMP, you don’t add tempo marks directly: they are the result of tempo changes made to the main Session. For example:

from scamp import *

# By default with a rit or accel, parenthesized guide marks get printed out
# With MuseScore, this is really helpful, since they cause the rit/accel to
# play back correctly. However, I them off here to reduce visual clutter
engraving_settings.tempo.include_guide_marks = False

s = Session()

piano = s.new_part("piano")

s.start_transcribing()

s.tempo = 70

for p in range(60, 68):
    piano.play_note(p, 0.7, 0.5)
    
s.tempo = 135

for p in range(60, 68):
    piano.play_note(p, 0.7, 0.5)
    
s.tempo = 200
s.set_tempo_target(50, 4)

for p in range(60, 68):
    piano.play_note(p, 0.7, 0.5)

piano.play_note(72, 0.7, 2)
    
s.stop_transcribing().to_score().show()

…produces:

Do you have a use case where you would need to add a tempo mark directly? I could make it possible to add one in the same way you would add any other text; I just haven’t seen a need.

1 Like