Create midifile.py

write midi function