Skip to content

Commit

Permalink
gridly: Formatting for gridCompileCell filenames
Browse files Browse the repository at this point in the history
This commit is a follow-up of 814e195.
Now the "segment id" part of files compiled with gridCompileCell is
padded with zeroes to the length of the longest segment-id string. Thus
the cell of "soprano 4" in a grid with 100 segments, when compiled with
gridCompileCell, will produce the following pdf file

  soprano-004.pdf
  • Loading branch information
Cecca committed Feb 26, 2015
1 parent 2e951db commit 8450caa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ly/gridly/__main__.ily
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,17 @@ gridGetLyrics =
'elements lyrics))))

#(define (format-cell-file-name parser part segment)
(format "~a-~a-~a"
(ly:parser-output-name parser)
part
segment))
(let* ((max-segment-str-len (string-length
(number->string
(hash-ref music-grid-meta #:segments))))
(segment-format-str (string-append "~"
(number->string max-segment-str-len)
",,,'0@a"))
(segment-str (format segment-format-str segment)))
(format "~a-~a-~a"
(ly:parser-output-name parser)
part
segment-str)))

gridCompileCell =
#(define-void-function
Expand Down

0 comments on commit 8450caa

Please sign in to comment.