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

Type Note

object --+
         |
        Note


Class that represents a single note in a measure.
Method Summary
  __init__(self, channel, measure, beat, duration, pitch, start)
Initialize an instance.
boolean __cmp__(self, other)
Compare notes first by measure, then by beat, then by start or stop flag.
string __repr__(self)
Human readable note.
integer DelayBetween(self, other)
Compute the delay between this note and another.
Note MakeStopNote(self)
Generate a partner note that represents when this note should stop.
integer ToMIDI(self)
Convert this note to a MIDI command and return it.
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Instance Variable Summary
integer beat: Beat to start sounding note in current measure (0-64)
integer channel: Channel number which will play the note (0-16)
integer duration: Duration of the note in beats
Measure measure: Measure holding the note
string pitch: Note name
boolean start: Indicator of whether note is starting or stopping

Method Details

__init__(self, channel, measure, beat, duration, pitch, start=True)
(Constructor)

Initialize an instance.
Parameters:
channel - Channel number which will play the note (0-16)
           (type=integer)
measure - Measure holding the note
           (type=Measure)
beat - Beat to start sounding note in current measure (0-64)
           (type=integer)
duration - Duration of the note in beats
           (type=integer)
pitch - Note name
           (type=string)
start - Indicator of whether note is starting or stopping
           (type=boolean)
Overrides:
__builtin__.object.__init__

__cmp__(self, other)
(Comparison operator)

Compare notes first by measure, then by beat, then by start or stop flag. This op is needed for proper sequencing.
Parameters:
other - Another note
           (type=Note)
Returns:
Indicator whether this note should be sequenced before or after the other note
           (type=boolean)

__repr__(self)
(Representation operator)

Human readable note.
Returns:
Printable representation of a note and its params
           (type=string)
Overrides:
__builtin__.object.__repr__

DelayBetween(self, other)

Compute the delay between this note and another.
Parameters:
other - Another note
           (type=Note)
Returns:
Duration in ticks between this note and the other
           (type=integer)

MakeStopNote(self)

Generate a partner note that represents when this note should stop.
Returns:
Note silencing a previously played note of the same pitch on the same channel
           (type=Note)

ToMIDI(self)

Convert this note to a MIDI command and return it.
Returns:
A MIDI command represting the note
           (type=integer)

Instance Variable Details

beat

Beat to start sounding note in current measure (0-64)
Type:
integer

channel

Channel number which will play the note (0-16)
Type:
integer

duration

Duration of the note in beats
Type:
integer

measure

Measure holding the note
Type:
Measure

pitch

Note name
Type:
string

start

Indicator of whether note is starting or stopping
Type:
boolean

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