def set_pitches(self, pitches, velocity): for pitch, rhythm in zip(pitches, self.rhythms): midi.unlockPitch(rhythm.pitch) rhythm.pitch = pitch midi.lockPitch(rhythm.pitch, 'rhythm') rhythm.loud = min(max(velocity+10,20),127) rhythm.quiet = min(max(velocity-20, 10),100)
def set_pitches(self, pitches, velocity): for pitch, rhythm in zip(pitches, self.rhythms): midi.unlockPitch(rhythm.pitch) rhythm.pitch = pitch midi.lockPitch(rhythm.pitch, 'rhythm') rhythm.loud = min(max(velocity + 10, 20), 127) rhythm.quiet = min(max(velocity - 20, 10), 100)
def _start(self): for pitch in 24,48,84,96: midi.lockPitch(pitch, 'rhythm') r = Rhythm(pitch=pitch, beat=0.125) r.loud = 50 r.quiet = 20 route(r, self.fader) self.rhythms.append(r) self.fader.fade(1.5, 1., 10) for r in self.rhythms: r.start()
def _start(self): for pitch in 24, 48, 84, 96: midi.lockPitch(pitch, 'rhythm') r = Rhythm(pitch=pitch, beat=0.125) r.loud = 50 r.quiet = 20 route(r, self.fader) self.rhythms.append(r) self.fader.fade(1.5, 1., 10) for r in self.rhythms: r.start()