~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to share/scripts/DoubleSpeed

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-08-12 11:16:41 UTC
  • mto: (1.1.9) (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20110812111641-72iatqb9jomjejko
ImportĀ upstreamĀ versionĀ 2.0~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
# MusE external midi processing script
 
4
# By: Mathias Gyllengahm 2009
 
5
# DoubleSpeed
 
6
 
 
7
import sys,time
 
8
testFile = file(sys.argv[1],"r")
 
9
inputEvents = testFile.readlines()
 
10
testFile.close()
 
11
 
 
12
outputEvents=[]
 
13
#loop through events
 
14
for line in inputEvents:
 
15
 
 
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)
 
20
 
 
21
testFile = file(sys.argv[1],"w")
 
22
testFile.writelines(outputEvents)
 
23
testFile.close()
 
24