# HG changeset patch # User Daniel O'Connor # Date 1457324197 -37800 # Node ID 49a33c431b452e5d359c498879d0cb2f058cf972 # Parent b1aac55d2864b79e71eb7b892fddfbffea4bc352 Accept filename for test function diff -r b1aac55d2864 -r 49a33c431b45 musiccutter.py --- 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():