예제 #1
0
 def test_dotted_notes(self):
     self.assertEqual(
         LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8), standalone=False),
         "c'8.",
     )
     self.assertEqual(
         LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(4, 2), standalone=False),
         "c'4..",
     )
예제 #2
0
    def test_from_NoteContainer(self):
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"), standalone=False),
            "c'")
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"),
                                        4,
                                        standalone=False), "c'4")
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer(["C", "E"]),
                                        standalone=False),
            "<c' e'>",
        )
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer(["C", "E"]),
                                        4,
                                        standalone=False),
            "<c' e'>4",
        )

        # issue #37

        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"),
                                        16,
                                        standalone=False),
            "c'16",
        )
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"),
                                        16.0,
                                        standalone=False),
            "c'16",
        )
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"),
                                        value.dots(16),
                                        standalone=False),
            "c'16.",
        )
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"),
                                        0.25,
                                        standalone=False),
            "c'\\longa",
        )
        self.assertEqual(
            LilyPond.from_NoteContainer(NoteContainer("C"),
                                        0.5,
                                        standalone=False),
            "c'\\breve",
        )
예제 #3
0
    def test_from_NoteContainer(self):
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), standalone=False), "c'")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 4, standalone=False), "c'4")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(["C", "E"]), standalone=False), "<c' e'>")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(["C", "E"]), 4, standalone=False), "<c' e'>4")

        # issue #37

        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 16, standalone=False), "c'16")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 16.0, standalone=False), "c'16")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(16), standalone=False), "c'16.")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 0.25, standalone=False), "c'\\longa")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer("C"), 0.5, standalone=False), "c'\\breve")
예제 #4
0
 def test_to_pdf(self):
     self.assert_(
         LilyPond.to_pdf(
             "{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)), "pdftest first test"
         )
     )
     self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), "pdftest2"))
     self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), "pdftest3"))
예제 #5
0
 def test_to_png(self):
     self.assert_(
         LilyPond.to_png(
             '{ %s }' %
             LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8)),
             'pn1'))
     self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.tbar), 'pn2'))
     self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.mbar), 'pn3'))
예제 #6
0
 def test_to_pdf(self):
     self.assert_(
         LilyPond.to_pdf(
             '{ %s }' %
             LilyPond.from_NoteContainer(NoteContainer('C'), value.dots(8)),
             'pdftest first test'))
     self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), 'pdftest2'))
     self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), 'pdftest3'))
예제 #7
0
 def test_to_png(self):
     self.assertTrue(
         LilyPond.to_png(
             "{ %s }" %
             LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)),
             "pn1",
         ))
     self.assertTrue(LilyPond.to_png(LilyPond.from_Bar(self.tbar), "pn2"))
     self.assertTrue(LilyPond.to_png(LilyPond.from_Bar(self.mbar), "pn3"))
예제 #8
0
 def test_to_pdf(self):
     self.assertTrue(
         LilyPond.to_pdf(
             "{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)),
             "pdftest first test",
         )
     )
     self.assertTrue(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), "pdftest2"))
     self.assertTrue(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), "pdftest3"))
예제 #9
0
    def test_from_NoteContainer(self):
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'),
                         standalone=False), "c'")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 4,
                         standalone=False), "c'4")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(['C', 'E']),
                         standalone=False), "<c' e'>")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer(['C', 'E']),
                         4, standalone=False), "<c' e'>4")

        # issue #37

        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 16,
                         standalone=False), "c'16")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 16.0,
                         standalone=False), "c'16")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'),
                         value.dots(16), standalone=False), "c'16.")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 0.25,
                         standalone=False), "c'\\longa")
        self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'), 0.5,
                         standalone=False), "c'\\breve")
예제 #10
0
 def test_to_png(self):
     self.assert_(LilyPond.to_png('{ %s }'
                   % LilyPond.from_NoteContainer(NoteContainer('C'),
                  value.dots(8)), 'pn1'))
     self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.tbar), 'pn2'))
     self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.mbar), 'pn3'))
예제 #11
0
 def test_to_pdf(self):
     self.assert_(LilyPond.to_pdf('{ %s }'
                   % LilyPond.from_NoteContainer(NoteContainer('C'),
                  value.dots(8)), 'pdftest first test'))
     self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.tbar), 'pdftest2'))
     self.assert_(LilyPond.to_pdf(LilyPond.from_Bar(self.mbar), 'pdftest3'))
예제 #12
0
 def test_dotted_notes(self):
     self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'),
                      value.dots(8), standalone=False), "c'8.")
     self.assertEqual(LilyPond.from_NoteContainer(NoteContainer('C'),
                      value.dots(4, 2), standalone=False), "c'4..")
예제 #13
0
 def test_to_png(self):
     self.assert_(LilyPond.to_png("{ %s }" % LilyPond.from_NoteContainer(NoteContainer("C"), value.dots(8)), "pn1"))
     self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.tbar), "pn2"))
     self.assert_(LilyPond.to_png(LilyPond.from_Bar(self.mbar), "pn3"))