Mercurial > ~darius > hgwebdir.cgi > musiccutter
comparison musiccutter.py @ 18:cf93a76eda92
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.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Wed, 20 Apr 2016 08:38:38 +0930 |
parents | c50427f1da2d |
children | ffaf97818ce3 |
comparison
equal
deleted
inserted
replaced
17:c50427f1da2d | 18:cf93a76eda92 |
---|---|
95 Midi2PDF.textHelper(pdf, 25 * mm, 1 * mm, ENGRAVE_COLOUR, True, self.fontname, self.fontsize, '%s (%d / %d)' % (title, pindx + 1, npages)) | 95 Midi2PDF.textHelper(pdf, 25 * mm, 1 * mm, ENGRAVE_COLOUR, True, self.fontname, self.fontsize, '%s (%d / %d)' % (title, pindx + 1, npages)) |
96 | 96 |
97 pdf.saveState() # Not really necessary since this is last thing we do | 97 pdf.saveState() # Not really necessary since this is last thing we do |
98 pdf.setLineWidth(0) | 98 pdf.setLineWidth(0) |
99 | 99 |
100 # Draw time marks | |
101 if False: | |
102 tstart = 0 | |
103 tend = (self.pagewidth - self.lmargin) / self.timescale | |
104 if pindx > 0: | |
105 tsize = self.pagewidth / self.timescale | |
106 tstart = tend + tsize * pindx | |
107 tend = tend + tsize * (pindx + 1) | |
108 for s in range(tstart, tend, 5): | |
109 x = float(s * self.timescale + self.lmargin) % self.pagewidth | |
110 pdf.line(x * mm, self.offset, x * mm, self.pageheight * mm) | |
111 Midi2PDF.textHelper(pdf, x * mm, 1 * mm, ENGRAVE_COLOUR, False, self.fontname, self.fontsize, str(s) + 's') | |
112 | |
113 # Draw rectangle around page | |
114 if False: | |
115 pdf.rect(0, 0, self.pagewidth * mm, self.pageheight * mm, fill = False, stroke = True) | |
116 pdf.line(0, 0, 0, self.pagewidth * mm) | |
117 pdf.line(0, self.pagewidth * mm, self.pagewidth * mm, self.pageheight * mm) | |
118 pdf.line(self.pagewidth * mm, self.pageheight * mm, 0, self.pageheight * mm) | |
119 pdf.line(0, self.pageheight * mm, 0, 0) | |
120 | |
100 # Draw lines per note | 121 # Draw lines per note |
101 for slot in sorted(self.slot2note.keys()): | 122 for slot in sorted(self.slot2note.keys()): |
102 ofs = (self.offset + slot * self.pitch) * mm | 123 ofs = (self.offset + slot * self.pitch) * mm |
103 pdf.line(0, ofs, self.pagewidth * mm, ofs) | 124 pdf.line(0, ofs, self.pagewidth * mm, ofs) |
104 # Note name | 125 # Note name |