Package jazzparser :: Package harmonical :: Package midi :: Module chords :: Class ChordSequenceRealizer
[hide private]
[frames] | no frames]

Class ChordSequenceRealizer

source code

object --+
         |
        ChordSequenceRealizer

A factory class to produce a MIDI file (represented using the midi library package's EventStream)) from a sequence of tonal space roots and chord types.

The resulting MIDI file will be tuned so that the realization is justly intoned.

This provides an interface similar to path_to_tones, which renders the path to raw wave data containing sine waves.

Instance Methods [hide private]
 
__init__(self, path, chord_types=None, tempo=120, root_octave=0, double_root=False, equal_temperament=False, instrument=0, bass_root=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
midi.EventStream
render(self)
Creates MIDI data from the path and chord types.
source code
 
write(self, outfile)
Renders MIDI data and writes it out the the given file.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path, chord_types=None, tempo=120, root_octave=0, double_root=False, equal_temperament=False, instrument=0, bass_root=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • path (list of (3d-coordinate,length) tuples) - coordinates of the points in the sequence with their associated lengths, given in beats (ints or Fractions)
  • tempo (int) - speed in beats per second (Maelzel's metronome)
  • chord_types (list of (string,length) tuples) - the type of chord to use for each tone, with its associated length. See ..CHORD_TYPES keys for possible values.
  • equal_temperament (bool) - render all the pitches as they would be played in equal temperament.
  • root_octave (int) - octave to transpose the root to relative to other notes. Default (0) has the other notes in the octave above the root.
  • double_root (bool) - if True, an extra tone will be added an octave below the root
  • instrument (int) - MIDI instrument to set at the beginning of the file.
  • bass_root (int) - like double_root, adds an extra note an octave below the root. In this case, adds it to a seperate track, with the midi instrument number given. Set to None not to add the note at all (default)
Overrides: object.__init__

render(self)

source code 

Creates MIDI data from the path and chord types.

Returns: midi.EventStream
an event stream containing all the midi events

write(self, outfile)

source code 

Renders MIDI data and writes it out the the given file.

Parameters:
  • outfile (string or open file) - filename to write to or an open file(-like) object