songplayer
index
/home/zelle/Dropbox/classes/cs220/projects/audio/songplayer/songplayer.py

# songplayer.py

 
Classes
       
builtins.object
SongPlayer

 
class SongPlayer(builtins.object)
    SongPlayer(songfile)
 
SongPlayer provides a convenient interface building an audio file
from a song description file.
 
Each part of a song file can be independently rendered any number
of times using any synthesizer to provide the "voice" of the
instrument playing the part. The individual part renderings are
summed to create a combined audio result that can be played and/or
written to a wav file.
 
  Methods defined here:
__init__(self, songfile)
Initialize self.  See help(type(self)) for accurate signature.
play_audio(self, time=None)
play the current audio
time is number of seconds of audio to play (None means entire audio)
Note: a normalized version of the audio is played, but the audio in
      the player retains its raw (unnormalized) form.
render_part(self, partnum, synth)
use synth to render the given part and 'merge' it into the audio
note: the current setting of tempo is used to compute note durations
set_tempo(self, bpm)
set tempo to bpm beats per minute
 
note: initial tempo is set from the TEMPO value in the song
file
writewavfile(self, fname, prepad=1, postpad=0)
save current audio to a file
prepad is number of seconds of silence to add at the start
postpad is number of seconds of silence to add at the end
 
Note: the audio file is normalized, but the acual audio in 
the player remains in its raw (unnormalized) form.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
test()