Events¶
Events are the fundamental pieces of time-stamped information in Symusic. They describe what happens
(e.g., a note starts, tempo changes, lyrics appear) and live inside the lists owned by Score and
Track objects.
Global vs. track-level events¶
Scope |
Examples |
Lives in |
|---|---|---|
Global |
|
|
Track |
|
|
Understanding scope matters when deciding whether an edit should affect every instrument (tempo map) or a single part (transpose just the bass line).
Working with events¶
Access a list:
notes = score.tracks[0].notes,tempi = score.tempos.Inspect attributes directly (
note.pitch,tempo.qpm).Mutate in place or replace items entirely. Lists remain Pythonic but operate on top of C++ storage.
Sort/filter:
notes.sort(key=lambda n: (n.time, n.pitch)),notes.filter(lambda n: n.velocity > 60).Vectorize:
notes.numpy()returns a mapping of NumPy arrays suitable for ML pipelines.
Find type-specific APIs under symusic.Note, symusic.ControlChange, and the related entries.