Exemplo n.º 1
0
 def setUp(self):
     self.item = MeasureNode()
     note = Note.Note()
     note.pitch = Note.Pitch()
     self.item.addNote(note)
     self.item.AddBarline(BarlinesAndMarkers.Barline(repeat="forward"),
                          location="left")
     self.item.AddBarline(BarlinesAndMarkers.Barline(repeat="backward"),
                          location="right")
     self.lilystring = " \\repeat volta 2 {c' }"
Exemplo n.º 2
0
 def DoBarlineChecks(self):
     measure_indexes = self.GetChildrenIndexes()
     if hasattr(self, "backward_repeats"):
         if len(self.backward_repeats) > 0:
             measure = self.GetChild(measure_indexes[0])
             for repeat in self.backward_repeats:
                 measure.AddBarline(BarlinesAndMarkers.Barline(
                     repeat="forward", repeatNum=repeat),
                                    location="left-1")
     if hasattr(self, "forward_repeats"):
         if len(self.forward_repeats) > 0:
             measure = self.GetChild(measure_indexes[-1])
             for repeat in self.forward_repeats:
                 measure.AddBarline(BarlinesAndMarkers.Barline(
                     repeat="backward", repeatNum=repeat),
                                    location="right-1")
Exemplo n.º 3
0
 def setUp(self):
     self.item = MeasureNode()
     note = Note.Note()
     note.pitch = Note.Pitch()
     self.item.addNote(note)
     self.item.AddBarline(
         BarlinesAndMarkers.Barline(repeat="backward-barline"),
         location="right")
     self.lilystring = "c'  \\bar \":|.\""
Exemplo n.º 4
0
    def testRepeatVal(self):
        self.tags.append("repeat")
        self.attrs["barline"] = {"location": "left"}
        self.attrs["repeat"] = {"direction": "backward"}

        MxmlParser.last_barline = BarlinesAndMarkers.Barline(repeat="forward")
        self.handler(self.tags, self.attrs, self.chars, self.piece, self.data)

        self.assertEqual("backward", self.measure.GetBarline("left").repeat)
Exemplo n.º 5
0
 def setUp(self):
     self.item = BarlinesAndMarkers.EndingMark(number=2)
     self.lilystring = "{"
Exemplo n.º 6
0
 def setUp(self):
     self.item = BarlinesAndMarkers.EndingMark()
     self.lilystring = "\\alternative {{"
Exemplo n.º 7
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(style="light-heavy",
                                            repeat="backward")
     self.lilystring = "}"
Exemplo n.º 8
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(style="heavy-light",
                                            repeat="forward")
     self.lilystring = " \\repeat volta 2 {"
Exemplo n.º 9
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(style="heavy-heavy")
     self.lilystring = " \\bar \"..\""
Exemplo n.º 10
0
 def testCalcOctaveShift(self):
     self.item.transpose = BarlinesAndMarkers.Transposition(octave=1)
     expected = "\\transpose c' c'' {"
     self.assertEqual(self.item.CalculateTransposition(), expected)
Exemplo n.º 11
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(
         style="heavy-light", ending=BarlinesAndMarkers.EndingMark())
     self.lilystring = "\\alternative {{"
Exemplo n.º 12
0
 def testFOrwardFlagValueAfterBackwardAdded(self):
     self.item.AddBarline(
         item=BarlinesAndMarkers.Barline(repeat="backward"),
         location="right",
         measure_id=1)
     self.assertEqual(len(self.item.forward_repeats), 0)
Exemplo n.º 13
0
 def testBackwardFlag(self):
     self.item.AddBarline(
         item=BarlinesAndMarkers.Barline(repeat="backward"),
         location="right",
         measure_id=1)
     self.assertTrue(hasattr(self.item, "forward_repeats"))
Exemplo n.º 14
0
 def setUp(self):
     self.item = StaffNode()
     self.item.AddBarline(item=BarlinesAndMarkers.Barline(repeat="forward"),
                          location="left",
                          measure_id=1)
Exemplo n.º 15
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(style="normal")
     self.lilystring = " \\bar \"|\""
Exemplo n.º 16
0
 def setUp(self):
     self.item = BarlinesAndMarkers.EndingMark(type="stop")
     self.lilystring = "}"
Exemplo n.º 17
0
 def setUp(self):
     self.item = BarlinesAndMarkers.EndingMark(type="discontinue")
     self.lilystring = "}\n}"
Exemplo n.º 18
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(style="dashed")
     self.lilystring = " \\bar \"!\""
Exemplo n.º 19
0
 def setUp(self):
     self.item = BarlinesAndMarkers.Barline(style="light-light")
     self.lilystring = " \\bar \"||\""
Exemplo n.º 20
0
 def testCalcUpWithDiatonic(self):
     self.item.transpose = BarlinesAndMarkers.Transposition(diatonic=1)
     expected = "\\transpose c' d' {"
     self.assertEqual(self.item.CalculateTransposition(), expected)