How to use the music21.mainTest function in music21

To help you get started, we’ve selected a few music21 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cuthbertLab / music21 / music21 / abcFormat / __init__.py View on Github external
def testGuineaPig(self):
        from music21.abcFormat import testFiles
        ah = ABCHandler()
        ah.process(testFiles.guineapigTest)
        self.assertEqual(len(ah), 105)


# ------------------------------------------------------------------------------
# define presented order in documentation
_DOC_ORDER = [ABCFile, ABCHandler, ABCHandlerBar]


if __name__ == '__main__':
    # sys.arg test options will be used in mainTest()
    import music21
    music21.mainTest(Test)
github cuthbertLab / music21 / music21 / tree / fromStream.py View on Github external
t = asTree(sc)
        self.assertEqual(t.endTime, 8.0)
        # print(repr(t))

    # def x_testExampleScoreAsTimespans(self):
    #     from music21 import tree
    #     score = tree.makeExampleScore()
    #     treeList = tree.fromStream.listOfTreesByClass(score, useTimespans=True)
    #     tl0 = treeList[0]


# --------------------

if __name__ == '__main__':
    import music21
    music21.mainTest(Test)  # , runTest='testAutoSortExample')
github cuthbertLab / music21 / music21 / analysis / windowed.py View on Github external
unused_wa = WindowedAnalysis(s, p)


        plot = graph.plot.WindowedKey(s, doneAction=None,
            windowStep=4, windowType='overlap')
        plot.run()
        # plot.write()


# ------------------------------------------------------------------------------
# define presented order in documentation
_DOC_ORDER = [WindowedAnalysis]

if __name__ == '__main__':
    import music21
    music21.mainTest(Test)
github cuthbertLab / music21-tools / trecento / trecentoCadence.py View on Github external
These objects generate PNGs, etc.
    '''
    def runTest(self):
        pass

    def testTrecentoLine(self):
        '''
        should display a 6 beat long line with some triplets
        '''
        st = CadenceConverter('e2 f8 e f trip{g16 f e} d8 c B trip{d16 c B}').parse().stream
        self.assertAlmostEqual(st.duration.quarterLength, 6.0)
        st.show()

if __name__ == "__main__":
    import music21
    music21.mainTest(Test, 'importPlusRelative')
github cuthbertLab / music21 / music21 / humdrum / spineParser.py View on Github external
class TestExternal(unittest.TestCase):

    def runTest(self):
        pass

    def testShowSousa(self):
        hf1 = HumdrumDataCollection(testFiles.sousaStars)
        hf1.stream.show()


if __name__ == "__main__":
    #Test().testMoveDynamics()
    import music21
    #c = music21.converter.parse(r'd:\desktop\b5-new.krn')
    #c.show()
    music21.mainTest(Test) #, TestExternal)
github cuthbertLab / music21 / music21 / demos / smt2010.py View on Github external
#for func in [findPotentialPassingTones]:
        for func in [findHighestNotes, demoJesse,
                     corpusMelodicIntervalSearchBrief, findPotentialPassingTones]:

            #func(show=False, op133=sStream)
            func(show=False)



if __name__ == "__main__":
    import music21
    import sys

    if len(sys.argv) == 1: # normal conditions
        chordifyAnalysisBrief()
        music21.mainTest(Test)

    elif len(sys.argv) > 1:
        t = Test()

        #corpusSearch()
        #corpusMelodicIntervalSearch()
        #chordifyAnalysis()
        #chordifyAnalysisHandel()
        #corpusFindMelodicSevenths()

        #ex04()

        #chordifyAnalysisHandel()
        #chordifyAnalysisBrief()
        #corpusMelodicIntervalSearchBrief()
        chordifyAnalysisBrief()
github cuthbertLab / music21 / music21 / musedata / __init__.py View on Github external
#         match = []
    #         for m in p.getElementsByClass('Measure'):
    #             match.append(m.number)
    #         self.assertEqual(len(match), 156)
    #         # make sure there are no empty strings
    #         self.assertEqual(match.count(''), 0)
    #
    #     self.assertEqual(len(s.parts[-1].flat.notes), 287)
# ------------------------------------------------------------------------------
# define presented order in documentation
_DOC_ORDER = [MuseDataWork]


if __name__ == '__main__':
    import music21
    music21.mainTest(Test)
github cuthbertLab / music21-tools / trecento / tonality.py View on Github external
class Test(unittest.TestCase):
    pass

    def runTest(self):
        testAll(show=False, fast=True)

class TestExternal(unittest.TestCase): # pragma: no cover
    pass

    def runTest(self):
        testAll(show=True, fast=False)

if __name__ == "__main__":
    import music21
    music21.mainTest(Test, 'importPlusRelative') #External)
github cuthbertLab / music21 / music21 / vexflow / base.py View on Github external
def testShowMeasureWithAccidentals(self):
        from music21 import corpus
        b = note.Note('B4') 
        #b = corpus.parse('bwv1.6')
        b.show('vexflow')
    
#-------------------------------------------------------------------------------
# define presented order in documentation
_DOC_ORDER = []


if __name__ == "__main__":
    # sys.arg test options will be used in mainTest()
    import music21
    music21.mainTest(TestExternal)
github cuthbertLab / music21 / music21 / alpha / trecento / notation.py View on Github external
print('tiny: %s' % TinySePerDureca[i + 1][j])
                    print('')
                else:
                    print('norm only: %s' % SePerDureca[i + 1][j])
                    print('')

        #TinySePerDureca.show('text')

class Test(unittest.TestCase):

    def runTest(self):
        pass

if __name__ == '__main__':
    import music21
    music21.mainTest(Test, TestExternal)