From ab2f6251d5b97546dfd7e87ddb8910ffc6571e0e Mon Sep 17 00:00:00 2001 From: Nils Date: Mon, 15 Aug 2022 10:51:39 +0200 Subject: [PATCH] Add global staff size to lilypond properties and metadata --- engine/lilypond.py | 1 + engine/main.py | 3 +++ engine/resources/lilypondTemplates/default.ly | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/lilypond.py b/engine/lilypond.py index 0cc69c7..1fded31 100644 --- a/engine/lilypond.py +++ b/engine/lilypond.py @@ -129,6 +129,7 @@ def fromTemplate(session, data, meta, tempoStaff): templateString = f.read() templateString = templateString.replace("%$$DATE$$", da.today().strftime("%A %d. %B %Y")) #The current date + templateString = templateString.replace("%$$GLOBAL-STAFF-SIZE$$", str(meta["global-staff-size"])) templateString = templateString.replace("%$$FILENAME$$", session.sessionPrefix) templateString = templateString.replace("%$$HEADER$$", processMeta(meta)) templateString = templateString.replace("%$$SUBTEXT$$", '"' + lilyfy(meta["subtext"]) + '"') diff --git a/engine/main.py b/engine/main.py index 6c66bf9..fb63822 100644 --- a/engine/main.py +++ b/engine/main.py @@ -49,6 +49,7 @@ class Data(template.engine.sequencer.Score): self.metaData["metronome"] = True #show metronome in printout? v2.1.0 self.metaData["transposition"] = "c c" # Whole score transposition for Lilypond. v2.2.0 self.metaData["template-file"] = "" # Lilypond Template file. If empty use default.ly . v2.2.0 + self.metaData["global-staff-size"] = 18 # ly scaling . v2.2.1 self.currentMetronomeTrack = self.tracks[0] #A Laborejo Track, indepedent of currentTrack. The metronome is in self.metronome, set by the template Score. self._processAfterInit() @@ -1123,6 +1124,8 @@ class Data(template.engine.sequencer.Score): self.metaData["transposition"] = "c c" #replicate __init__ default if not "template-file" in self.metaData: #2.2.0 self.metaData["template-file"] = "" #replicate __init__ default + if not "global-staff-size" in self.metaData: #2.2.1 + self.metaData["global-staff-size"] = 18 #replicate __init__ default self.currentMetronomeTrack = self.tracks[serializedData["currentMetronomeTrackIndex"]] self._processAfterInit() diff --git a/engine/resources/lilypondTemplates/default.ly b/engine/resources/lilypondTemplates/default.ly index fced5a6..9e15f28 100644 --- a/engine/resources/lilypondTemplates/default.ly +++ b/engine/resources/lilypondTemplates/default.ly @@ -4,7 +4,7 @@ \version "2.22" #(set-default-paper-size "a4") -#(set-global-staff-size 18 ) +#(set-global-staff-size %$$GLOBAL-STAFF-SIZE$$ ) #(ly:set-option 'point-and-click #f) \paper {