def setUp(self): testclass.TestClass.setUp(self) self.handler = MxmlParser.HandleRepeatMarking self.piece.addPart(Part.Part(), "P1") self.piece.getPart("P1").addEmptyMeasure(1, 1) self.attrs["measure"] = {"number": "1"} self.attrs["part"] = {"id": "P1"} self.measure = self.piece.getPart("P1").getMeasure(1, 1) self.tags.append("direction") self.attrs["direction"] = {"placement": "above"} self.data = {"staff_id": 1}
def setUp(self): testclass.TestClass.setUp(self) self.tags.append("direction") self.handler = MxmlParser.HandleDirections self.piece.addPart(Part.Part(), "P1") self.piece.getPart("P1").addEmptyMeasure(1, 1) self.measure = self.piece.getPart("P1").getMeasure(1, 1) self.attrs["measure"] = {"number": "1"} self.attrs["part"] = {"id": "P1"} self.data = {"note": None, "direction": None, "expression": None} self.data["staff_id"] = 1
def setUp(self): testclass.TestClass.setUp(self) self.piece.addPart(index="P1", item=Part.Part()) self.part = self.piece.getPart("P1") self.part.addEmptyMeasure(1, 1) measure = self.part.getMeasure(1, 1) self.data = {} self.data["note"] = Note.Note() self.note = self.data["note"] measure.addNote(self.data["note"]) self.handler = MxmlParser.handleArticulation self.tags.append("articulations")
def setUp(self): self.tags = ["note"] self.chars = {} self.attrs = {"part": {"id": "P1"}, "measure": {"number": "1"}} self.handler = MxmlParser.CreateNote MxmlParser.part_id = "P1" MxmlParser.measure_id = 1 self.piece = PieceTree() self.piece.addPart(Part.Part(), index="P1") self.piece.getPart("P1").addEmptyMeasure(1, 1) self.data = { "note": None, "direction": None, "expression": None, "staff_id": 1}
def setUp(self): self.tags = [] self.tags.append("measure") self.attrs = {"measure": {"number": "1"}, "part": {"id": "P1"}} self.chars = {} self.handler = MxmlParser.HandleMeasures self.piece = PieceTree() self.piece.addPart(index="P1", item=Part.Part()) self.part = self.piece.getPart("P1") MxmlParser.direction = None MxmlParser.note = None MxmlParser.expression = None self.data = { "note": None, "direction": None, "expression": None, "staff_id": 1, "voice": 1}
def setUp(self): self.parser = MxmlParser.MxmlParser() self.tag_list = [] self.attrs = [] self.parser.piece.addPart(Part.Part(), index="P1") self.parser.tags.append("part") self.parser.attribs["part"] = {"id": "P1"} self.parser.StartTag("measure", {"number": "1"}) self.parser.StartTag("divisions", {}) self.parser.NewData("8") self.parser.EndTag("divisions") self.parser.StartTag("note", {}) self.parser.StartTag("duration", {}) self.parser.NewData("16") self.parser.EndTag("duration") self.parser.EndTag("note") self.parser.StartTag("note", {}) self.parser.StartTag("duration", {}) self.parser.NewData("16") self.parser.EndTag("duration") self.parser.EndTag("note") self.parser.data["staff_id"] = 2 self.parser.StartTag("note", {}) self.parser.StartTag("divisions", {}) self.parser.NewData("8") self.parser.EndTag("divisions") self.parser.StartTag("note", {}) self.parser.StartTag("duration", {}) self.parser.NewData("16") self.parser.EndTag("duration") self.parser.EndTag("note") self.parser.StartTag("note", {}) self.parser.StartTag("duration", {}) self.parser.NewData("16") self.parser.EndTag("duration") self.parser.EndTag("note") self.parser.data["staff_id"] = 1 self.measure = self.parser.piece.getPart("P1").getMeasure(1, 1)
def __init__(self, index=0): IndexedNode.__init__(self, rules=[StaffNode]) self.index = index if self.item is None: self.item = Part.Part()
def setUp(self): self.item = PieceTree() self.item.addPart(Part.Part(), "P1") self.lilystring = "\\version \"2.18.2\" \n<<>>"