# HG changeset patch # User Daniel O'Connor # Date 1461107318 -34200 # Node ID cf93a76eda92611e32728c5f5d270e671c021996 # Parent c50427f1da2d6b1670235e4a4170349cde346dac The laser cutter software barfs on these lines and stops processing the PDF (but doesn't emit any errors!) so just if them out for now. diff -r c50427f1da2d -r cf93a76eda92 musiccutter.py --- a/musiccutter.py Wed Apr 20 08:35:44 2016 +0930 +++ b/musiccutter.py Wed Apr 20 08:38:38 2016 +0930 @@ -97,6 +97,27 @@ pdf.saveState() # Not really necessary since this is last thing we do pdf.setLineWidth(0) + # Draw time marks + if False: + tstart = 0 + tend = (self.pagewidth - self.lmargin) / self.timescale + if pindx > 0: + tsize = self.pagewidth / self.timescale + tstart = tend + tsize * pindx + tend = tend + tsize * (pindx + 1) + for s in range(tstart, tend, 5): + x = float(s * self.timescale + self.lmargin) % self.pagewidth + pdf.line(x * mm, self.offset, x * mm, self.pageheight * mm) + Midi2PDF.textHelper(pdf, x * mm, 1 * mm, ENGRAVE_COLOUR, False, self.fontname, self.fontsize, str(s) + 's') + + # Draw rectangle around page + if False: + pdf.rect(0, 0, self.pagewidth * mm, self.pageheight * mm, fill = False, stroke = True) + pdf.line(0, 0, 0, self.pagewidth * mm) + pdf.line(0, self.pagewidth * mm, self.pagewidth * mm, self.pageheight * mm) + pdf.line(self.pagewidth * mm, self.pageheight * mm, 0, self.pageheight * mm) + pdf.line(0, self.pageheight * mm, 0, 0) + # Draw lines per note for slot in sorted(self.slot2note.keys()): ofs = (self.offset + slot * self.pitch) * mm