trackplayer
– Single Track component of songplayer
¶
trackplayer
Simple player: Single track with single voice, using sleep for timing
-
class
codex.trackplayer.
TrackPlayer
(tone, track=[], bpm=60, articulation=0.05)[source]¶ Player for music tracks
Initialize track player
- Parameters
tone (sound) – A sound from soundlib.SoundMaker.
track (list) – The notes of your song. A list of (pitch, duration) tuples. Units are (Hz, Beats).
bpm (int) – Tempo. The speed of your song in beats-per-minute.
articulation (float) – Articulation gap between notes. The fraction of duration to use as a gap. 0=”slur notes together”.
-
set_bpm
(bpm)[source]¶ Set a new tempo to use for this player.
- Parameters
bpm (int) – Tempo. The speed of your song in beats-per-minute.