Browse Source

slightly better lilypond export indent

master
Nils 2 years ago
parent
commit
9b041dec8c
  1. 2
      engine/api.py
  2. 3
      engine/block.py
  3. 2
      engine/items.py
  4. 4
      engine/track.py

2
engine/api.py

@ -1750,7 +1750,7 @@ def insertCommonMetricalInstrucions(scheme):
"3/2" : (D2, D2, D2),
}
lilypond = {
"off" : "\\mark \"X\" \\cadenzaOn ",
"off" : "\\mark \"X\" \\cadenzaOn",
"2/4" : "\\cadenzaOff \\time 2/4",
"3/4" : "\\cadenzaOff \\time 3/4",
"4/4" : "\\cadenzaOff \\time 4/4",

3
engine/block.py

@ -349,5 +349,4 @@ class Block(object):
such as tuplets.
Can act like a stack or simply remember stuff.
"""
return " ".join(item.lilypond(carryLilypondRanges) for item in self.data)
return "\n % Block: " + self.name + "\n " + " ".join(item.lilypond(carryLilypondRanges) for item in self.data)

2
engine/items.py

@ -2411,7 +2411,7 @@ class MetricalInstruction(Item):
if not type(value) is int:
raise ValueError("Only integers are allowed in a metrical instruction. You used {}. Cast to int if you are sure your float is x.0, e.g. in a dotted quarter note created by D4*1.5".format(value))
self.treeOfInstructions = treeOfInstructions #if you skipped the docstring. this is a 4/4: ((D4, D4), (D4, D4)) . If empty no barlines will get drawn
self.treeOfInstructions = treeOfInstructions #this is a 4/4: ((D4, D4), (D4, D4)) . If empty no barlines will get drawn
self.isMetrical = isMetrical #If False all dynamic playback modifications based on the metre will be deactivated but barlines will still be created. This is forced to become false when the treeOfInstructions is 0 ticks.
self._secondInit(parentBlock = None) #see Item._secondInit.

4
engine/track.py

@ -826,7 +826,7 @@ class Track(object):
timeSig = ""
break
else:
timeSig = "\\once \\override Staff.TimeSignature #'stencil = ##f \\cadenzaOn "
timeSig = "\\once \\override Staff.TimeSignature #'stencil = ##f \\cadenzaOn\n"
carryLilypondRanges = {} #handed from item to item for ranges such as tuplets. Can act like a stack or simply remember stuff.
@ -835,7 +835,7 @@ class Track(object):
data = " ".join(block.lilypond(carryLilypondRanges) for block in self.blocks)
if data:
return timeSig + upbeatLy + data
return timeSig + upbeatLy + data + "\n"
else:
return ""

Loading…
Cancel
Save