Make a bundle reopenable, and number slices
A bundle was a one-way trip. The slice images are output and the cuts that produced them lived only in the producer's own project file, so a bundle someone handed you meant cutting the score again from scratch. The manifest now carries the geometry, in a `source` block: per page the cut polylines, skew, levels and content rectangle, all in normalised coordinates so they survive any render resolution, and per slice the page and slot it came from. Discards are stated by omission — a slot no slice claims was discarded — since shipping a discarded slice's image would defeat discarding it. `noteman-slicer open song.zip` unpacks the archived PDF, rebuilds the project from that geometry, restores markers, engravings and the title block, and opens the editor. Jump destinations go back from an array index to the (page, slot) the editor works in. The images in the zip are discarded: the PDF is what the pipeline renders from. Re-exporting a reopened bundle reproduces its manifest exactly. It refuses to overwrite a PDF or project file already sitting there, because the obvious place to unpack is where someone's unfinished cuts live. Separately, every slice can now carry the measure it starts at, not just a re-engraved one — a scanned system is numbered in the score the same way, and noteman wants to answer "take it from bar 33" about either. It moves off the replacement onto the page, alongside markers and discards, and out of the bundle's engraving object onto the slice.
This commit is contained in:
@@ -94,7 +94,7 @@ _PREAMBLE = """\\version "2.24.0"
|
||||
"""
|
||||
|
||||
|
||||
def generate(replacement, key: str, time: str) -> str:
|
||||
def generate(replacement, key: str, time: str, bar: int | None = None) -> str:
|
||||
"""Build LilyPond source from a slice's structured replacement.
|
||||
|
||||
The time signature is used for spacing and bar checks but not printed
|
||||
@@ -111,9 +111,9 @@ def generate(replacement, key: str, time: str) -> str:
|
||||
# printed score numbers its systems. The empty bar line is what gives the
|
||||
# number a line beginning to attach to.
|
||||
number = ""
|
||||
if replacement.bar:
|
||||
if bar:
|
||||
number = (
|
||||
f" \\set Score.currentBarNumber = #{int(replacement.bar)}\n"
|
||||
f" \\set Score.currentBarNumber = #{int(bar)}\n"
|
||||
" \\override Score.BarNumber.break-visibility = #'#(#f #f #t)\n"
|
||||
' \\bar ""\n'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user