Package PMIDI :: Module Composer :: Class Song
[show private | hide private]
[frames | no frames]

Type Song

object --+
         |
        Song


Class that wraps the dirty details of creating and sequencing MIDI instructions in order to play a song.
Method Summary
  __init__(self, tempo)
Initialize an instance.
integer GetTempo(self)
Get the tempp in beats per minute.
list of Voice GetVoices(self)
Return all of the current voices.
Voice NewVoice(self, is_drum)
Create a new voice object and add it to the song.
list of integer Sequence(self)
Create an ordered list of all of the notes in a song.
  SetTempo(self, val)
Set the tempo to a value in beats per minute.
list of integer ToMIDI(self)
Return the tempo and instrument program change commands.
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variable Summary
integer channel_count: Total number of channels used in the song
boolean has_drums: Indicator of whether or not the drum channel is in use
integer tempo: Tempo in beats per minute
list of Voice voices: All of the voices used in this song

Method Details

__init__(self, tempo=120)
(Constructor)

Initialize an instance.
Parameters:
tempo - Tempo in beats per minute (default = 120)
           (type=integer)
Overrides:
__builtin__.object.__init__

GetTempo(self)

Get the tempp in beats per minute.
Returns:
Current tempo value
           (type=integer)

GetVoices(self)

Return all of the current voices.
Returns:
List of all voices used in the song
           (type=list of Voice)

NewVoice(self, is_drum=False)

Create a new voice object and add it to the song. Return a reference.
Parameters:
is_drum - Indicator of whether the new voice is the drum kit or not (default = False)
           (type=boolean)
Returns:
The new voice
           (type=Voice)

Sequence(self)

Create an ordered list of all of the notes in a song.
Returns:
All of the MIDI note commands in the song ordered by time of occurence
           (type=list of integer)

SetTempo(self, val)

Set the tempo to a value in beats per minute.
Parameters:
val - New tempo value
           (type=integer)

ToMIDI(self)

Return the tempo and instrument program change commands.
Returns:
All commands changing the tempo or program for a channel
           (type=list of integer)

Instance Variable Details

channel_count

Total number of channels used in the song
Type:
integer

has_drums

Indicator of whether or not the drum channel is in use
Type:
boolean

tempo

Tempo in beats per minute
Type:
integer

voices

All of the voices used in this song
Type:
list of Voice

Generated by Epydoc 2.1 on Tue Feb 22 16:24:34 2005 http://epydoc.sf.net