def __init__(self, width, height): PygameVisualization.__init__(self, width, height) pygame.font.init() f = pygame.font.SysFont("monospace", width / 30) self.offsety = height % 24 / 2 self.offsetx = width % 16 / 2 self.radius = height / 24 self.chanw = width / 32 no = [] for n in range(12): no.append(f.render(notes.int_to_note(n), False, (169,169,169))) for x in range(17): if x % 2: pygame.draw.rect(self.raster, (230,230,230), (x * self.chanw * 2+ self.offsetx, 0, self.chanw * 2, height)) for x in range(17): pygame.draw.line(self.raster, (210,210,210), (x * self.chanw * 2 + self.offsetx ,0), (x * self.chanw * 2 + self.offsetx, height)) for y in range(13): pygame.draw.line(self.raster, (200,200,200), (self.offsetx, y * self.radius * 2 + self.offsety), (width - self.offsetx , y * self.radius * 2 + self.offsety)) if y < 12: self.raster.blit(no[y], (x * self.chanw * 2 + self.chanw / 2 + self.offsetx, y * self.radius * 2 + self.radius))
def __init__(self, width, height): PygameVisualization.__init__(self, width, height) for x in range(5): pygame.draw.line(self.raster, (10,10,10), \ (x * (width / 4), 0), \ (x * (width / 4), height)) pygame.draw.line(self.raster, (10,10,10), \ (0, x * (height / 4)), \ (width, x * (height / 4))) self.chanx_dict = {} self.chany_dict = {} for x in range(16): self.chanx_dict[x] = width / 4 * (x % 4) + 1 self.chany_dict[x] = height /4 * (x / 4) + 1 self.notex_dict = {} self.notey_dict = {} for x in range(128): self.notex_dict[x] = width / 48 * x % 12 self.notey_dict[x] = height / 48 * (x / 12) self.bw = width / 48 self.bh = height / 48 self.chanw = width / 4 self.chanh = height / 4
def __init__(self, width, height): PygameVisualization.__init__(self, width, height) self.blocks = PygameBlockVisualization(width, height) self.lines = PygameLineVisualization(width, height) self.current = self.lines