当前位置: 首页>>代码示例>>Python>>正文


Python common.getSourceFilePath函数代码示例

本文整理汇总了Python中music21.common.getSourceFilePath函数的典型用法代码示例。如果您正苦于以下问题:Python getSourceFilePath函数的具体用法?Python getSourceFilePath怎么用?Python getSourceFilePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getSourceFilePath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getPaths

 def getPaths(self):
     documentationDirectoryPath = os.path.join(common.getSourceFilePath(), 'documentation')
     self.documentationDirectoryPath = documentationDirectoryPath
     self.autogenDirectoryPath = os.path.join(
         documentationDirectoryPath,
         'autogenerated',
         )
     self.buildDirectoryPath = os.path.join(
         documentationDirectoryPath,
         'build',
         )
     self.doctreesDirectoryPath = os.path.join(
         self.buildDirectoryPath,
         'doctrees',
         )
     self.buildDirectories = {
         'html': os.path.join(
             self.buildDirectoryPath,
             'html',
             ),
         'latex': os.path.join(
             self.buildDirectoryPath,
             'latex',
             ),
         # could reuse latex, but too much rewriting
         'latexpdf': os.path.join(
             self.buildDirectoryPath,
             'latex',
             ),
     }
开发者ID:rondini,项目名称:music21,代码行数:30,代码来源:make.py

示例2: testPaert

 def testPaert(self):
     import os
     nwcTranslatePath = common.getSourceFilePath() + os.path.sep + 'noteworthy'
     paertPath = nwcTranslatePath + os.path.sep + 'NWCTEXT_Really_complete_example_file.nwctxt' #'Part_OWeisheit.nwctxt' #
     #paertPath = r'D:\docs\research\music21\elvis\Wegman Masses\01\Caput\01 Kyrie.nwctxt'
     myScore = NoteworthyTranslator().parseFile(paertPath)
     myScore.show()
开发者ID:matyastr,项目名称:msps,代码行数:7,代码来源:translate.py

示例3: testMIDIParse

def testMIDIParse():
    from music21 import converter, common
    from music21 import freezeThaw

    #a = 'https://github.com/ELVIS-Project/vis/raw/master/test_corpus/prolationum-sanctus.midi'
    #c = converter.parse(a)
#     c = corpus.parse('bwv66.6', forceSource=True)
#     v = freezeThaw.StreamFreezer(c)
#     v.setupSerializationScaffold()
#     return v.writeStr() # returns a string
    import os
    a = os.path.join(common.getSourceFilePath(),
                     'midi',
                     'testPrimitive',
                     'test03.mid')

    #a = 'https://github.com/ELVIS-Project/vis/raw/master/test_corpus/prolationum-sanctus.midi'
    c = converter.parse(a)
    v = freezeThaw.StreamFreezer(c)
    v.setupSerializationScaffold()


    mockType = lambda x: x.__class__.__name__ == 'weakref'
    ty = TreeYielder(mockType)
    for val in ty.run(c):
        print(val, ty.currentLevel())
开发者ID:ELVIS-Project,项目名称:music21,代码行数:26,代码来源:treeYield.py

示例4: testComplete

 def testComplete(self):
     ci = CapellaImporter()
     #ci.readCapellaXMLFile(r'd:/desktop/achsorgd.capx')
     capellaDirPath = common.getSourceFilePath() / 'capella'
     oswaldPath = capellaDirPath / r'Nu_rue_mit_sorgen.capx'
     partScore = ci.scoreFromFile(oswaldPath)
     partScore.show()
开发者ID:ELVIS-Project,项目名称:music21,代码行数:7,代码来源:fromCapellaXML.py

示例5: testComplete

    def testComplete(self):
        nwcTranslatePath = common.getSourceFilePath() / 'noteworthy'
        complete = nwcTranslatePath / 'NWCTEXT_Really_complete_example_file.nwctxt'
        #'Part_OWeisheit.nwctxt' #

        myScore = NoteworthyTranslator().parseFile(complete)
        myScore.show()
开发者ID:cuthbertLab,项目名称:music21,代码行数:7,代码来源:translate.py

示例6: __init__

 def __init__(self):
     self.outputDirectory = None
     self.docBasePath = os.path.join(common.getSourceFilePath(), 'documentation')
     self.docSourcePath = os.path.join(self.docBasePath,
                                       'source')
     self.docGeneratedPath = os.path.join(self.docBasePath,
                                       'autogenerated')
开发者ID:folkengine,项目名称:music21,代码行数:7,代码来源:writers.py

示例7: readExcerpts

    def readExcerpts(self):
        for languageCode in self.languageCodes:
            thisExcerpt = (common.getSourceFilePath() / 'languageExcerpts'
                            / (languageCode + '.txt'))

            with thisExcerpt.open(encoding='utf-8') as f:
                excerptWords = f.read().split()
                self.trigrams[languageCode] = Trigram(excerptWords)
开发者ID:ELVIS-Project,项目名称:music21,代码行数:8,代码来源:text.py

示例8: readExcerpts

 def readExcerpts(self):
     for languageCode in self.languageCodes:
         thisExcerpt = os.path.join(common.getSourceFilePath(),
                                    'languageExcerpts',
                                    languageCode + '.txt')
         f = open(thisExcerpt)                
         self.trigrams[languageCode] = Trigram(f.read().split())
         f.close()
开发者ID:Grahack,项目名称:music21,代码行数:8,代码来源:text.py

示例9: testTransposingInstruments

 def testTransposingInstruments(self):
     import os
     from music21 import converter, common
     fpDir = os.path.join(common.getSourceFilePath(), 'musedata', 'testPrimitive', 'test01')
     s = converter.parse(fpDir)
     p = s.parts['Clarinet in A']
     self.assertEqual(str(p.getElementsByClass('Measure')[0].keySignature), '<music21.key.KeySignature of 3 sharps>')
     self.assertEqual(str(p.flat.notesAndRests[0]), '<music21.note.Note A>')
开发者ID:Aminor7,项目名称:music21,代码行数:8,代码来源:translate.py

示例10: allFiles

def allFiles():
    thisDir = common.getSourceFilePath() / 'musicxml' / 'lilypondTestSuite'
    allOut = []
    for f in thisDir.iterdir():
        if f.name.startswith('__'):
            continue
        allOut.append(f)
    return allOut
开发者ID:ELVIS-Project,项目名称:music21,代码行数:8,代码来源:__init__.py

示例11: getDirBuildHtml

def getDirBuildHtml():
    '''Return the html directory
    '''
    from music21 import common
    cwdir = common.getSourceFilePath()
    parentDir = os.path.dirname(cwdir)
    dirBuild = os.path.join(parentDir, 'music21', 'documentation', 'build')
    dirBuildHtml = os.path.join(dirBuild, 'html')
    return dirBuildHtml
开发者ID:Grahack,项目名称:music21,代码行数:9,代码来源:upload.py

示例12: testComplete

 def testComplete(self):
     ci = CapellaImporter()
     #ci.readCapellaXMLFile(r'd:/desktop/achsorgd.capx')
     import os
     from music21 import common
     capellaDirPath = common.getSourceFilePath() + os.path.sep + 'capella'
     oswaldPath = capellaDirPath + os.path.sep + r'Nu_rue_mit_sorgen.capx'
     partScore = ci.scoreFromFile(oswaldPath)
     partScore.show()
开发者ID:GenosResearchGroup,项目名称:music21-old,代码行数:9,代码来源:fromCapellaXML.py

示例13: readExcerpts

 def readExcerpts(self):
     for languageCode in self.languageCodes:
         thisExcerpt = os.path.join(common.getSourceFilePath(),
                                    'languageExcerpts',
                                    languageCode + '.txt')
         
         with open(thisExcerpt) as f:
             excerptWords = f.read().split()
             self.trigrams[languageCode] = Trigram(excerptWords)
开发者ID:imclab,项目名称:music21,代码行数:9,代码来源:text.py

示例14: testBasic

 def testBasic(self):
     import os
     from music21 import common
     nwcTranslatePath = common.getSourceFilePath() + os.path.sep + 'noteworthy'
     simplePath = nwcTranslatePath + os.path.sep + 'verySimple.nwctxt'#'NWCTEXT_Really_complete_example_file.nwctxt' # ## #'Part_OWeisheit.nwctxt' #
     myScore = NoteworthyTranslator().parseFile(simplePath)
     self.assertEqual(len(myScore.flat.notes), 1)
     self.assertEqual(str(myScore.flat.notes[0].name), "E")
     self.assertEqual(str(myScore.flat.getElementsByClass('Clef')[0]), "<music21.clef.BassClef>")
开发者ID:Grahack,项目名称:music21,代码行数:9,代码来源:translate.py

示例15: getDirBuildHtml

def getDirBuildHtml():
    """Return the html directory
    """
    from music21 import common

    cwdir = common.getSourceFilePath()
    parentDir = os.path.dirname(cwdir)
    dirBuild = os.path.join(parentDir, "music21", "documentation", "build")
    dirBuildHtml = os.path.join(dirBuild, "html")
    return dirBuildHtml
开发者ID:folkengine,项目名称:music21,代码行数:10,代码来源:upload.py


注:本文中的music21.common.getSourceFilePath函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。