# HG changeset patch # User Daniel O'Connor # Date 1464008907 -34200 # Node ID 86622ba474e4b7b02bf4418c48f7ee736bc49d39 # Parent 9e8ed92b477c9273d4932eff3290928e2fb19da7 add some comments diff -r 9e8ed92b477c -r 86622ba474e4 musiccutter.py --- a/musiccutter.py Mon May 23 22:35:44 2016 +0930 +++ b/musiccutter.py Mon May 23 22:38:27 2016 +0930 @@ -104,6 +104,7 @@ channels[ev.channel][ev.note] = ctime elif ev.type == 'note_off' or (ev.type == 'note_on' and ev.velocity == 0): if ev.note not in channels[ev.channel]: + # These can be rests (iWriteMusic) print 'note_off with no corresponding note_on at %.1f sec for channel %d note %d' % (ctime, ev.channel, ev.note) continue else: @@ -133,6 +134,7 @@ print 'Transpose down:', stats.transposedowncount print 'Transpose up:', stats.transposeupcount + # Do per-page things for pindx in range(npages): pdf = pdfs[pindx / self.pagesperpdf] # PDF for this page # Offset into PDF where the page starts @@ -185,11 +187,13 @@ return slot + # Check if the organ can play the note def transposenote(self, evw, amount): evw.ev.note += amount evw.notename = self.midi2note[evw.ev.note] evw.slot = self.note2slot[evw.notename] + # Work out which slot to use for the note, transpose if desired def getslotfornote(self, evw, stats, ctime): evw.slot = None evw.notename = None