def testBestTimeSignature(self): from music21 import converter from music21 import meter s6 = converter.parse('C4 D16.', format='tinyNotation').flat.notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 11/32>')
def testBestTimeSignatureDoubleDottedB(self): ''' These add up the same as testBestTimeSignatureDoubleDotted, but use multiple notes. ''' from music21 import converter from music21 import meter s6 = converter.parse('C2 D4 E8', format='tinyNotation').flat.notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 7/8>') s6 = converter.parse('C2 D4 E8 F16', format='tinyNotation').flat.notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 15/16>')
def testBestTimeSignatureDoubleDottedC(self): ''' These add up the same as testBestTimeSignatureDoubleDotted, but use multiple notes which are dotted divisions of the original ''' from music21 import converter from music21 import meter s6 = converter.parse('C4.. D4..', format='tinyNotation').flatten().notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 7/8>') s6 = converter.parse('C4... D4...', format='tinyNotation').flatten().notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 15/16>')
def testBestTimeSignatureDoubleDotted(self): from music21 import converter from music21 import meter s6 = converter.parse('C4.', format='tinyNotation').flatten().notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 3/8>') s6 = converter.parse('C2..', format='tinyNotation').flatten().notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 7/8>') s6 = converter.parse('C2...', format='tinyNotation').flatten().notes m6 = stream.Measure() for el in s6: m6.insert(el.offset, el) ts6 = meter.bestTimeSignature(m6) self.assertEqual(repr(ts6), '<music21.meter.TimeSignature 15/16>')