Package echonest :: Package remix :: Package support :: Package midi :: Module MidiOutFile :: Class MidiOutFile
[hide private]
[frames] | no frames]

Class MidiOutFile

source code


MidiOutFile is an eventhandler that subclasses MidiOutStream.
Instance Methods [hide private]
 
__init__(self, raw_out='') source code
 
write(self) source code
 
event_slice(self, slc)
Writes the slice of an event to the current track. Correctly inserting a varlen timestamp too.
source code
 
note_on(self, channel=0, note=64, velocity=64)
channel: 0-15 note, velocity: 0-127
source code
 
note_off(self, channel=0, note=64, velocity=64)
channel: 0-15 note, velocity: 0-127
source code
 
aftertouch(self, channel=0, note=64, velocity=64)
channel: 0-15 note, velocity: 0-127
source code
 
continuous_controller(self, channel, controller, value)
channel: 0-15 controller, value: 0-127
source code
 
patch_change(self, channel, patch)
channel: 0-15 patch: 0-127
source code
 
channel_pressure(self, channel, pressure)
channel: 0-15 pressure: 0-127
source code
 
pitch_bend(self, channel, value)
channel: 0-15 value: 0-16383
source code
 
system_exclusive(self, data)
data: list of values in range(128)
source code
 
midi_time_code(self, msg_type, values)
msg_type: 0-7 values: 0-15
source code
 
song_position_pointer(self, value)
value: 0-16383
source code
 
song_select(self, songNumber)
songNumber: 0-127
source code
 
tuning_request(self)
No values passed
source code
 
header(self, format=0, nTracks=1, division=96)
format: type of midi file in [0,1,2] nTracks: number of tracks. 1 track for type 0 file division: timing division ie. 96 ppq.
source code
 
eof(self)
End of file. No more events to be processed.
source code
 
meta_slice(self, meta_type, data_slice)
Writes a meta event
source code
 
meta_event(self, meta_type, data)
Handles any undefined meta events
source code
 
start_of_track(self, n_track=0)
n_track: number of track
source code
 
end_of_track(self)
Writes the track to the buffer.
source code
 
sequence_number(self, value)
value: 0-65535
source code
 
text(self, text)
Text event text: string
source code
 
copyright(self, text)
Copyright notice text: string
source code
 
sequence_name(self, text)
Sequence/track name text: string
source code
 
instrument_name(self, text)
text: string
source code
 
lyric(self, text)
text: string
source code
 
marker(self, text)
text: string
source code
 
cuepoint(self, text)
text: string
source code
 
midi_ch_prefix(self, channel)
channel: midi channel for subsequent data (deprecated in the spec)
source code
 
midi_port(self, value)
value: Midi port (deprecated in the spec)
source code
 
tempo(self, value)
value: 0-2097151 tempo in us/quarternote (to calculate value from bpm: int(60,000,000.00 / BPM))
source code
 
smtp_offset(self, hour, minute, second, frame, framePart)
hour, minute, second: 3 bytes specifying the hour (0-23), minutes (0-59) and seconds (0-59), respectively.
source code
 
time_signature(self, nn, dd, cc, bb)
nn: Numerator of the signature as notated on sheet music dd: Denominator of the signature as notated on sheet music The denominator is a negative power of 2: 2 = quarter note, 3 = eighth, etc.
source code
 
key_signature(self, sf, mi)
(+ve) that identifies the key signature (-7 = 7 flats, -1 = 1 flat, 0 = key of C, 1 = 1 sharp, etc).
source code
 
sequencer_specific(self, data)
data: The data as byte values
source code

Inherited from MidiOutStream.MidiOutStream: abs_time, active_sensing, channel_message, get_current_track, get_run_stat, rel_time, reset_run_stat, reset_time, set_current_track, set_run_stat, song_continue, song_start, song_stop, system_reset, timing_clock, update_time

Method Details [hide private]

__init__(self, raw_out='')
(Constructor)

source code 
Overrides: MidiOutStream.MidiOutStream.__init__

note_on(self, channel=0, note=64, velocity=64)

source code 
channel: 0-15 note, velocity: 0-127
Overrides: MidiOutStream.MidiOutStream.note_on

note_off(self, channel=0, note=64, velocity=64)

source code 
channel: 0-15 note, velocity: 0-127
Overrides: MidiOutStream.MidiOutStream.note_off

aftertouch(self, channel=0, note=64, velocity=64)

source code 
channel: 0-15 note, velocity: 0-127
Overrides: MidiOutStream.MidiOutStream.aftertouch

continuous_controller(self, channel, controller, value)

source code 
channel: 0-15 controller, value: 0-127
Overrides: MidiOutStream.MidiOutStream.continuous_controller

patch_change(self, channel, patch)

source code 
channel: 0-15 patch: 0-127
Overrides: MidiOutStream.MidiOutStream.patch_change

channel_pressure(self, channel, pressure)

source code 
channel: 0-15 pressure: 0-127
Overrides: MidiOutStream.MidiOutStream.channel_pressure

pitch_bend(self, channel, value)

source code 
channel: 0-15 value: 0-16383
Overrides: MidiOutStream.MidiOutStream.pitch_bend

system_exclusive(self, data)

source code 
data: list of values in range(128)
Overrides: MidiOutStream.MidiOutStream.system_exclusive

midi_time_code(self, msg_type, values)

source code 
msg_type: 0-7 values: 0-15
Overrides: MidiOutStream.MidiOutStream.midi_time_code

song_position_pointer(self, value)

source code 
value: 0-16383
Overrides: MidiOutStream.MidiOutStream.song_position_pointer

song_select(self, songNumber)

source code 
songNumber: 0-127
Overrides: MidiOutStream.MidiOutStream.song_select

tuning_request(self)

source code 
No values passed
Overrides: MidiOutStream.MidiOutStream.tuning_request

header(self, format=0, nTracks=1, division=96)

source code 
format: type of midi file in [0,1,2] nTracks: number of tracks. 1 track for type 0 file division: timing division ie. 96 ppq.
Overrides: MidiOutStream.MidiOutStream.header

eof(self)

source code 
End of file. No more events to be processed.
Overrides: MidiOutStream.MidiOutStream.eof

meta_event(self, meta_type, data)

source code 
Handles any undefined meta events
Overrides: MidiOutStream.MidiOutStream.meta_event

start_of_track(self, n_track=0)

source code 
n_track: number of track
Overrides: MidiOutStream.MidiOutStream.start_of_track

end_of_track(self)

source code 
Writes the track to the buffer.
Overrides: MidiOutStream.MidiOutStream.end_of_track

sequence_number(self, value)

source code 
value: 0-65535
Overrides: MidiOutStream.MidiOutStream.sequence_number

text(self, text)

source code 
Text event text: string
Overrides: MidiOutStream.MidiOutStream.text

copyright(self, text)

source code 
Copyright notice text: string
Overrides: MidiOutStream.MidiOutStream.copyright

sequence_name(self, text)

source code 
Sequence/track name text: string
Overrides: MidiOutStream.MidiOutStream.sequence_name

instrument_name(self, text)

source code 
text: string
Overrides: MidiOutStream.MidiOutStream.instrument_name

lyric(self, text)

source code 
text: string
Overrides: MidiOutStream.MidiOutStream.lyric

marker(self, text)

source code 
text: string
Overrides: MidiOutStream.MidiOutStream.marker

cuepoint(self, text)

source code 
text: string
Overrides: MidiOutStream.MidiOutStream.cuepoint

midi_ch_prefix(self, channel)

source code 
channel: midi channel for subsequent data (deprecated in the spec)
Overrides: MidiOutStream.MidiOutStream.midi_ch_prefix

midi_port(self, value)

source code 
value: Midi port (deprecated in the spec)
Overrides: MidiOutStream.MidiOutStream.midi_port

tempo(self, value)

source code 
value: 0-2097151 tempo in us/quarternote (to calculate value from bpm: int(60,000,000.00 / BPM))
Overrides: MidiOutStream.MidiOutStream.tempo

smtp_offset(self, hour, minute, second, frame, framePart)

source code 

hour,
minute,
second: 3 bytes specifying the hour (0-23), minutes (0-59) and 
        seconds (0-59), respectively. The hour should be 
        encoded with the SMPTE format, just as it is in MIDI 
        Time Code.
frame: A byte specifying the number of frames per second (one 
       of : 24, 25, 29, 30).
framePart: A byte specifying the number of fractional frames, 
           in 100ths of a frame (even in SMPTE-based tracks 
           using a different frame subdivision, defined in the 
           MThd chunk).

Overrides: MidiOutStream.MidiOutStream.smtp_offset

time_signature(self, nn, dd, cc, bb)

source code 

nn: Numerator of the signature as notated on sheet music
dd: Denominator of the signature as notated on sheet music
    The denominator is a negative power of 2: 2 = quarter 
    note, 3 = eighth, etc.
cc: The number of MIDI clocks in a metronome click
bb: The number of notated 32nd notes in a MIDI quarter note 
    (24 MIDI clocks)        

Overrides: MidiOutStream.MidiOutStream.time_signature

key_signature(self, sf, mi)

source code 
sf: is a byte specifying the number of flats (-ve) or sharps
(+ve) that identifies the key signature (-7 = 7 flats, -1 = 1 flat, 0 = key of C, 1 = 1 sharp, etc).

mi: is a byte specifying a major (0) or minor (1) key.

Overrides: MidiOutStream.MidiOutStream.key_signature

sequencer_specific(self, data)

source code 
data: The data as byte values
Overrides: MidiOutStream.MidiOutStream.sequencer_specific