title: How to convert music file in ABC notation to midi or mp3 in Python
body: <p>I have abc notation file and I want to convert it to midi or mp3 format.</p>
  <p>I did find <a href="https://pypi.org/project/music21/" rel="nofollow noreferrer">music21</a> <a href="https://web.mit.edu/music21/doc/moduleReference/moduleConverter.html" rel="nofollow noreferrer">(docs)</a>  library to that says it can convert abc to midi but I could not figure out how.</p>
  <p>I also found a website <a href="https://www.mandolintab.net/abcconverter.php" rel="nofollow noreferrer">mandolintab</a> that can convert the file below to midi. I am looking to do the same in python.</p>
  <p>Can some one Help?</p>
  <pre><code>p6
    E  (G/A/) \
  | eAFE ~Ez | D2 zB AG | E2  EE        ED   |
          EE   E2   | (EA) A2   | Ac          ef   | g2 fe         | (e3 d) ec |
  d2 BA Bd | c2 BA ^c/d/ | e2 A/A/ cA/A/ | Ad     c2  ||
  ((3c/d/e/)) | f2 ff e2 dc | d^c de f2 (gf/e/) | f2 ed cAGE | F2 D2 D2 ((3ABc)|
            dcdA GFGB | Adfe   dcAc | dcde    fedc | A2 A&gt;G A2    :|
  
  
  X:1758
  T:The Sirit Peallow
  M:C|
  L:1/8
  N:&quot;collected by J. O'Neill&quot;
  B:O'Neill's 1429
  Z:&quot;Transcribed by Bob Safranek, rjs@gsp.org&quot;
  K:D
  (D | F)ABA    FAFD  | (F2{A}GF) DFAF | DEFE DEFD | EFAF DFAF |
  dD ((3DDD) (FA) BcdF|   E2 ((3EFG) A2    ||
         d2  (fd) cBAG | F2 (AG) FDAD | ((3FED) (AD) CEEG    |    FEFG AB G2 :|
  ((3fgf) (df) (ed) B2 |  A2 (Ac)      BcdB   | Adfa    gfe^d | e2 (ae) fedc |
         BGDF   GABc  d2 (ga) | ((3fga) (fd) efge | ((3fga) (ec)
  </code></pre>