Godtone (talk | contribs)
Godtone (talk | contribs)
Line 1,124: Line 1,124:
rb18 = [120, 60, 84, 96, 109, 13, 98, 122, 25, 29, 37, 41, 45, 49, 81, 94, 82, 57]
rb18 = [120, 60, 84, 96, 109, 13, 98, 122, 25, 29, 37, 41, 45, 49, 81, 94, 82, 57]
rb29 = [120, 5, 60, 84, 96, 61, 62, 97, 13, 74, 98, 75, 122, 21, 25, 29, 33, 37, 41, 79, 67, 80, 49, 81, 94, 53, 95, 57, 58]
rb29 = [120, 5, 60, 84, 96, 61, 62, 97, 13, 74, 98, 75, 122, 21, 25, 29, 33, 37, 41, 79, 67, 80, 49, 81, 94, 53, 95, 57, 58]
rb30 = rb29[:6] + [126] + rb29[6:] # between 61 and 62
rb30 = rb29[:6] + [126] + rb29[6:] # insert 126 between 61 and 62
def iso(x=5, y=1, note_to_col = lambda n: 1 if n>0 else 0, bottomleftnote=10, vel=100, half=40):
rb31 = rb30[:4] + [9] + rb30[4:] # insert 9 between 84 and 96
# 29 colours is a fairly ideal rainbow; we use it for indexing into to derive a 17-colour palette.
# note that i chose the +0.4 experimentally based on the colour palette i liked most.
rb17v2 = [ rb29[round( k/17*29+0.4 )%29] for k in range(17)]
def iso(x=5, y=1, note_to_col = lambda n: 1 if n>0 else 0, bottomleftnote=10, vel=102, half=40):
colmap = note_to_col
colmap = note_to_col
if type(note_to_col)==list:
if type(note_to_col)==list:
Line 1,186: Line 1,190:
if transform(k)==midi_note: # if equivalent... unlight key
if transform(k)==midi_note: # if equivalent... unlight key
col.send(mido.Message('note_on', channel=0, note=k, velocity=note_to_col(-midi_note)))
col.send(mido.Message('note_on', channel=0, note=k, velocity=note_to_col(-midi_note)))
</syntaxhighlight>
</syntaxhighlight>