songplayer – Text Based Music Player

songplayer module

Very high-level text-based music player Both songs and voices are specified as text strings

Uses a TrackPlayer for the actual playback. The focus in this module is on translating from a text-based format into the simple format used by TrackPlayer, and on doing as much of the setup as possible for the user.

class codex.songplayer.SongPlayer(waveform_name='flute')[source]

Compile and play text-based songs

compile_song(song_text)[source]

Convert a song from an ASCII representation to a list of frequency, duration pairs

play_compiled_song(track)[source]

Play a list of frequency, duration pairs (play a ‘track’)

play_song(song_text)[source]

Play a song based on an ASCII representation (compiles it, then plays it)

Download Source