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

Type Voice

object --+
         |
        Voice

Known Subclasses:
Drums, Instrument

Class that represents a single voice in a song.
Method Summary
  __init__(self, channel)
Initialize an instance.
Measure NewMeasure(self, number)
Create a new measure object.
list of integer Sequence(self)
Generate a sorted list of all notes in all measures.
integer ToMIDI(self)
Convert this voice to a MIDI change program command and return it.
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variable Summary
integer channel: Channel associated with this voice
integer instrument: Program number of the instrument represented by this voice
list of Measure measures: All of the measures played by this voice

Method Details

__init__(self, channel)
(Constructor)

Initialize an instance.
Parameters:
channel - Channel associated with this voice
           (type=integer)
Overrides:
__builtin__.object.__init__

NewMeasure(self, number=None)

Create a new measure object. Store it and return a reference so notes can be added.
Parameters:
number - The position of the new measure in the sequence of measures. If None, will create measure n+1
           (type=integer)
Returns:
The created measure
           (type=Measure)

Sequence(self)

Generate a sorted list of all notes in all measures.
Returns:
Sequenced notes in all measures
           (type=list of integer)

ToMIDI(self)

Convert this voice to a MIDI change program command and return it.
Returns:
A MIDI command represting a program change
           (type=integer)

Instance Variable Details

channel

Channel associated with this voice
Type:
integer

instrument

Program number of the instrument represented by this voice
Type:
integer

measures

All of the measures played by this voice
Type:
list of Measure

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