本文整理汇总了Python中MuseParse.classes.ObjectHierarchy.TreeClasses.MeasureNode.MeasureNode类的典型用法代码示例。如果您正苦于以下问题:Python MeasureNode类的具体用法?Python MeasureNode怎么用?Python MeasureNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MeasureNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: testMeasureRightRepeatBarlineNoLeft
class testMeasureRightRepeatBarlineNoLeft(MeasureTests):
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 \":|.\""
开发者ID:PCrompton,项目名称:MuseParse,代码行数:8,代码来源:testBarlines.py
示例2: testMeasureLeftBarline
class testMeasureLeftBarline(MeasureTests):
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.lilystring = " \\repeat volta 2 {c' | "
开发者ID:PCrompton,项目名称:MuseParse,代码行数:8,代码来源:testBarlines.py
示例3: testMeasureTempo
class testMeasureTempo(MeasureTests):
def setUp(self):
self.item = MeasureNode()
self.item.addDirection(Directions.Metronome(beat="quarter",min=60))
self.item.addNote(NoteNode())
self.lilystring = " \\tempo 4=60 | "
self.compile = True
self.wrappers = ["\\new Staff {", "}"]
Lily.setUp(self)
self.name = "measuretempo"
开发者ID:PCrompton,项目名称:MuseParse,代码行数:10,代码来源:testMeasure.py
示例4: testMeasureNote
class testMeasureNote(MeasureTests):
def setUp(self):
self.item = MeasureNode()
note = Note.Note()
note.pitch= Note.Pitch()
self.item.addNote(note)
self.lilystring = "c' | "
self.compile = True
self.wrappers = ["\\new Staff {", "}"]
Lily.setUp(self)
self.name = "measurenote"
开发者ID:PCrompton,项目名称:MuseParse,代码行数:11,代码来源:testMeasure.py
示例5: testMeasureOneNoteOneDirection
class testMeasureOneNoteOneDirection(MeasureTests):
def setUp(self):
self.item = MeasureNode()
note = Note.Note()
note.pitch = Note.Pitch()
self.item.addDirection(Directions.Direction(text="hello",placement="below"))
self.item.addNote(note)
self.lilystring = "c' _\\markup { \"hello\" } | "
self.compile = True
self.wrappers = ["\\new Staff {", "}"]
Lily.setUp(self)
self.name = "measurenotedirection"
开发者ID:PCrompton,项目名称:MuseParse,代码行数:12,代码来源:testMeasure.py
示例6: testShiftBeforeNote
class testShiftBeforeNote(unittest.TestCase):
def setUp(self):
self.item = MeasureNode()
dirnode = Directions.OctaveShift(amount=8, type="up")
self.item.addDirection(dirnode)
self.node = NoteNode()
self.node.GetItem().pitch = Note.Pitch(octave=2)
self.item.addNote(self.node)
def testLilystring(self):
value = "\n\\ottava #-1\n c, | "
self.assertEqual(value, self.item.toLily())
开发者ID:PCrompton,项目名称:MuseParse,代码行数:12,代码来源:testMeasure.py
示例7: testMeasureWithTimeModButNoTuplet
class testMeasureWithTimeModButNoTuplet(Lily):
def setUp(self):
self.item = MeasureNode()
note = Note.Note()
note.pitch = Note.Pitch()
note.timeMod = Note.TimeModifier(normal=2,actual=3)
note2 = Note.Note()
self.item.addNote(note)
self.item.addNote(note2)
self.item.RunVoiceChecks()
self.lilystring = "\once \override TupletBracket.bracket-visibility = ##f\n\omit TupletNumber\n\\tuplet 3/2 {c'} | "
开发者ID:emashliles,项目名称:MuseParse,代码行数:12,代码来源:testNotations.py
示例8: testPartialMeasure
class testPartialMeasure(MeasureTests):
def setUp(self):
self.item = MeasureNode()
self.item.partial = True
self.item.meter = Meter.Meter(beats=4, type=4)
note = Note.Note(type="quarter")
note.pitch = Note.Pitch()
self.item.addNote(note)
self.lilystring = "\\time 4/4 \partial 4 c'4 | "
self.compile = True
self.wrappers = ["\\new Staff {", "}"]
Lily.setUp(self)
self.name = "measurePartial"
开发者ID:PCrompton,项目名称:MuseParse,代码行数:13,代码来源:testMeasure.py
示例9: testPartialMeasureTwoNotesDifferentTypes
class testPartialMeasureTwoNotesDifferentTypes(Lily):
def setUp(self):
self.item = MeasureNode(partial=True)
self.item.meter = Meter.Meter(type=4,beats=4)
note = Note.Note()
note.SetType("quarter")
note.pitch = Note.Pitch(octave=4)
note2 = Note.Note()
note2.SetType("half")
note2.pitch = Note.Pitch(octave=4)
self.item.addNote(note)
self.item.addNote(note2)
Lily.setUp(self)
self.lilystring = "\\time 4/4 \partial 2. c'4 c'2 | "
开发者ID:PCrompton,项目名称:MuseParse,代码行数:14,代码来源:testMeasure.py
示例10: testPartialMeasureThreeNotesSameTypes
class testPartialMeasureThreeNotesSameTypes(Lily):
def setUp(self):
self.item = MeasureNode(partial=True)
self.item.meter = Meter.Meter(type=4,beats=4)
note = Note.Note(type="quarter")
note.pitch = Note.Pitch(octave=4)
note2 = Note.Note(type="quarter")
note2.pitch = Note.Pitch(octave=4)
note3 = Note.Note(type="quarter")
note3.pitch = Note.Pitch(octave=4)
self.item.addNote(note)
self.item.addNote(note2)
self.item.addNote(note3)
Lily.setUp(self)
self.lilystring = "\\time 4/4 \partial 2. c'4 c'4 c'4 | "
开发者ID:PCrompton,项目名称:MuseParse,代码行数:15,代码来源:testMeasure.py
示例11: testMeasureNoteWithGrace
class testMeasureNoteWithGrace(MeasureTests):
def setUp(self):
self.item = MeasureNode()
note = Note.Note(type="quarter")
note.pitch= Note.Pitch()
grace = Note.GraceNote(first=True)
grace.last = True
note.addNotation(grace)
self.item.addNote(note)
self.item.RunVoiceChecks()
self.lilystring = "\grace { c'4 } | "
self.compile = True
self.wrappers = ["\\new Staff {", "}"]
Lily.setUp(self)
self.name = "measurenotegrace"
开发者ID:PCrompton,项目名称:MuseParse,代码行数:15,代码来源:testMeasure.py
示例12: setUp
def setUp(self):
self.item = MeasureNode()
dirnode = Directions.OctaveShift(amount=8, type="up")
self.item.addDirection(dirnode)
self.node = NoteNode()
self.node.GetItem().pitch = Note.Pitch(octave=2)
self.item.addNote(self.node)
开发者ID:PCrompton,项目名称:MuseParse,代码行数:7,代码来源:testMeasure.py
示例13: setUp
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' }"
开发者ID:PCrompton,项目名称:MuseParse,代码行数:8,代码来源:testBarlines.py
示例14: testGraceAtStartOfMeasure
class testGraceAtStartOfMeasure(unittest.TestCase):
def setUp(self):
self.item = MeasureNode()
node = NoteNode()
self.note = Note.Note(type="quarter")
self.note.addNotation(Note.GraceNote())
self.note.pitch = Note.Pitch()
node.SetItem(self.note)
self.item.addNote(node)
self.item.RunVoiceChecks()
def testIsFirstGraceNote(self):
result = self.note.Search(Note.GraceNote)
self.assertTrue(result.first)
def testLilystring(self):
value = "\grace { c'4 } | "
self.assertEqual(value, self.item.toLily())
开发者ID:PCrompton,项目名称:MuseParse,代码行数:18,代码来源:testMeasure.py
示例15: testTwoVoicesMeasureNotePosition
class testTwoVoicesMeasureNotePosition(Lily):
def setUp(self):
self.item = MeasureNode()
node = Note.Note(type="quarter")
node.pitch = Note.Pitch(octave=4)
self.item.addNote(node, voice=1)
self.item.addNote(node, voice=1)
self.item.Backup(1)
node2 = Note.Note(type="quarter")
node2.pitch = Note.Pitch(octave=4)
self.item.addNote(node2, voice=2)
Lily.setUp(self)
self.compile = True
self.wrappers = ["\\new Staff{a8 ","c'8]}"]
self.lilystring = "<< % voice 1\n\\new Voice = \"one\"\n{\\voiceOne c'4 c'4 } % voice 2\n\\new Voice = \"two\"\n{\\voiceTwo r4 c'4 }>> | "
self.name = "noteOctaveShift"
def tearDown(self):
self.item = None
开发者ID:PCrompton,项目名称:MuseParse,代码行数:19,代码来源:testMeasure.py
注:本文中的MuseParse.classes.ObjectHierarchy.TreeClasses.MeasureNode.MeasureNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论