title: How do I read a midi file, change its instrument, and write it back?
body: <p>I want to parse an already existing .mid file, change its instrument, from 'acoustic grand piano' to 'violin' for example, and save it back or as another .mid file. </p>
  
  <p>From what I saw in the documentation, the instrument gets altered with a <code>program_change</code> or <code>patch_change</code> directive but I cannot find any library that does this in MIDI files that exist already. They all seem to support it only MIDI files created from scratch.</p>