示例#1
0
    def draw(self):
        buffer = monome.GridBuffer(self.grid.width, self.grid.height)

        # display steps
        for x in range(self.grid.width):
            # highlight the play position
            if x == self.play_position:
                highlight = 4
            else:
                highlight = 0

            for y in range(6):
                buffer.led_level_set(x, y, self.step[y][x] * 11 + highlight)

        # draw trigger bar and on-states
        for x in range(self.grid.width):
            buffer.led_level_set(x, 6, 4)

        for y in range(6):
            if self.step[y][self.play_position] == 1:
                buffer.led_level_set(self.play_position, 6, 15)

        # draw play position
        buffer.led_level_set(self.play_position, 7, 15)

        # update grid
        buffer.render(self.grid)
示例#2
0
    def draw(self):
        buffer = monome.GridBuffer(self.grid.width, self.grid.height)

        # display steps
        for x in range(self.grid.width):
            for y in range(6):
                buffer.led_level_set(x, y, self.step[y][x] * 11)

        # update grid
        buffer.render(self.grid)
示例#3
0
    def on_grid_ready(self):
        self.play_position = 0
        self.loopStart = 0
        self.loopEnd = self.grid.width-1
        self.playHead = 0
        self.firstKey = 0
        self.secndKey = 0
        self.keysPressed = 0

        

        print ("Grid connected: " + str(self.grid.width) + " x " + str(self.grid.height) )
        self.buffer = monome.GridBuffer(self.grid.width, self.grid.height)

        self.step = [[0 for col in range(self.grid.width)] for row in range(1,self.grid.height)]
        asyncio.ensure_future(self.play() )
示例#4
0
    def draw(self):
        buffer = monome.GridBuffer(self.grid.width, self.grid.height)

        # display steps
        for x in range(self.grid.width):
            # highlight the play position
            if x == self.play_position:
                highlight = 4
            else:
                highlight = 0

            for y in range(6):
                buffer.led_level_set(x, y, self.step[y][x] * 11 + highlight)

        # update grid
        buffer.render(self.grid)