diff options
Diffstat (limited to 'instruments')
-rw-r--r-- | instruments/instrument.py | 1 | ||||
-rw-r--r-- | instruments/piano.py | 15 |
2 files changed, 11 insertions, 5 deletions
diff --git a/instruments/instrument.py b/instruments/instrument.py index 3d3f3fc..e4653a1 100644 --- a/instruments/instrument.py +++ b/instruments/instrument.py @@ -60,6 +60,7 @@ class Instrument: y0=y0) accolade_cr.transform(matrix) self.svg.render_cairo(accolade_cr) + accolade_cr.clip() def guess_height(self, linespace): return len(self.staves) * linespace * 9 diff --git a/instruments/piano.py b/instruments/piano.py index 8bb975c..1be56fd 100644 --- a/instruments/piano.py +++ b/instruments/piano.py @@ -20,6 +20,7 @@ from gettext import gettext as _ +from staff import Beat from staff import Staff from instrument import Instrument import clef @@ -30,10 +31,14 @@ class Piano(Instrument): def __init__(self): Instrument.__init__(self) - top_staff = Staff() - top_staff.clef = clef.Clef() - bottom_staff = Staff() - bottom_staff.clef = clef.Clef() - bottom_staff.clef.clef_type = clef.CLEF_F + top_beat = Beat() + top_beat.clef = clef.Clef() + top_staff = Staff(top_beat) + + bottom_beat = Beat() + bottom_beat.clef = clef.Clef() + bottom_beat.clef.clef_type = clef.CLEF_F + bottom_staff = Staff(bottom_beat) + self.staves.append(top_staff) self.staves.append(bottom_staff) |