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

Module chords

source code

Justly intoned chord sequence realization

Production of justly intoned chord sequences in the form of MIDI files with tuning instructions included.


Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>

Classes [hide private]
  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.
  ChordSequenceRealizationError
Functions [hide private]
 
events_for_chord(coord, chord_type, start, duration, origin_note=60, equal_temperament=False, root_octave=0, double_root=False, velocity=100)
Builds a chord's midi events (note on and note off) from a root coordinate and a chord type.
source code
 
render_path_to_file(filename, path, *args, **kwargs)
Convenience function that takes a path and set of timings and uses the harmonical to render MIDI from it and writes it to a file.
source code
Variables [hide private]
  __package__ = 'jazzparser.harmonical.midi'
Function Details [hide private]

events_for_chord(coord, chord_type, start, duration, origin_note=60, equal_temperament=False, root_octave=0, double_root=False, velocity=100)

source code 

Builds a chord's midi events (note on and note off) from a root coordinate and a chord type. Uses the chord definitions in jazzparser.harmonical.CHORD_TYPES to decide what notes to play.

The list is grouped into sublists, one for each note. For each note, three events are created: tuning, note on and note off.

Parameters:
  • 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. This will be the last event in the list

render_path_to_file(filename, path, *args, **kwargs)

source code 

Convenience function that takes a path and set of timings and uses the harmonical to render MIDI from it and writes it to a file.

Additional args/kwargs are passed to the ChordSequenceRealizer init.