• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python MeasureNode.MeasureNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python lily.Lily类代码示例发布时间:2022-05-24
下一篇:
Python MultiPart.MultiPartUpload类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap