title: Playing note with pygame.midi
body: <p>I'm trying to play a sound with the pygame.midi module. Here is the code I
  use :</p>
  
  <pre><code>#!/usr/bin/env python
  
  import pygame.midi
  import time
  
  pygame.midi.init()
  
  print pygame.midi.get_default_output_id()
  print pygame.midi.get_device_info(0)
  
  player = pygame.midi.Output(0)
  
  player.set_instrument(0)
  
  print 'Playing...'
  
  player.note_on(64)
  time.sleep(1)
  player.note_off(64)
  
  print 'Played'
  
  pygame.midi.quit()
  </code></pre>
  
  <p>I've found similar codes while searching for exemples, here is the output :</p>
  
  <blockquote>
    <p>0</p>
    
    <p>('ALSA', 'Midi Through Port-0', 0, 1, 0)</p>
    
    <p>Playing...</p>
    
    <p>Played</p>
    
    <p>PortMidi call failed...</p>
    
    <p>PortMidi: `Bad pointer'</p>
    
    <p>type ENTER...</p>
  </blockquote>
  
  <p>No sound is played, and I didn't find any info about the PortMidi error which
  occurs surprisingly after pygame.midi quits.</p>
  
  <p>Do you have any idea? I'm running an debian-based linux distribution if that
  can help.</p>