2
# -*- coding: utf-8 -*-
3
# MusE external midi processing script
4
# By: Mathias Gyllengahm 2009
8
testFile = file(sys.argv[1],"r")
9
inputEvents = testFile.readlines()
14
for line in inputEvents:
16
if line.startswith('NOTE'):
17
tag,tick,pitch,length,velocity = line.split(' ')
18
newline = tag + " " + str(int(tick)/2) + " " + pitch + " " + length + " " + velocity
19
outputEvents.append(newline)
21
testFile = file(sys.argv[1],"w")
22
testFile.writelines(outputEvents)