Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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')
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)
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')
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)
#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()
# 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)
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)
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)
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)