Exemple #1
0
    def __init__(self, octave=60):
        self.octave = octave
        self.time = time.time()
        #self.pitch_map = PitchMap([x+octave for x in 2,9,12,17,23,28,31], variance=50)
        chords = ((-10, -3, 0, 5, 11, 16, 19), (-17, -10, -3, 12, 17, 23, 26),
                  (-15, -7, 0, 11, 16, 21, 24), (-7, 0, 4, 9, 14, 19, 23))

        self.pitch_maps = []
        for chord in chords:
            self.pitch_maps.append(
                PitchMap([x + octave for x in chord], variance=50))

        self.pitch_map = self.pitch_maps[0]
        self.rhythm = random.choice(((1, 1, 2), (1, 1, 2, 1, 1, 1, 1, 2)))
        self.velocity_map = DataMap(
            [random.randint(60, 127) for _ in range(7)], variance=50)
        self.jaggedness = 0.

        Autonomous.__init__(self)
        events.listen('facing_front', self.front_shift)
        events.listen('facing_back', self.back_shift)