for el in s.recurse():
    if 'Instrument' in el.classes:
        el.activeSite.replace(el, instrument.Violin())
s.write('midi', '/Users/cuthbert/Desktop/newfilename.mid')
How do I read a midi file, change its instrument, and write it back?