Browse Source

Add global staff size to lilypond properties and metadata

master
Nils 4 months ago
parent
commit
ab2f6251d5
  1. 1
      engine/lilypond.py
  2. 3
      engine/main.py
  3. 2
      engine/resources/lilypondTemplates/default.ly

1
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"]) + '"')

3
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()

2
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 {

Loading…
Cancel
Save