title: Converting a midi file to Snap! XML file
body: <p>I need help with something involving a python script that converts a midi file into a XML file that Snap! can read. The only issue is, is that the extension that I am using to read the midi file doesn't like me using the note attribute (mido). Here's my python script so far:</p>
  <pre><code>import mido
  from mido import MidiFile
  for cNote in MidiFile('HSSWake.mid').play():
  output = &quot;&lt;block s=\&quot;doPlayNote\&quot;&gt;&lt;l&gt;&quot; + str(cNote.note) + &quot;&lt;/l&gt;&lt;l&gt;&quot; + str(cNote.time) + &quot;&lt;/l&gt;&lt;/block&gt;&quot;
  
  print(output)
  input(&quot;&quot;) #Pause the program
  </code></pre>
  <p>It says <code>&quot;Message&quot; object has no attribute 'note'</code> which is not true since the 'note' attribute is in the documentation. Either I need to make an extension to the module, or I will abandon this since I don't know any more modules that could help.</p>
  <p>Edit: Here's the midi that I'm using: <a href="https://mega.nz/file/Pk0SUZbT#aJm1U3ZqKvmBcolGk87j72URduBbvrKEo1Aic5gFH6w" rel="nofollow noreferrer">https://mega.nz/file/Pk0SUZbT#aJm1U3ZqKvmBcolGk87j72URduBbvrKEo1Aic5gFH6w</a></p>