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

http://echo-nest-remix.googlecode.com/ · HTML · 595 lines · 564 code · 10 blank · 21 comment · 0 complexity · a1817943e30dc3af1258e3721aa1d645 MD5 · raw file

Large files are truncated 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.MidiOutStream</title>
  7. <link rel="stylesheet" href="epydoc.css" type="text/css" />
  8. <script type="text/javascript" src="epydoc.js"></script>
  9. </head>
  10. <body bgcolor="white" text="black" link="blue" vlink="#204080"
  11. alink="#204080">
  12. <!-- ==================== NAVIGATION BAR ==================== -->
  13. <table class="navbar" border="0" width="100%" cellpadding="0"
  14. bgcolor="#a0c0ff" cellspacing="0">
  15. <tr valign="middle">
  16. <!-- Tree link -->
  17. <th>&nbsp;&nbsp;&nbsp;<a
  18. href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
  19. <!-- Index link -->
  20. <th>&nbsp;&nbsp;&nbsp;<a
  21. href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
  22. <!-- Help link -->
  23. <th>&nbsp;&nbsp;&nbsp;<a
  24. href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
  25. <!-- Project homepage -->
  26. <th class="navbar" align="right" width="100%">
  27. <table border="0" cellpadding="0" cellspacing="0">
  28. <tr><th class="navbar" align="center"
  29. ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
  30. </tr></table></th>
  31. </tr>
  32. </table>
  33. <table width="100%" cellpadding="0" cellspacing="0">
  34. <tr valign="top">
  35. <td width="100%">
  36. <span class="breadcrumbs">
  37. <a href="echonest-module.html">Package&nbsp;echonest</a> ::
  38. <a href="echonest.support-module.html">Package&nbsp;support</a> ::
  39. <a href="echonest.support.midi-module.html">Package&nbsp;midi</a> ::
  40. Module&nbsp;MidiOutStream
  41. </span>
  42. </td>
  43. <td>
  44. <table cellpadding="0" cellspacing="0">
  45. <!-- hide/show private -->
  46. <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
  47. onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
  48. <tr><td align="right"><span class="options"
  49. >[<a href="frames.html" target="_top">frames</a
  50. >]&nbsp;|&nbsp;<a href="echonest.support.midi.MidiOutStream-pysrc.html"
  51. target="_top">no&nbsp;frames</a>]</span></td></tr>
  52. </table>
  53. </td>
  54. </tr>
  55. </table>
  56. <h1 class="epydoc">Source Code for <a href="echonest.support.midi.MidiOutStream-module.html">Module echonest.support.midi.MidiOutStream</a></h1>
  57. <pre class="py-src">
  58. <a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># -*- coding: ISO-8859-1 -*-</tt> </tt>
  59. <a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"> </tt>
  60. <a name="MidiOutStream"></a><div id="MidiOutStream-def"><a name="L3"></a><tt class="py-lineno"> 3</tt> <a class="py-toggle" href="#" id="MidiOutStream-toggle" onclick="return toggle('MidiOutStream');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html">MidiOutStream</a><tt class="py-op">:</tt> </tt>
  61. </div><div id="MidiOutStream-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MidiOutStream-expanded"><a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"> </tt>
  62. <a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"> </tt>
  63. <a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  64. <a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
  65. <a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-docstring"> MidiOutstream is Basically an eventhandler. It is the most central </tt> </tt>
  66. <a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-docstring"> class in the Midi library. You use it both for writing events to </tt> </tt>
  67. <a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-docstring"> an output stream, and as an event handler for an input stream. </tt> </tt>
  68. <a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
  69. <a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-docstring"> This makes it extremely easy to take input from one stream and </tt> </tt>
  70. <a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-docstring"> send it to another. Ie. if you want to read a Midi file, do some </tt> </tt>
  71. <a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-docstring"> processing, and send it to a midiport. </tt> </tt>
  72. <a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
  73. <a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-docstring"> All time values are in absolute values from the opening of a </tt> </tt>
  74. <a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-docstring"> stream. To calculate time values, please use the MidiTime and </tt> </tt>
  75. <a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-docstring"> MidiDeltaTime classes. </tt> </tt>
  76. <a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
  77. <a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  78. <a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"> </tt>
  79. <a name="MidiOutStream.__init__"></a><div id="MidiOutStream.__init__-def"><a name="L22"></a><tt class="py-lineno"> 22</tt> <a class="py-toggle" href="#" id="MidiOutStream.__init__-toggle" onclick="return toggle('MidiOutStream.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  80. </div><div id="MidiOutStream.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.__init__-expanded"><a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"> </tt>
  81. <a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"> <tt class="py-comment"># the time is rather global, so it needs to be stored </tt> </tt>
  82. <a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"> <tt class="py-comment"># here. Otherwise there would be no really simple way to </tt> </tt>
  83. <a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"> <tt class="py-comment"># calculate it. The alternative would be to have each event </tt> </tt>
  84. <a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"> <tt class="py-comment"># handler do it. That sucks even worse!</tt> </tt>
  85. <a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_absolute_time</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
  86. <a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_relative_time</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
  87. <a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_current_track</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
  88. <a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_running_status</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
  89. </div><a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"> </tt>
  90. <a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"> <tt class="py-comment"># time handling event handlers. They should be overwritten with care</tt> </tt>
  91. <a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"> </tt>
  92. <a name="MidiOutStream.update_time"></a><div id="MidiOutStream.update_time-def"><a name="L35"></a><tt class="py-lineno"> 35</tt> <a class="py-toggle" href="#" id="MidiOutStream.update_time-toggle" onclick="return toggle('MidiOutStream.update_time');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-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>
  93. </div><div id="MidiOutStream.update_time-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.update_time-expanded"><a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  94. <a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"><tt class="py-docstring"> Updates the time, if relative is true, new_time is relative, </tt> </tt>
  95. <a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"><tt class="py-docstring"> else it's absolute. </tt> </tt>
  96. <a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  97. <a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">relative</tt><tt class="py-op">:</tt> </tt>
  98. <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">_relative_time</tt> <tt class="py-op">=</tt> <tt class="py-name">new_time</tt> </tt>
  99. <a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_absolute_time</tt> <tt class="py-op">+=</tt> <tt class="py-name">new_time</tt> </tt>
  100. <a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
  101. <a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_relative_time</tt> <tt class="py-op">=</tt> <tt class="py-name">new_time</tt> <tt class="py-op">-</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_absolute_time</tt> </tt>
  102. <a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_absolute_time</tt> <tt class="py-op">=</tt> <tt class="py-name">new_time</tt> </tt>
  103. </div><a name="L46"></a><tt class="py-lineno"> 46</tt> <tt class="py-line"> </tt>
  104. <a name="MidiOutStream.reset_time"></a><div id="MidiOutStream.reset_time-def"><a name="L47"></a><tt class="py-lineno"> 47</tt> <a class="py-toggle" href="#" id="MidiOutStream.reset_time-toggle" onclick="return toggle('MidiOutStream.reset_time');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-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>
  105. </div><div id="MidiOutStream.reset_time-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.reset_time-expanded"><a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  106. <a name="L49"></a><tt class="py-lineno"> 49</tt> <tt class="py-line"><tt class="py-docstring"> reset time to 0 </tt> </tt>
  107. <a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  108. <a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_relative_time</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
  109. <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">_absolute_time</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
  110. </div><a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"> </tt>
  111. <a name="MidiOutStream.rel_time"></a><div id="MidiOutStream.rel_time-def"><a name="L54"></a><tt class="py-lineno"> 54</tt> <a class="py-toggle" href="#" id="MidiOutStream.rel_time-toggle" onclick="return toggle('MidiOutStream.rel_time');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#rel_time">rel_time</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  112. </div><div id="MidiOutStream.rel_time-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.rel_time-expanded"><a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"> <tt class="py-docstring">"Returns the relative time"</tt> </tt>
  113. <a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_relative_time</tt> </tt>
  114. </div><a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"> </tt>
  115. <a name="MidiOutStream.abs_time"></a><div id="MidiOutStream.abs_time-def"><a name="L58"></a><tt class="py-lineno"> 58</tt> <a class="py-toggle" href="#" id="MidiOutStream.abs_time-toggle" onclick="return toggle('MidiOutStream.abs_time');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#abs_time">abs_time</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  116. </div><div id="MidiOutStream.abs_time-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.abs_time-expanded"><a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"> <tt class="py-docstring">"Returns the absolute time"</tt> </tt>
  117. <a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_absolute_time</tt> </tt>
  118. </div><a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"> </tt>
  119. <a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"> <tt class="py-comment"># running status methods</tt> </tt>
  120. <a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"> </tt>
  121. <a name="MidiOutStream.reset_run_stat"></a><div id="MidiOutStream.reset_run_stat-def"><a name="L64"></a><tt class="py-lineno"> 64</tt> <a class="py-toggle" href="#" id="MidiOutStream.reset_run_stat-toggle" onclick="return toggle('MidiOutStream.reset_run_stat');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#reset_run_stat">reset_run_stat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  122. </div><div id="MidiOutStream.reset_run_stat-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.reset_run_stat-expanded"><a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"> <tt class="py-docstring">"Invalidates the running status"</tt> </tt>
  123. <a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_running_status</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
  124. </div><a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"> </tt>
  125. <a name="MidiOutStream.set_run_stat"></a><div id="MidiOutStream.set_run_stat-def"><a name="L68"></a><tt class="py-lineno"> 68</tt> <a class="py-toggle" href="#" id="MidiOutStream.set_run_stat-toggle" onclick="return toggle('MidiOutStream.set_run_stat');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#set_run_stat">set_run_stat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">new_status</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  126. </div><div id="MidiOutStream.set_run_stat-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.set_run_stat-expanded"><a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"> <tt class="py-docstring">"Set the new running status"</tt> </tt>
  127. <a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_running_status</tt> <tt class="py-op">=</tt> <tt class="py-name">new_status</tt> </tt>
  128. </div><a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"> </tt>
  129. <a name="MidiOutStream.get_run_stat"></a><div id="MidiOutStream.get_run_stat-def"><a name="L72"></a><tt class="py-lineno"> 72</tt> <a class="py-toggle" href="#" id="MidiOutStream.get_run_stat-toggle" onclick="return toggle('MidiOutStream.get_run_stat');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#get_run_stat">get_run_stat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  130. </div><div id="MidiOutStream.get_run_stat-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.get_run_stat-expanded"><a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"> <tt class="py-docstring">"Set the new running status"</tt> </tt>
  131. <a name="L74"></a><tt class="py-lineno"> 74</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_running_status</tt> </tt>
  132. </div><a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"> </tt>
  133. <a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"> <tt class="py-comment"># track handling event handlers</tt> </tt>
  134. <a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"> </tt>
  135. <a name="MidiOutStream.set_current_track"></a><div id="MidiOutStream.set_current_track-def"><a name="L78"></a><tt class="py-lineno"> 78</tt> <a class="py-toggle" href="#" id="MidiOutStream.set_current_track-toggle" onclick="return toggle('MidiOutStream.set_current_track');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#set_current_track">set_current_track</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">new_track</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  136. </div><div id="MidiOutStream.set_current_track-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.set_current_track-expanded"><a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"> <tt class="py-docstring">"Sets the current track number"</tt> </tt>
  137. <a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_current_track</tt> <tt class="py-op">=</tt> <tt class="py-name">new_track</tt> </tt>
  138. </div><a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"> </tt>
  139. <a name="MidiOutStream.get_current_track"></a><div id="MidiOutStream.get_current_track-def"><a name="L82"></a><tt class="py-lineno"> 82</tt> <a class="py-toggle" href="#" id="MidiOutStream.get_current_track-toggle" onclick="return toggle('MidiOutStream.get_current_track');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#get_current_track">get_current_track</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  140. </div><div id="MidiOutStream.get_current_track-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.get_current_track-expanded"><a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"> <tt class="py-docstring">"Returns the current track number"</tt> </tt>
  141. <a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_current_track</tt> </tt>
  142. </div><a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> </tt>
  143. <a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> </tt>
  144. <a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> <tt class="py-comment">#####################</tt> </tt>
  145. <a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> <tt class="py-comment">## Midi events</tt> </tt>
  146. <a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> </tt>
  147. <a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> </tt>
  148. <a name="MidiOutStream.channel_message"></a><div id="MidiOutStream.channel_message-def"><a name="L91"></a><tt class="py-lineno"> 91</tt> <a class="py-toggle" href="#" id="MidiOutStream.channel_message-toggle" onclick="return toggle('MidiOutStream.channel_message');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#channel_message">channel_message</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message_type</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>
  149. </div><div id="MidiOutStream.channel_message-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.channel_message-expanded"><a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-docstring">"""The default event handler for channel messages"""</tt> </tt>
  150. <a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  151. </div><a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> </tt>
  152. <a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> </tt>
  153. <a name="MidiOutStream.note_on"></a><div id="MidiOutStream.note_on-def"><a name="L96"></a><tt class="py-lineno"> 96</tt> <a class="py-toggle" href="#" id="MidiOutStream.note_on-toggle" onclick="return toggle('MidiOutStream.note_on');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#note_on">note_on</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-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">note</tt><tt class="py-op">=</tt><tt class="py-number">0x40</tt><tt class="py-op">,</tt> <tt class="py-param">velocity</tt><tt class="py-op">=</tt><tt class="py-number">0x40</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  154. </div><div id="MidiOutStream.note_on-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.note_on-expanded"><a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> </tt>
  155. <a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  156. <a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  157. <a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"><tt class="py-docstring"> note, velocity: 0-127 </tt> </tt>
  158. <a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  159. <a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  160. </div><a name="L103"></a><tt class="py-lineno">103</tt> <tt class="py-line"> </tt>
  161. <a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> </tt>
  162. <a name="MidiOutStream.note_off"></a><div id="MidiOutStream.note_off-def"><a name="L105"></a><tt class="py-lineno">105</tt> <a class="py-toggle" href="#" id="MidiOutStream.note_off-toggle" onclick="return toggle('MidiOutStream.note_off');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#note_off">note_off</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-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">note</tt><tt class="py-op">=</tt><tt class="py-number">0x40</tt><tt class="py-op">,</tt> <tt class="py-param">velocity</tt><tt class="py-op">=</tt><tt class="py-number">0x40</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  163. </div><div id="MidiOutStream.note_off-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.note_off-expanded"><a name="L106"></a><tt class="py-lineno">106</tt> <tt class="py-line"> </tt>
  164. <a name="L107"></a><tt class="py-lineno">107</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  165. <a name="L108"></a><tt class="py-lineno">108</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  166. <a name="L109"></a><tt class="py-lineno">109</tt> <tt class="py-line"><tt class="py-docstring"> note, velocity: 0-127 </tt> </tt>
  167. <a name="L110"></a><tt class="py-lineno">110</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  168. <a name="L111"></a><tt class="py-lineno">111</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  169. </div><a name="L112"></a><tt class="py-lineno">112</tt> <tt class="py-line"> </tt>
  170. <a name="L113"></a><tt class="py-lineno">113</tt> <tt class="py-line"> </tt>
  171. <a name="MidiOutStream.aftertouch"></a><div id="MidiOutStream.aftertouch-def"><a name="L114"></a><tt class="py-lineno">114</tt> <a class="py-toggle" href="#" id="MidiOutStream.aftertouch-toggle" onclick="return toggle('MidiOutStream.aftertouch');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#aftertouch">aftertouch</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-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">note</tt><tt class="py-op">=</tt><tt class="py-number">0x40</tt><tt class="py-op">,</tt> <tt class="py-param">velocity</tt><tt class="py-op">=</tt><tt class="py-number">0x40</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  172. </div><div id="MidiOutStream.aftertouch-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.aftertouch-expanded"><a name="L115"></a><tt class="py-lineno">115</tt> <tt class="py-line"> </tt>
  173. <a name="L116"></a><tt class="py-lineno">116</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  174. <a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  175. <a name="L118"></a><tt class="py-lineno">118</tt> <tt class="py-line"><tt class="py-docstring"> note, velocity: 0-127 </tt> </tt>
  176. <a name="L119"></a><tt class="py-lineno">119</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  177. <a name="L120"></a><tt class="py-lineno">120</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  178. </div><a name="L121"></a><tt class="py-lineno">121</tt> <tt class="py-line"> </tt>
  179. <a name="L122"></a><tt class="py-lineno">122</tt> <tt class="py-line"> </tt>
  180. <a name="MidiOutStream.continuous_controller"></a><div id="MidiOutStream.continuous_controller-def"><a name="L123"></a><tt class="py-lineno">123</tt> <a class="py-toggle" href="#" id="MidiOutStream.continuous_controller-toggle" onclick="return toggle('MidiOutStream.continuous_controller');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#continuous_controller">continuous_controller</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>
  181. </div><div id="MidiOutStream.continuous_controller-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.continuous_controller-expanded"><a name="L124"></a><tt class="py-lineno">124</tt> <tt class="py-line"> </tt>
  182. <a name="L125"></a><tt class="py-lineno">125</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  183. <a name="L126"></a><tt class="py-lineno">126</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  184. <a name="L127"></a><tt class="py-lineno">127</tt> <tt class="py-line"><tt class="py-docstring"> controller, value: 0-127 </tt> </tt>
  185. <a name="L128"></a><tt class="py-lineno">128</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  186. <a name="L129"></a><tt class="py-lineno">129</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  187. </div><a name="L130"></a><tt class="py-lineno">130</tt> <tt class="py-line"> </tt>
  188. <a name="L131"></a><tt class="py-lineno">131</tt> <tt class="py-line"> </tt>
  189. <a name="MidiOutStream.patch_change"></a><div id="MidiOutStream.patch_change-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="MidiOutStream.patch_change-toggle" onclick="return toggle('MidiOutStream.patch_change');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#patch_change">patch_change</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">patch</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  190. </div><div id="MidiOutStream.patch_change-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.patch_change-expanded"><a name="L133"></a><tt class="py-lineno">133</tt> <tt class="py-line"> </tt>
  191. <a name="L134"></a><tt class="py-lineno">134</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  192. <a name="L135"></a><tt class="py-lineno">135</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  193. <a name="L136"></a><tt class="py-lineno">136</tt> <tt class="py-line"><tt class="py-docstring"> patch: 0-127 </tt> </tt>
  194. <a name="L137"></a><tt class="py-lineno">137</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  195. <a name="L138"></a><tt class="py-lineno">138</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  196. </div><a name="L139"></a><tt class="py-lineno">139</tt> <tt class="py-line"> </tt>
  197. <a name="L140"></a><tt class="py-lineno">140</tt> <tt class="py-line"> </tt>
  198. <a name="MidiOutStream.channel_pressure"></a><div id="MidiOutStream.channel_pressure-def"><a name="L141"></a><tt class="py-lineno">141</tt> <a class="py-toggle" href="#" id="MidiOutStream.channel_pressure-toggle" onclick="return toggle('MidiOutStream.channel_pressure');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#channel_pressure">channel_pressure</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">pressure</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  199. </div><div id="MidiOutStream.channel_pressure-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.channel_pressure-expanded"><a name="L142"></a><tt class="py-lineno">142</tt> <tt class="py-line"> </tt>
  200. <a name="L143"></a><tt class="py-lineno">143</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  201. <a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  202. <a name="L145"></a><tt class="py-lineno">145</tt> <tt class="py-line"><tt class="py-docstring"> pressure: 0-127 </tt> </tt>
  203. <a name="L146"></a><tt class="py-lineno">146</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  204. <a name="L147"></a><tt class="py-lineno">147</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  205. </div><a name="L148"></a><tt class="py-lineno">148</tt> <tt class="py-line"> </tt>
  206. <a name="L149"></a><tt class="py-lineno">149</tt> <tt class="py-line"> </tt>
  207. <a name="MidiOutStream.pitch_bend"></a><div id="MidiOutStream.pitch_bend-def"><a name="L150"></a><tt class="py-lineno">150</tt> <a class="py-toggle" href="#" id="MidiOutStream.pitch_bend-toggle" onclick="return toggle('MidiOutStream.pitch_bend');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#pitch_bend">pitch_bend</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">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  208. </div><div id="MidiOutStream.pitch_bend-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.pitch_bend-expanded"><a name="L151"></a><tt class="py-lineno">151</tt> <tt class="py-line"> </tt>
  209. <a name="L152"></a><tt class="py-lineno">152</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  210. <a name="L153"></a><tt class="py-lineno">153</tt> <tt class="py-line"><tt class="py-docstring"> channel: 0-15 </tt> </tt>
  211. <a name="L154"></a><tt class="py-lineno">154</tt> <tt class="py-line"><tt class="py-docstring"> value: 0-16383 </tt> </tt>
  212. <a name="L155"></a><tt class="py-lineno">155</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
  213. <a name="L156"></a><tt class="py-lineno">156</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  214. <a name="L157"></a><tt class="py-lineno">157</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  215. </div><a name="L158"></a><tt class="py-lineno">158</tt> <tt class="py-line"> </tt>
  216. <a name="L159"></a><tt class="py-lineno">159</tt> <tt class="py-line"> </tt>
  217. <a name="L160"></a><tt class="py-lineno">160</tt> <tt class="py-line"> </tt>
  218. <a name="L161"></a><tt class="py-lineno">161</tt> <tt class="py-line"> </tt>
  219. <a name="L162"></a><tt class="py-lineno">162</tt> <tt class="py-line"> <tt class="py-comment">#####################</tt> </tt>
  220. <a name="L163"></a><tt class="py-lineno">163</tt> <tt class="py-line"> <tt class="py-comment">## System Exclusive</tt> </tt>
  221. <a name="L164"></a><tt class="py-lineno">164</tt> <tt class="py-line"> </tt>
  222. <a name="MidiOutStream.system_exclusive"></a><div id="MidiOutStream.system_exclusive-def"><a name="L165"></a><tt class="py-lineno">165</tt> <a class="py-toggle" href="#" id="MidiOutStream.system_exclusive-toggle" onclick="return toggle('MidiOutStream.system_exclusive');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#system_exclusive">system_exclusive</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>
  223. </div><div id="MidiOutStream.system_exclusive-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.system_exclusive-expanded"><a name="L166"></a><tt class="py-lineno">166</tt> <tt class="py-line"> </tt>
  224. <a name="L167"></a><tt class="py-lineno">167</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  225. <a name="L168"></a><tt class="py-lineno">168</tt> <tt class="py-line"><tt class="py-docstring"> data: list of values in range(128) </tt> </tt>
  226. <a name="L169"></a><tt class="py-lineno">169</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  227. <a name="L170"></a><tt class="py-lineno">170</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  228. </div><a name="L171"></a><tt class="py-lineno">171</tt> <tt class="py-line"> </tt>
  229. <a name="L172"></a><tt class="py-lineno">172</tt> <tt class="py-line"> </tt>
  230. <a name="L173"></a><tt class="py-lineno">173</tt> <tt class="py-line"> <tt class="py-comment">#####################</tt> </tt>
  231. <a name="L174"></a><tt class="py-lineno">174</tt> <tt class="py-line"> <tt class="py-comment">## Common events</tt> </tt>
  232. <a name="L175"></a><tt class="py-lineno">175</tt> <tt class="py-line"> </tt>
  233. <a name="MidiOutStream.song_position_pointer"></a><div id="MidiOutStream.song_position_pointer-def"><a name="L176"></a><tt class="py-lineno">176</tt> <a class="py-toggle" href="#" id="MidiOutStream.song_position_pointer-toggle" onclick="return toggle('MidiOutStream.song_position_pointer');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#song_position_pointer">song_position_pointer</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  234. </div><div id="MidiOutStream.song_position_pointer-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.song_position_pointer-expanded"><a name="L177"></a><tt class="py-lineno">177</tt> <tt class="py-line"> </tt>
  235. <a name="L178"></a><tt class="py-lineno">178</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  236. <a name="L179"></a><tt class="py-lineno">179</tt> <tt class="py-line"><tt class="py-docstring"> value: 0-16383 </tt> </tt>
  237. <a name="L180"></a><tt class="py-lineno">180</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  238. <a name="L181"></a><tt class="py-lineno">181</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  239. </div><a name="L182"></a><tt class="py-lineno">182</tt> <tt class="py-line"> </tt>
  240. <a name="L183"></a><tt class="py-lineno">183</tt> <tt class="py-line"> </tt>
  241. <a name="MidiOutStream.song_select"></a><div id="MidiOutStream.song_select-def"><a name="L184"></a><tt class="py-lineno">184</tt> <a class="py-toggle" href="#" id="MidiOutStream.song_select-toggle" onclick="return toggle('MidiOutStream.song_select');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#song_select">song_select</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">songNumber</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  242. </div><div id="MidiOutStream.song_select-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.song_select-expanded"><a name="L185"></a><tt class="py-lineno">185</tt> <tt class="py-line"> </tt>
  243. <a name="L186"></a><tt class="py-lineno">186</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  244. <a name="L187"></a><tt class="py-lineno">187</tt> <tt class="py-line"><tt class="py-docstring"> songNumber: 0-127 </tt> </tt>
  245. <a name="L188"></a><tt class="py-lineno">188</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  246. <a name="L189"></a><tt class="py-lineno">189</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  247. </div><a name="L190"></a><tt class="py-lineno">190</tt> <tt class="py-line"> </tt>
  248. <a name="L191"></a><tt class="py-lineno">191</tt> <tt class="py-line"> </tt>
  249. <a name="MidiOutStream.tuning_request"></a><div id="MidiOutStream.tuning_request-def"><a name="L192"></a><tt class="py-lineno">192</tt> <a class="py-toggle" href="#" id="MidiOutStream.tuning_request-toggle" onclick="return toggle('MidiOutStream.tuning_request');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#tuning_request">tuning_request</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  250. </div><div id="MidiOutStream.tuning_request-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.tuning_request-expanded"><a name="L193"></a><tt class="py-lineno">193</tt> <tt class="py-line"> </tt>
  251. <a name="L194"></a><tt class="py-lineno">194</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  252. <a name="L195"></a><tt class="py-lineno">195</tt> <tt class="py-line"><tt class="py-docstring"> No values passed </tt> </tt>
  253. <a name="L196"></a><tt class="py-lineno">196</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  254. <a name="L197"></a><tt class="py-lineno">197</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  255. </div><a name="L198"></a><tt class="py-lineno">198</tt> <tt class="py-line"> </tt>
  256. <a name="L199"></a><tt class="py-lineno">199</tt> <tt class="py-line"> </tt>
  257. <a name="MidiOutStream.midi_time_code"></a><div id="MidiOutStream.midi_time_code-def"><a name="L200"></a><tt class="py-lineno">200</tt> <a class="py-toggle" href="#" id="MidiOutStream.midi_time_code-toggle" onclick="return toggle('MidiOutStream.midi_time_code');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#midi_time_code">midi_time_code</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">msg_type</tt><tt class="py-op">,</tt> <tt class="py-param">values</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  258. </div><div id="MidiOutStream.midi_time_code-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.midi_time_code-expanded"><a name="L201"></a><tt class="py-lineno">201</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  259. <a name="L202"></a><tt class="py-lineno">202</tt> <tt class="py-line"><tt class="py-docstring"> msg_type: 0-7 </tt> </tt>
  260. <a name="L203"></a><tt class="py-lineno">203</tt> <tt class="py-line"><tt class="py-docstring"> values: 0-15 </tt> </tt>
  261. <a name="L204"></a><tt class="py-lineno">204</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  262. <a name="L205"></a><tt class="py-lineno">205</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  263. </div><a name="L206"></a><tt class="py-lineno">206</tt> <tt class="py-line"> </tt>
  264. <a name="L207"></a><tt class="py-lineno">207</tt> <tt class="py-line"> </tt>
  265. <a name="L208"></a><tt class="py-lineno">208</tt> <tt class="py-line"> <tt class="py-comment">#########################</tt> </tt>
  266. <a name="L209"></a><tt class="py-lineno">209</tt> <tt class="py-line"> <tt class="py-comment"># header does not really belong here. But anyhoo!!!</tt> </tt>
  267. <a name="L210"></a><tt class="py-lineno">210</tt> <tt class="py-line"> </tt>
  268. <a name="MidiOutStream.header"></a><div id="MidiOutStream.header-def"><a name="L211"></a><tt class="py-lineno">211</tt> <a class="py-toggle" href="#" id="MidiOutStream.header-toggle" onclick="return toggle('MidiOutStream.header');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-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-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">nTracks</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-param">division</tt><tt class="py-op">=</tt><tt class="py-number">96</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  269. </div><div id="MidiOutStream.header-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.header-expanded"><a name="L212"></a><tt class="py-lineno">212</tt> <tt class="py-line"> </tt>
  270. <a name="L213"></a><tt class="py-lineno">213</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  271. <a name="L214"></a><tt class="py-lineno">214</tt> <tt class="py-line"><tt class="py-docstring"> format: type of midi file in [1,2] </tt> </tt>
  272. <a name="L215"></a><tt class="py-lineno">215</tt> <tt class="py-line"><tt class="py-docstring"> nTracks: number of tracks </tt> </tt>
  273. <a name="L216"></a><tt class="py-lineno">216</tt> <tt class="py-line"><tt class="py-docstring"> division: timing division </tt> </tt>
  274. <a name="L217"></a><tt class="py-lineno">217</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  275. <a name="L218"></a><tt class="py-lineno">218</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  276. </div><a name="L219"></a><tt class="py-lineno">219</tt> <tt class="py-line"> </tt>
  277. <a name="L220"></a><tt class="py-lineno">220</tt> <tt class="py-line"> </tt>
  278. <a name="MidiOutStream.eof"></a><div id="MidiOutStream.eof-def"><a name="L221"></a><tt class="py-lineno">221</tt> <a class="py-toggle" href="#" id="MidiOutStream.eof-toggle" onclick="return toggle('MidiOutStream.eof');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-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>
  279. </div><div id="MidiOutStream.eof-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.eof-expanded"><a name="L222"></a><tt class="py-lineno">222</tt> <tt class="py-line"> </tt>
  280. <a name="L223"></a><tt class="py-lineno">223</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  281. <a name="L224"></a><tt class="py-lineno">224</tt> <tt class="py-line"><tt class="py-docstring"> End of file. No more events to be processed. </tt> </tt>
  282. <a name="L225"></a><tt class="py-lineno">225</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
  283. <a name="L226"></a><tt class="py-lineno">226</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
  284. </div><a name="L227"></a><tt class="py-lineno">227</tt> <tt class="py-line"> </tt>
  285. <a name="L228"></a><tt class="py-lineno">228</tt> <tt class="py-line"> </tt>
  286. <a name="L229"></a><tt class="py-lineno">229</tt> <tt class="py-line"> <tt class="py-comment">#####################</tt> </tt>
  287. <a name="L230"></a><tt class="py-lineno">230</tt> <tt class="py-line"> <tt class="py-comment">## meta events</tt> </tt>
  288. <a name="L231"></a><tt class="py-lineno">231</tt> <tt class="py-line"> </tt>
  289. <a name="L232"></a><tt class="py-lineno">232</tt> <tt class="py-line"> </tt>
  290. <a name="MidiOutStream.meta_event"></a><div id="MidiOutStream.meta_event-def"><a name="L233"></a><tt class="py-lineno">233</tt> <a class="py-toggle" href="#" id="MidiOutStream.meta_event-toggle" onclick="return toggle('MidiOutStream.meta_event');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.support.midi.MidiOutStream.MidiOutStream-class.html#meta_event">meta_event</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">meta_type</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
  291. </div><div id="MidiOutStream.meta_event-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="MidiOutStream.meta_event-expanded"><a name="L234"></a><tt class="py-lineno">234</tt> <tt class="py-line"> </tt>
  292. <a name="L235"></a><tt class="py-lineno">235</tt> <tt class="py-line"> <tt class="py-docstring">""" </tt> </tt>
  293. <a name="L236"></a><tt class="py-lineno">236</tt> <tt class="py-line"><tt class="py-docstring"> Handles any undefined meta events </tt> </tt>
  294. <a name="L237"></a><tt class="py-lineno">237</tt> <tt class="py-line"><tt