changeset 3:49a33c431b45

Accept filename for test function
author Daniel O'Connor <darius@dons.net.au>
date Mon, 07 Mar 2016 14:46:37 +1030
parents b1aac55d2864
children 9f4fa5f231e6
files musiccutter.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/musiccutter.py	Sun Mar 06 22:43:28 2016 +1030
+++ b/musiccutter.py	Mon Mar 07 14:46:37 2016 +1030
@@ -5,12 +5,14 @@
 import svgwrite
 import sys
 
-def test():
+def test(filename = None):
     # http://www.orgues-de-barbarie.com/wp-content/uploads/2014/09/format-cartons.pdf
     conf = { 'notefile' : 'notes', 'pitch' : 5.5 , 'pagewidth' : 20, 'pageheight' : 15.5 }
     midi2note, note2midi = genmidi2note()
     note2slot = loadnote2slot(conf['notefile'], note2midi)
-    midi2svg('test.midi', 'test%d.svg', conf['pitch'], midi2note, note2midi, note2slot, conf['pagewidth'], conf['pageheight'])
+    if filename == None:
+        filename = 'test.midi'
+    midi2svg(filename, 'test%d.svg', conf['pitch'], midi2note, note2midi, note2slot, conf['pagewidth'], conf['pageheight'])
 
 # http://www.electronics.dit.ie/staff/tscarff/Music_technology/midi/midi_note_numbers_for_octaves.htm
 def genmidi2note():