| Trees | Indices | Help |
|
|---|
|
|
Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>
|
|||
| (float,float) pair |
|
||
|
|||
| midi.sequencer_pygame.Sequencer |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
__package__ = Nonehash(x) |
|||
|
|||
Given two EventStreams, returns the similarity, between 0 and 1, of the note on events. This is useful for detecting duplicate MIDI files. Exact mirrors of files can easily be found by checking for equality of the raw MIDI data, but often files are redistributed with different instruments, or simply different meta data. Note that the absolute time of two MIDI events must be equal for them to match, so an offset version of the same file will not match. This measure is not symmetric.
|
Many MIDI files begin with a count-in on a drum. Some might even begin with some silence. Given a midi.EventStream, returns a version with any drum intro or silence trimmed from the beginning, so that the first thing heard is a non-drum note. It is assumed that this is General MIDI data, so channel 10 is necessarily a drum channel. |
Plays an event stream. Various methods for playing midi data are provided in the midi library. At the time of writing, the only one that works is Timidity via SDL via PyGame and this is what this function uses. Whatever happens with the midi library, this function should continue to provide some convenient way to play a midi.EventStream. If a keyboard interrupt is received, the playing will stop. The interrupt will still be raised.
|
Extracts descriptive text from a midi.EventStream. This is often stored in the form of copyright notices, text events, track names, etc. This tries to pull out everything it can and return it all in a multiline string. Midi data can use non-ASCII characters. We assume the latin1 encoding is intended for these. This certainly covers the most common case: the copyright symbol. Returns a unicode string. |
Filters a midi midi.EventStream to simplify it. This is useful as a preprocessing step before taking midi input to an algorithm, for example, to make it clearer what the algorithm is using. Use kwargs to determine what filters will be applied. Without any kwargs, the stream will just be left as it was. Returns a filtered copy of the stream.
|
Some processing operations, like simplify, can leave a midi file with the same note being played twice at the same time. To avoid the confusion this leads to, it's best to remove these. This function will remove multiple instances of the same note being played simultaneously (in the same track and channel) and insert note-off events before a note is replayed that's already being played. This can lead to some strange effects if multiple instruments have been reduced to one, as in the case of simplify. You may wish to keep seperate instruments on separate channels to avoid this.
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:56 2012 | http://epydoc.sourceforge.net |