Godtone
Joined 17 December 2020
→Isomorphic keyboard code for launchpads with programmer mode: add zil24 usage example of rgb |
→Isomorphic keyboard code for launchpads with programmer mode: ADD AUTOCONVERSION OF 'RGB RGB RGB ...' 6-BIT COLOUR SPECIFIERS (2 bits per channel) |
||
| Line 1,607: | Line 1,607: | ||
} | } | ||
# for the 7-limit JI scale the zil24 colouring is intended to be used with see: https://en.xen.wiki/w/User:Zastari#Zil_.282.3.5.7.29 | # for the 7-limit JI scale the zil24 colouring is intended to be used with see: https://en.xen.wiki/w/User:Zastari#Zil_.282.3.5.7.29 | ||
zil24 = | zil24 = '333 020 101 032 213 000 221 002 333 023 100 031 212 003 323 000 331 022 203 033 110 001 322 003' | ||
# FOR INFO ON THE 24-NOTE COLOURING FOR Zil[24] READ BELOW: | # FOR INFO ON THE 24-NOTE COLOURING FOR Zil[24] READ BELOW: | ||
# the coordinates are based on interpreting every note of zil in terms of three families: | # the coordinates are based on interpreting every note of zil in terms of three families: | ||
| Line 1,705: | Line 1,705: | ||
# SEE: genindices() to generate a rank 2 scale and mode() to rotate an arbitrary scale. | # SEE: genindices() to generate a rank 2 scale and mode() to rotate an arbitrary scale. | ||
def iso(x=5, y=1, colmap_in=[34], highlight=[], **args): | def iso(x=5, y=1, colmap_in=[34], highlight=[], **args): | ||
bg = args.get('bg') # colour to indicate note is not in the highlighted subset (white by default) | bg = args.get('bg') or args.get('background') or args.get('unhighlighted') # colour to indicate note is not in the highlighted subset (white by default) | ||
if bg==None: # default | if bg==None: # default | ||
bg = 3 | bg = 3 | ||
# NOTE: if you are specifying a colouring based on 6-bit colours (2 bits per channel) | |||
# (specified as 'RGB RGB RGB ...' with R,G,B in [0,1,2,3]) then | |||
# the "outside of subset"/unhighlighted background colour bg will default to | |||
# a lit-but-blackish colour (colour code 112) to differentiate/disambiguate from | |||
# notes with the colour '333' = white that *are* in the subset | |||
elif bg==None and type(colmap_in)==str: | |||
bg = 112 | |||
relative = args.get('relative') or args.get('rel') or False | relative = args.get('relative') or args.get('rel') or False | ||
autorelative = args.get('autorelative') or args.get('autorel') or False | autorelative = args.get('autorelative') or args.get('autorel') or False | ||
| Line 1,716: | Line 1,723: | ||
# select colmap | # select colmap | ||
global colmaps | global colmaps | ||
global rgb | |||
if type(colmap)==int: | if type(colmap)==int: | ||
if colmaps.get(colmap): | if colmaps.get(colmap): | ||
| Line 1,727: | Line 1,735: | ||
print('no colmap in colmaps for',colmap,'notes; using default colmap') | print('no colmap in colmaps for',colmap,'notes; using default colmap') | ||
colmap = [4,5,6,7] | colmap = [4,5,6,7] | ||
elif type(colmap)==str: # 6-bit colours (2 bits per channel) specified as 'RGB RGB RGB ...' with R,G,B in [0,1,2,3] | |||
colmap = [rgb[( int(s[0]), int(s[1]), int(s[2]) )] for s in colmap.split()] | |||
# get arguments with default values | # get arguments with default values | ||
bottomleftnote = args.get('bottomleftnote') or args.get('blnote') or args.get('bl') or args.get('b') or 0 # WARNING: NOTE: used to be min(x,y) by default! | bottomleftnote = args.get('bottomleftnote') or args.get('blnote') or args.get('bl') or args.get('b') or 0 # WARNING: NOTE: used to be min(x,y) by default! | ||