|
|
@ -1757,6 +1757,17 @@ class Chord(Item): |
|
|
|
pass |
|
|
|
return pre |
|
|
|
|
|
|
|
#Do we have a dynamic signature waiting? (convert laborejo prefix to lilypond postfix) |
|
|
|
#They belong after the duration. |
|
|
|
if "DynamicSignature" in carryLilypondRanges: |
|
|
|
dynsig = carryLilypondRanges["DynamicSignature"] |
|
|
|
del carryLilypondRanges["DynamicSignature"] |
|
|
|
else: |
|
|
|
dynsig = "" |
|
|
|
|
|
|
|
#Do we have a slur signature waiting? (convert laborejo prefix to lilypond postfix) |
|
|
|
|
|
|
|
|
|
|
|
#Create lilypond durations |
|
|
|
pitches, durations = zip(*(note.lilypond(carryLilypondRanges) for note in self.notelist)) |
|
|
|
onlyOneDuration = durations.count(durations[0]) == len(durations) |
|
|
@ -1765,10 +1776,10 @@ class Chord(Item): |
|
|
|
tupletSubstring = _createLilypondTuplet(self.notelist[0].duration, carryLilypondRanges) |
|
|
|
if len(pitches) == 1: |
|
|
|
# The most common case: Just a single note |
|
|
|
return tupletSubstring + pitches[0] + durations[0] #this is a string. |
|
|
|
return tupletSubstring + pitches[0] + durations[0] + dynsig #this is a string. |
|
|
|
else: |
|
|
|
# A simple chord with mulitple pitches but just one duration |
|
|
|
return tupletSubstring + "<" + " ".join(pitches) + ">" + durations[0] |
|
|
|
return tupletSubstring + "<" + " ".join(pitches) + ">" + durations[0] + dynsig |
|
|
|
else: |
|
|
|
#TODO: Cache this |
|
|
|
|
|
|
@ -1798,7 +1809,7 @@ class Chord(Item): |
|
|
|
substrings.append("\\\\ { <" + " ".join(lst) + ">" + dur + " }" ) |
|
|
|
|
|
|
|
tupletSubstring = _createLilypondTuplet(self.durationGroup, carryLilypondRanges) |
|
|
|
result = tupletSubstring + "<<" + " ".join(substrings) + ">>" |
|
|
|
result = tupletSubstring + "<<" + " ".join(substrings) + dynsig + ">>" |
|
|
|
return result |
|
|
|
|
|
|
|
class Rest(Item): |
|
|
@ -2562,6 +2573,15 @@ class DynamicSignature(Item): |
|
|
|
"UIstring" : self.keyword, |
|
|
|
} |
|
|
|
|
|
|
|
def _lilypond(self, carryLilypondRanges): |
|
|
|
""" |
|
|
|
Lilypond Dynamics are postfix. |
|
|
|
|
|
|
|
Don't export anything directly, but add the dynamic keyword to the lilypond ranges dict |
|
|
|
so the next chord can use it as postfix. """ |
|
|
|
carryLilypondRanges["DynamicSignature"] = f"\\{self.keyword}" |
|
|
|
return "" |
|
|
|
|
|
|
|
class DynamicRamp(Item): |
|
|
|
"""The class for "cresc", "decresc" and so on. |
|
|
|
It takes the current trackState as starting point and |
|
|
|