Esempio n. 1
0
def counterMaker(beatLength, numTicks):
    # Create a MeasureCount from an 'old style' specification, where
    # all we are given is the number of ticks in a beat and the total number
    # of ticks in the bar
    defaultRegistry = CounterRegistry()
    counts = [count[1] for count in defaultRegistry.countsByTicks(beatLength)]
    count = counts[0]
    mc = MeasureCount()
    mc.addSimpleBeats(count, numTicks / beatLength)
    return mc
Esempio n. 2
0
def counterMaker(beatLength, numTicks):
    # Create a MeasureCount from an 'old style' specification, where
    # all we are given is the number of ticks in a beat and the total number
    # of ticks in the bar
    defaultRegistry = CounterRegistry()
    counts = [count[1] for count in
              defaultRegistry.countsByTicks(beatLength)]
    count = counts[0]
    mc = MeasureCount()
    mc.addSimpleBeats(count, numTicks / beatLength)
    return mc
Esempio n. 3
0
 def makeEmptyScore(cls, numMeasures, counter, kit):
     score = Score()
     if kit is None:
         kit = DrumKit.getNamedDefaultKit()
     score.drumKit = kit
     if counter is None:
         registry = CounterRegistry()
         counter = list(registry.countsByTicks(2))
         counter = counter[0][1]
         counter = makeSimpleCount(counter, 4)
     for dummy in range(0, numMeasures):
         score.insertMeasureByIndex(len(counter), counter = counter)
     score.scoreData.makeEmpty()
     return score
Esempio n. 4
0
 def makeEmptyScore(cls, numMeasures, counter, kit):
     score = Score()
     if kit is None:
         kit = DrumKit.getNamedDefaultKit()
     score.drumKit = kit
     if counter is None:
         registry = CounterRegistry()
         counter = list(registry.countsByTicks(2))
         counter = counter[0][1]
         counter = makeSimpleCount(counter, 4)
     for dummy in range(0, numMeasures):
         score.insertMeasureByIndex(len(counter), counter=counter)
     score.scoreData.makeEmpty()
     return score