Chords and Noteheads
Example script (scamp): examples/Time & clocks/Forking & simultaneity/chords_example.py
Download: chords_example.py
Chords with per-note noteheads, and a start_chord handle whose pitches change over time. Under the hood, play_chord plays all but one of its notes with blocking=False and the last one blocking, so the notes sound together.
Topics: Time & clocks › Forking & simultaneity, Playback › Note handles
from scamp import *
s = Session()
piano = s.new_part("piano")
s.start_transcribing()
# this makes the whole chord diamond noteheads
handle = piano.start_chord(([60, 56], 64, 69), 0.5, "notehead: diamond")
handle.change_pitch((62, 58, 60), (1/3, 1/3, 1/3), transition_curve_shape_or_shapes=(5, 5, 5))
engraving_settings.glissandi.control_point_policy = "split"
wait(2)
handle.end()
# this gives separate noteheads for separate pitches
piano.play_chord((60, 64, 69), 0.5, 2.0, "noteheads: diamond / normal / cross")
# noteheads are assigned in the order of the pitch tuple given, not in order from low to high
# so here, middle C has a normal notehead, E has a diamond, and A has a cross
piano.play_chord((64, 60, 69), 0.5, 2.0, "noteheads: diamond / normal / cross")
s.stop_transcribing().to_score().show()