PageRenderTime 736ms CodeModel.GetById 149ms app.highlight 323ms RepoModel.GetById 200ms app.codeStats 1ms

/apidocs/echonest.support.midi.EventDispatcher-pysrc.html

http://echo-nest-remix.googlecode.com/
HTML | 491 lines | 460 code | 10 blank | 21 comment | 0 complexity | 14806d1a29e5d7461633356d5aa8b3c9 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1<?xml version="1.0" encoding="ascii"?>
  2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3          "DTD/xhtml1-transitional.dtd">
  4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5<head>
  6  <title>echonest.support.midi.EventDispatcher</title>
  7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  8  <script type="text/javascript" src="epydoc.js"></script>
  9</head>
 10
 11<body bgcolor="white" text="black" link="blue" vlink="#204080"
 12      alink="#204080">
 13<!-- ==================== NAVIGATION BAR ==================== -->
 14<table class="navbar" border="0" width="100%" cellpadding="0"
 15       bgcolor="#a0c0ff" cellspacing="0">
 16  <tr valign="middle">
 17
 18  <!-- Tree link -->
 19      <th>&nbsp;&nbsp;&nbsp;<a
 20        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
 21
 22  <!-- Index link -->
 23      <th>&nbsp;&nbsp;&nbsp;<a
 24        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
 25
 26  <!-- Help link -->
 27      <th>&nbsp;&nbsp;&nbsp;<a
 28        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
 29
 30  <!-- Project homepage -->
 31      <th class="navbar" align="right" width="100%">
 32        <table border="0" cellpadding="0" cellspacing="0">
 33          <tr><th class="navbar" align="center"
 34            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
 35          </tr></table></th>
 36  </tr>
 37</table>
 38<table width="100%" cellpadding="0" cellspacing="0">
 39  <tr valign="top">
 40    <td width="100%">
 41      <span class="breadcrumbs">
 42        <a href="echonest-module.html">Package&nbsp;echonest</a> ::
 43        <a href="echonest.support-module.html">Package&nbsp;support</a> ::
 44        <a href="echonest.support.midi-module.html">Package&nbsp;midi</a> ::
 45        Module&nbsp;EventDispatcher
 46      </span>
 47    </td>
 48    <td>
 49      <table cellpadding="0" cellspacing="0">
 50        <!-- hide/show private -->
 51        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
 52    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
 53        <tr><td align="right"><span class="options"
 54            >[<a href="frames.html" target="_top">frames</a
 55            >]&nbsp;|&nbsp;<a href="echonest.support.midi.EventDispatcher-pysrc.html"
 56            target="_top">no&nbsp;frames</a>]</span></td></tr>
 57      </table>
 58    </td>
 59  </tr>
 60</table>
 61<h1 class="epydoc">Source Code for <a href="echonest.support.midi.EventDispatcher-module.html">Module echonest.support.midi.EventDispatcher</a></h1>
 62<pre class="py-src">
 63<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: ISO-8859-1 -*-</tt>
 </tt>
 64<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line">
 </tt>
 65<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"># std library</tt>
 </tt>
 66<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">struct</tt> <tt class="py-keyword">import</tt> <tt class="py-name">unpack</tt> </tt>
 67<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line">
 </tt>
 68<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"># custom</tt>
 </tt>
 69<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module echonest.support.midi.DataTypeConverters=echonest.support.midi.DataTypeConverters-module.html"><a title="echonest.support.midi.DataTypeConverters" class="py-name" href="#" onclick="return doclink('link-0', 'DataTypeConverters', 'link-0');">DataTypeConverters</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Function echonest.support.midi.DataTypeConverters.readBew()=echonest.support.midi.DataTypeConverters-module.html#readBew,Method echonest.support.midi.RawInstreamFile.RawInstreamFile.readBew()=echonest.support.midi.RawInstreamFile.RawInstreamFile-class.html#readBew"><a title="echonest.support.midi.DataTypeConverters.readBew
 70echonest.support.midi.RawInstreamFile.RawInstreamFile.readBew" class="py-name" href="#" onclick="return doclink('link-1', 'readBew', 'link-1');">readBew</a></tt><tt class="py-op">,</tt> <tt id="link-2" class="py-name" targets="Function echonest.support.midi.DataTypeConverters.readVar()=echonest.support.midi.DataTypeConverters-module.html#readVar"><a title="echonest.support.midi.DataTypeConverters.readVar" class="py-name" href="#" onclick="return doclink('link-2', 'readVar', 'link-2');">readVar</a></tt><tt class="py-op">,</tt> <tt id="link-3" class="py-name" targets="Function echonest.support.midi.DataTypeConverters.varLen()=echonest.support.midi.DataTypeConverters-module.html#varLen"><a title="echonest.support.midi.DataTypeConverters.varLen" class="py-name" href="#" onclick="return doclink('link-3', 'varLen', 'link-3');">varLen</a></tt><tt class="py-op">,</tt> <tt id="link-4" class="py-name" targets="Function echonest.support.midi.DataTypeConverters.toBytes()=echonest.support.midi.DataTypeConverters-module.html#toBytes"><a title="echonest.support.midi.DataTypeConverters.toBytes" class="py-name" href="#" onclick="return doclink('link-4', 'toBytes', 'link-4');">toBytes</a></tt> </tt>
 71<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line">
 </tt>
 72<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"># uhh I don't really like this, but there are so many constants to </tt>
 </tt>
 73<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"># import otherwise</tt>
 </tt>
 74<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-5" class="py-name" targets="Module echonest.support.midi.constants=echonest.support.midi.constants-module.html"><a title="echonest.support.midi.constants" class="py-name" href="#" onclick="return doclink('link-5', 'constants', 'link-5');">constants</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
 75<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line">
 </tt>
 76<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line">
 </tt>
 77<a name="EventDispatcher"></a><div id="EventDispatcher-def"><a name="L14"></a><tt class="py-lineno"> 14</tt> <a class="py-toggle" href="#" id="EventDispatcher-toggle" onclick="return toggle('EventDispatcher');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html">EventDispatcher</a><tt class="py-op">:</tt> </tt>
 78</div><div id="EventDispatcher-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="EventDispatcher-expanded"><a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line">
 </tt>
 79<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line">
 </tt>
 80<a name="EventDispatcher.__init__"></a><div id="EventDispatcher.__init__-def"><a name="L17"></a><tt class="py-lineno"> 17</tt> <a class="py-toggle" href="#" id="EventDispatcher.__init__-toggle" onclick="return toggle('EventDispatcher.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">outstream</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
 81</div><div id="EventDispatcher.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.__init__-expanded"><a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line">        
 </tt>
 82<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line">        <tt class="py-docstring">"""
</tt> </tt>
 83<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">        
</tt> </tt>
 84<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">        The event dispatcher generates events on the outstream.
</tt> </tt>
 85<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">        
</tt> </tt>
 86<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
 87<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line">        
 </tt>
 88<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">        <tt class="py-comment"># internal values, don't mess with 'em directly</tt>
 </tt>
 89<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt> <tt class="py-op">=</tt> <tt class="py-name">outstream</tt> </tt>
 90<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">        
 </tt>
 91<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">        <tt class="py-comment"># public flags</tt>
 </tt>
 92<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line">
 </tt>
 93<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">        <tt class="py-comment"># A note_on with a velocity of 0x00 is actually the same as a </tt>
 </tt>
 94<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">        <tt class="py-comment"># note_off with a velocity of 0x40. When </tt>
 </tt>
 95<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">        <tt class="py-comment"># "convert_zero_velocity" is set, the zero velocity note_on's </tt>
 </tt>
 96<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">        <tt class="py-comment"># automatically gets converted into note_off's. This is a less </tt>
 </tt>
 97<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">        <tt class="py-comment"># suprising behaviour for those that are not into the intimate </tt>
 </tt>
 98<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-comment"># details of the midi spec.</tt>
 </tt>
 99<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">convert_zero_velocity</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
100<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        
 </tt>
101<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-comment"># If dispatch_continuos_controllers is true, continuos </tt>
 </tt>
102<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-comment"># controllers gets dispatched to their defined handlers. Else </tt>
 </tt>
103<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">        <tt class="py-comment"># they just trigger the "continuous_controller" event handler.</tt>
 </tt>
104<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dispatch_continuos_controllers</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-comment"># NOT IMPLEMENTED YET</tt> </tt>
105<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">        
 </tt>
106<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">        <tt class="py-comment"># If dispatch_meta_events is true, meta events get's dispatched </tt>
 </tt>
107<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">        <tt class="py-comment"># to their defined events. Else they all they trigger the </tt>
 </tt>
108<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">        <tt class="py-comment"># "meta_event" handler.</tt>
 </tt>
109<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dispatch_meta_events</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
110</div><a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">
 </tt>
111<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">
 </tt>
112<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">
 </tt>
113<a name="EventDispatcher.header"></a><div id="EventDispatcher.header-def"><a name="L50"></a><tt class="py-lineno"> 50</tt> <a class="py-toggle" href="#" id="EventDispatcher.header-toggle" onclick="return toggle('EventDispatcher.header');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#header">header</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">format</tt><tt class="py-op">,</tt> <tt class="py-param">nTracks</tt><tt class="py-op">,</tt> <tt class="py-param">division</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
114</div><div id="EventDispatcher.header-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.header-expanded"><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">        <tt class="py-docstring">"Triggers the header event"</tt> </tt>
115<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.header()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#header,Method echonest.support.midi.MidiOutFile.MidiOutFile.header()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#header,Method echonest.support.midi.MidiOutStream.MidiOutStream.header()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#header,Method echonest.support.midi.MidiToText.MidiToText.header()=echonest.support.midi.MidiToText.MidiToText-class.html#header"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.header
116echonest.support.midi.MidiOutFile.MidiOutFile.header
117echonest.support.midi.MidiOutStream.MidiOutStream.header
118echonest.support.midi.MidiToText.MidiToText.header" class="py-name" href="#" onclick="return doclink('link-6', 'header', 'link-6');">header</a></tt><tt class="py-op">(</tt><tt class="py-name">format</tt><tt class="py-op">,</tt> <tt class="py-name">nTracks</tt><tt class="py-op">,</tt> <tt class="py-name">division</tt><tt class="py-op">)</tt> </tt>
119</div><a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">
 </tt>
120<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">
 </tt>
121<a name="EventDispatcher.start_of_track"></a><div id="EventDispatcher.start_of_track-def"><a name="L55"></a><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="EventDispatcher.start_of_track-toggle" onclick="return toggle('EventDispatcher.start_of_track');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#start_of_track">start_of_track</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">current_track</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
122</div><div id="EventDispatcher.start_of_track-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.start_of_track-expanded"><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-docstring">"Triggers the start of track event"</tt> </tt>
123<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        
 </tt>
124<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-comment"># I do this twice so that users can overwrite the </tt>
 </tt>
125<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-comment"># start_of_track event handler without worrying whether the </tt>
 </tt>
126<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-comment"># track number is updated correctly.</tt>
 </tt>
127<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method echonest.support.midi.MidiOutStream.MidiOutStream.set_current_track()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#set_current_track"><a title="echonest.support.midi.MidiOutStream.MidiOutStream.set_current_track" class="py-name" href="#" onclick="return doclink('link-7', 'set_current_track', 'link-7');">set_current_track</a></tt><tt class="py-op">(</tt><tt class="py-name">current_track</tt><tt class="py-op">)</tt> </tt>
128<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.start_of_track()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#start_of_track,Method echonest.support.midi.MidiOutFile.MidiOutFile.start_of_track()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#start_of_track,Method echonest.support.midi.MidiOutStream.MidiOutStream.start_of_track()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#start_of_track,Method echonest.support.midi.MidiToText.MidiToText.start_of_track()=echonest.support.midi.MidiToText.MidiToText-class.html#start_of_track"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.start_of_track
129echonest.support.midi.MidiOutFile.MidiOutFile.start_of_track
130echonest.support.midi.MidiOutStream.MidiOutStream.start_of_track
131echonest.support.midi.MidiToText.MidiToText.start_of_track" class="py-name" href="#" onclick="return doclink('link-8', 'start_of_track', 'link-8');">start_of_track</a></tt><tt class="py-op">(</tt><tt class="py-name">current_track</tt><tt class="py-op">)</tt> </tt>
132</div><a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        
 </tt>
133<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">    
 </tt>
134<a name="EventDispatcher.sysex_event"></a><div id="EventDispatcher.sysex_event-def"><a name="L65"></a><tt class="py-lineno"> 65</tt> <a class="py-toggle" href="#" id="EventDispatcher.sysex_event-toggle" onclick="return toggle('EventDispatcher.sysex_event');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#sysex_event">sysex_event</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
135</div><div id="EventDispatcher.sysex_event-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.sysex_event-expanded"><a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">        <tt class="py-docstring">"Dispatcher for sysex events"</tt> </tt>
136<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.sysex_event()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#sysex_event,Method echonest.support.midi.MidiToText.MidiToText.sysex_event()=echonest.support.midi.MidiToText.MidiToText-class.html#sysex_event"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.sysex_event
137echonest.support.midi.MidiToText.MidiToText.sysex_event" class="py-name" href="#" onclick="return doclink('link-9', 'sysex_event', 'link-9');">sysex_event</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
138</div><a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">    
 </tt>
139<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">    
 </tt>
140<a name="EventDispatcher.eof"></a><div id="EventDispatcher.eof-def"><a name="L70"></a><tt class="py-lineno"> 70</tt> <a class="py-toggle" href="#" id="EventDispatcher.eof-toggle" onclick="return toggle('EventDispatcher.eof');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#eof">eof</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
141</div><div id="EventDispatcher.eof-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.eof-expanded"><a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-docstring">"End of file!"</tt> </tt>
142<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.eof()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#eof,Method echonest.support.midi.MidiOutFile.MidiOutFile.eof()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#eof,Method echonest.support.midi.MidiOutStream.MidiOutStream.eof()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#eof,Method echonest.support.midi.MidiToText.MidiToText.eof()=echonest.support.midi.MidiToText.MidiToText-class.html#eof"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.eof
143echonest.support.midi.MidiOutFile.MidiOutFile.eof
144echonest.support.midi.MidiOutStream.MidiOutStream.eof
145echonest.support.midi.MidiToText.MidiToText.eof" class="py-name" href="#" onclick="return doclink('link-10', 'eof', 'link-10');">eof</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
146</div><a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">
 </tt>
147<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">
 </tt>
148<a name="EventDispatcher.update_time"></a><div id="EventDispatcher.update_time-def"><a name="L75"></a><tt class="py-lineno"> 75</tt> <a class="py-toggle" href="#" id="EventDispatcher.update_time-toggle" onclick="return toggle('EventDispatcher.update_time');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#update_time">update_time</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">new_time</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">relative</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
149</div><div id="EventDispatcher.update_time-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.update_time-expanded"><a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-docstring">"Updates relative/absolute time."</tt> </tt>
150<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.update_time()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#update_time,Method echonest.support.midi.MidiOutStream.MidiOutStream.update_time()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#update_time"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.update_time
151echonest.support.midi.MidiOutStream.MidiOutStream.update_time" class="py-name" href="#" onclick="return doclink('link-11', 'update_time', 'link-11');">update_time</a></tt><tt class="py-op">(</tt><tt class="py-name">new_time</tt><tt class="py-op">,</tt> <tt class="py-name">relative</tt><tt class="py-op">)</tt> </tt>
152</div><a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">        
 </tt>
153<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        
 </tt>
154<a name="EventDispatcher.reset_time"></a><div id="EventDispatcher.reset_time-def"><a name="L80"></a><tt class="py-lineno"> 80</tt> <a class="py-toggle" href="#" id="EventDispatcher.reset_time-toggle" onclick="return toggle('EventDispatcher.reset_time');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#reset_time">reset_time</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
155</div><div id="EventDispatcher.reset_time-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.reset_time-expanded"><a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt class="py-docstring">"Updates relative/absolute time."</tt> </tt>
156<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.reset_time()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#reset_time,Method echonest.support.midi.MidiOutStream.MidiOutStream.reset_time()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#reset_time"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.reset_time
157echonest.support.midi.MidiOutStream.MidiOutStream.reset_time" class="py-name" href="#" onclick="return doclink('link-12', 'reset_time', 'link-12');">reset_time</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
158</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        
 </tt>
159<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        
 </tt>
160<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">    <tt class="py-comment"># Event dispatchers for similar types of events</tt>
 </tt>
161<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">    
 </tt>
162<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">    
 </tt>
163<a name="EventDispatcher.channel_messages"></a><div id="EventDispatcher.channel_messages-def"><a name="L88"></a><tt class="py-lineno"> 88</tt> <a class="py-toggle" href="#" id="EventDispatcher.channel_messages-toggle" onclick="return toggle('EventDispatcher.channel_messages');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#channel_messages">channel_messages</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">hi_nible</tt><tt class="py-op">,</tt> <tt class="py-param">channel</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
164</div><div id="EventDispatcher.channel_messages-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.channel_messages-expanded"><a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">    
 </tt>
165<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-docstring">"Dispatches channel messages"</tt> </tt>
166<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        
 </tt>
167<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-name">stream</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt> </tt>
168<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt id="link-13" class="py-name"><a title="echonest.support.midi.DataTypeConverters.toBytes" class="py-name" href="#" onclick="return doclink('link-13', 'toBytes', 'link-4');">toBytes</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
169<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">        
 </tt>
170<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt id="link-14" class="py-name" targets="Variable echonest.support.midi.constants.NOTE_ON=echonest.support.midi.constants-module.html#NOTE_ON"><a title="echonest.support.midi.constants.NOTE_ON" class="py-name" href="#" onclick="return doclink('link-14', 'NOTE_ON', 'link-14');">NOTE_ON</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
171<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">            <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-name">velocity</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
172<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">            <tt class="py-comment"># note_on with velocity 0x00 are same as note </tt>
 </tt>
173<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">            <tt class="py-comment"># off with velocity 0x40 according to spec!</tt>
 </tt>
174<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">velocity</tt><tt class="py-op">==</tt><tt class="py-number">0</tt> <tt class="py-keyword">and</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">convert_zero_velocity</tt><tt class="py-op">:</tt> </tt>
175<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">                <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.note_off()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#note_off,Method echonest.support.midi.MidiOutStream.MidiOutStream.note_off()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#note_off,Method echonest.support.midi.MidiToText.MidiToText.note_off()=echonest.support.midi.MidiToText.MidiToText-class.html#note_off,Method echonest.support.midi.example_transpose_octave.Transposer.note_off()=echonest.support.midi.example_transpose_octave.Transposer-class.html#note_off"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.note_off
176echonest.support.midi.MidiOutStream.MidiOutStream.note_off
177echonest.support.midi.MidiToText.MidiToText.note_off
178echonest.support.midi.example_transpose_octave.Transposer.note_off" class="py-name" href="#" onclick="return doclink('link-15', 'note_off', 'link-15');">note_off</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-number">0x40</tt><tt class="py-op">)</tt> </tt>
179<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
180<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">                <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.note_on()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#note_on,Method echonest.support.midi.MidiOutStream.MidiOutStream.note_on()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#note_on,Method echonest.support.midi.MidiToText.MidiToText.note_on()=echonest.support.midi.MidiToText.MidiToText-class.html#note_on,Method echonest.support.midi.example_print_channel_0.Transposer.note_on()=echonest.support.midi.example_print_channel_0.Transposer-class.html#note_on,Method echonest.support.midi.example_transpose_octave.Transposer.note_on()=echonest.support.midi.example_transpose_octave.Transposer-class.html#note_on"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.note_on
181echonest.support.midi.MidiOutStream.MidiOutStream.note_on
182echonest.support.midi.MidiToText.MidiToText.note_on
183echonest.support.midi.example_print_channel_0.Transposer.note_on
184echonest.support.midi.example_transpose_octave.Transposer.note_on" class="py-name" href="#" onclick="return doclink('link-16', 'note_on', 'link-16');">note_on</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-name">velocity</tt><tt class="py-op">)</tt> </tt>
185<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        
 </tt>
186<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-op">(</tt><tt id="link-17" class="py-name" targets="Variable echonest.support.midi.constants.NOTE_OFF=echonest.support.midi.constants-module.html#NOTE_OFF"><a title="echonest.support.midi.constants.NOTE_OFF" class="py-name" href="#" onclick="return doclink('link-17', 'NOTE_OFF', 'link-17');">NOTE_OFF</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
187<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">            <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-name">velocity</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
188<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">            <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.note_off
189echonest.support.midi.MidiOutStream.MidiOutStream.note_off
190echonest.support.midi.MidiToText.MidiToText.note_off
191echonest.support.midi.example_transpose_octave.Transposer.note_off" class="py-name" href="#" onclick="return doclink('link-18', 'note_off', 'link-15');">note_off</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-name">velocity</tt><tt class="py-op">)</tt> </tt>
192<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        
 </tt>
193<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-op">(</tt><tt id="link-19" class="py-name" targets="Variable echonest.support.midi.constants.AFTERTOUCH=echonest.support.midi.constants-module.html#AFTERTOUCH"><a title="echonest.support.midi.constants.AFTERTOUCH" class="py-name" href="#" onclick="return doclink('link-19', 'AFTERTOUCH', 'link-19');">AFTERTOUCH</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
194<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">            <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-name">velocity</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
195<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">            <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.aftertouch()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#aftertouch,Method echonest.support.midi.MidiOutStream.MidiOutStream.aftertouch()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#aftertouch,Method echonest.support.midi.MidiToText.MidiToText.aftertouch()=echonest.support.midi.MidiToText.MidiToText-class.html#aftertouch"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.aftertouch
196echonest.support.midi.MidiOutStream.MidiOutStream.aftertouch
197echonest.support.midi.MidiToText.MidiToText.aftertouch" class="py-name" href="#" onclick="return doclink('link-20', 'aftertouch', 'link-20');">aftertouch</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">note</tt><tt class="py-op">,</tt> <tt class="py-name">velocity</tt><tt class="py-op">)</tt> </tt>
198<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">        
 </tt>
199<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-op">(</tt><tt id="link-21" class="py-name" targets="Variable echonest.support.midi.constants.CONTINUOUS_CONTROLLER=echonest.support.midi.constants-module.html#CONTINUOUS_CONTROLLER"><a title="echonest.support.midi.constants.CONTINUOUS_CONTROLLER" class="py-name" href="#" onclick="return doclink('link-21', 'CONTINUOUS_CONTROLLER', 'link-21');">CONTINUOUS_CONTROLLER</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
200<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">            <tt class="py-name">controller</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
201<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">            <tt class="py-comment"># A lot of the cc's are defined, so we trigger those directly</tt>
 </tt>
202<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dispatch_continuos_controllers</tt><tt class="py-op">:</tt> </tt>
203<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name" targets="Method echonest.support.midi.EventDispatcher.EventDispatcher.continuous_controllers()=echonest.support.midi.EventDispatcher.EventDispatcher-class.html#continuous_controllers"><a title="echonest.support.midi.EventDispatcher.EventDispatcher.continuous_controllers" class="py-name" href="#" onclick="return doclink('link-22', 'continuous_controllers', 'link-22');">continuous_controllers</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">controller</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
204<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
205<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">                <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.continuous_controller()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#continuous_controller,Method echonest.support.midi.MidiOutStream.MidiOutStream.continuous_controller()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#continuous_controller,Method echonest.support.midi.MidiToText.MidiToText.continuous_controller()=echonest.support.midi.MidiToText.MidiToText-class.html#continuous_controller"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.continuous_controller
206echonest.support.midi.MidiOutStream.MidiOutStream.continuous_controller
207echonest.support.midi.MidiToText.MidiToText.continuous_controller" class="py-name" href="#" onclick="return doclink('link-23', 'continuous_controller', 'link-23');">continuous_controller</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">controller</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
208<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">            
 </tt>
209<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-op">(</tt><tt id="link-24" class="py-name" targets="Variable echonest.support.midi.constants.PATCH_CHANGE=echonest.support.midi.constants-module.html#PATCH_CHANGE"><a title="echonest.support.midi.constants.PATCH_CHANGE" class="py-name" href="#" onclick="return doclink('link-24', 'PATCH_CHANGE', 'link-24');">PATCH_CHANGE</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
210<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">            <tt class="py-name">program</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
211<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">            <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.patch_change()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#patch_change,Method echonest.support.midi.MidiOutStream.MidiOutStream.patch_change()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#patch_change,Method echonest.support.midi.MidiToText.MidiToText.patch_change()=echonest.support.midi.MidiToText.MidiToText-class.html#patch_change"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.patch_change
212echonest.support.midi.MidiOutStream.MidiOutStream.patch_change
213echonest.support.midi.MidiToText.MidiToText.patch_change" class="py-name" href="#" onclick="return doclink('link-25', 'patch_change', 'link-25');">patch_change</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">program</tt><tt class="py-op">)</tt> </tt>
214<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">            
 </tt>
215<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-op">(</tt><tt id="link-26" class="py-name" targets="Variable echonest.support.midi.constants.CHANNEL_PRESSURE=echonest.support.midi.constants-module.html#CHANNEL_PRESSURE"><a title="echonest.support.midi.constants.CHANNEL_PRESSURE" class="py-name" href="#" onclick="return doclink('link-26', 'CHANNEL_PRESSURE', 'link-26');">CHANNEL_PRESSURE</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
216<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">            <tt class="py-name">pressure</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
217<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">            <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.channel_pressure()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#channel_pressure,Method echonest.support.midi.MidiOutStream.MidiOutStream.channel_pressure()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#channel_pressure,Method echonest.support.midi.MidiToText.MidiToText.channel_pressure()=echonest.support.midi.MidiToText.MidiToText-class.html#channel_pressure"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.channel_pressure
218echonest.support.midi.MidiOutStream.MidiOutStream.channel_pressure
219echonest.support.midi.MidiToText.MidiToText.channel_pressure" class="py-name" href="#" onclick="return doclink('link-27', 'channel_pressure', 'link-27');">channel_pressure</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">pressure</tt><tt class="py-op">)</tt> </tt>
220<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">            
 </tt>
221<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-op">(</tt><tt id="link-28" class="py-name" targets="Variable echonest.support.midi.constants.PITCH_BEND=echonest.support.midi.constants-module.html#PITCH_BEND"><a title="echonest.support.midi.constants.PITCH_BEND" class="py-name" href="#" onclick="return doclink('link-28', 'PITCH_BEND', 'link-28');">PITCH_BEND</a></tt> <tt class="py-op">&amp;</tt> <tt class="py-number">0xF0</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">hi_nible</tt><tt class="py-op">:</tt> </tt>
222<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">            <tt class="py-name">hibyte</tt><tt class="py-op">,</tt> <tt class="py-name">lobyte</tt> <tt class="py-op">=</tt> <tt class="py-name">data</tt> </tt>
223<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">            <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">hibyte</tt><tt class="py-op">&lt;&lt;</tt><tt class="py-number">7</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">lobyte</tt> </tt>
224<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">            <tt class="py-name">stream</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Method echonest.support.midi.MidiOutFile.MidiOutFile.pitch_bend()=echonest.support.midi.MidiOutFile.MidiOutFile-class.html#pitch_bend,Method echonest.support.midi.MidiOutStream.MidiOutStream.pitch_bend()=echonest.support.midi.MidiOutStream.MidiOutStream-class.html#pitch_bend,Method echonest.support.midi.MidiToText.MidiToText.pitch_bend()=echonest.support.midi.MidiToText.MidiToText-class.html#pitch_bend"><a title="echonest.support.midi.MidiOutFile.MidiOutFile.pitch_bend
225echonest.support.midi.MidiOutStream.MidiOutStream.pitch_bend
226echonest.support.midi.MidiToText.MidiToText.pitch_bend" class="py-name" href="#" onclick="return doclink('link-29', 'pitch_bend', 'link-29');">pitch_bend</a></tt><tt class="py-op">(</tt><tt class="py-name">channel</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt> </tt>
227<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">
 </tt>
228<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
229<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">
 </tt>
230<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">ValueError</tt><tt class="py-op">,</tt> <tt class="py-string">'Illegal channel message!'</tt> </tt>
231</div><a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">
 </tt>
232<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">
 </tt>
233<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">
 </tt>
234<a name="EventDispatcher.continuous_controllers"></a><div id="EventDispatcher.continuous_controllers-def"><a name="L139"></a><tt class="py-lineno">139</tt> <a class="py-toggle" href="#" id="EventDispatcher.continuous_controllers-toggle" onclick="return toggle('EventDispatcher.continuous_controllers');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.EventDispatcher.EventDispatcher-class.html#continuous_controllers">continuous_controllers</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">channel</tt><tt class="py-op">,</tt> <tt class="py-param">controller</tt><tt class="py-op">,</tt> <tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
235</div><div id="EventDispatcher.continuous_controllers-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EventDispatcher.continuous_controllers-expanded"><a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">    
 </tt>
236<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-docstring">"Dispatches channel messages"</tt> </tt>
237<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">
 </tt>
238<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-name">stream</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">outstream</tt> </tt>
239<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        
 </tt>
240<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">        <tt class="py-comment"># I am not really shure if I ought to dispatch continuous controllers</tt>
 </tt>
241<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">        <tt class="py-comment"># There's so many of them that it can clutter up the OutStream </tt>
 </tt>
242<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-comment"># classes.</tt>
 </tt>
243<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">        
 </tt>
244<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">        <tt class="py-comment"># So I just trigger the default event handler</tt>
 </tt>
245<a name="L150"></a><tt class="py-lineā€¦

Large files files are truncated, but you can click here to view the full file