Package jazzparser :: Package misc :: Package raphsto :: Module midi :: Class ChordSequenceRealizer
[hide private]
[frames] | no frames]

Class ChordSequenceRealizer

source code

object --+
         |
        ChordSequenceRealizer

Factory to take the output from the labeller and realize the chord sequence as a midi file.

Very basic - not going to sound great, but it's easier than playing it myself.

Instance Methods [hide private]
 
__init__(self, labels, resolution=120, chord_length=2, times=None, text_events=False, state_formatter=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
generate(self, overlay=None, offset=0)
Generates a midi stream.
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, labels, resolution=120, chord_length=2, times=None, text_events=False, state_formatter=None)
(Constructor)

source code 

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

Parameters:
  • labels (list of tuples) - state label tuples output by the model
  • resolution (int) - midi resolution to give the result (midi ticks per beat)
  • chord_length (int) - length of each chord as a number of beats
  • times (list of ints) - optional onset time for each chord in midi ticks. If not given, it will be calculated by giving chord_length to every chord
  • text_events (bool) - include chord labels in the midi as text events
  • state_formatter (1-arg function) - function to take a state label and produce the text label that will go in the midi data. Optional: by default, will use jazzparser.misc.raphsto.format_state_as_chord.
Overrides: object.__init__