Module:MOS mode degrees: Difference between revisions
m Corrected formatting for italics |
Color coding now differentiates between alterations to large intervals and small intervals (yellow for augmented, slightly darker blue for diminished) |
||
| Line 7: | Line 7: | ||
-- Global variables for cell colors | -- Global variables for cell colors | ||
p.cell_color_none = "NONE" -- For cells that don't have a color (default cell color applies) | |||
p.cell_color_perfect_size = "NONE" -- Only applies for periods, including the root and equave | p.cell_color_perfect_size = "NONE" -- Only applies for periods, including the root and equave | ||
p.cell_color_large_size = " | p.cell_color_large_size = "NONE" | ||
p.cell_color_small_size = "eaeaff" | p.cell_color_small_size = "eaeaff" | ||
p. | p.cell_color_lg_altered_size = "ffe0e0" | ||
p.cell_color_sm_altered_size = "dadaf0" | |||
-- TODO?: Move some functions to the mos notation module | -- TODO?: Move some functions to the mos notation module | ||
| Line 538: | Line 540: | ||
if input_mode_vectors[i][j] == brightest_vector[j] and input_mode_vectors[i][j] == darkest_vector[j] then | if input_mode_vectors[i][j] == brightest_vector[j] and input_mode_vectors[i][j] == darkest_vector[j] then | ||
table.insert(cell_colors, p.cell_color_perfect_size) | table.insert(cell_colors, p.cell_color_perfect_size) | ||
elseif | elseif input_mode_vectors[i][j] == brightest_vector[j] then | ||
table.insert(cell_colors, p.cell_color_large_size) | table.insert(cell_colors, p.cell_color_large_size) | ||
elseif | elseif input_mode_vectors[i][j] == darkest_vector[j] then | ||
table.insert(cell_colors, p.cell_color_small_size) | table.insert(cell_colors, p.cell_color_small_size) | ||
elseif input_mode_vectors[i][j] > brightest_vector[j] then | |||
table.insert(cell_colors, p. | table.insert(cell_colors, p.cell_color_lg_altered_size) | ||
elseif input_mode_vectors[i][j] < darkest_vector[j] then | |||
table.insert(cell_colors, p.cell_color_sm_altered_size) | |||
end | end | ||
end | end | ||
| Line 619: | Line 623: | ||
-- This includes period intervals bold and alterations italicized | -- This includes period intervals bold and alterations italicized | ||
for j = 1, #mosstep_vectors[i] do | for j = 1, #mosstep_vectors[i] do | ||
if row_colors[i][j] == p. | if row_colors[i][j] == p.cell_color_none then | ||
result = result .. string.format('| | result = result .. string.format('| %s\n', p.decode_quality(mosstep_vectors[i][j])) | ||
elseif row_colors[i][j] == p. | elseif row_colors[i][j] == p.cell_color_lg_altered_size or row_colors[i][j] == p.cell_color_sm_altered_size then | ||
result = result .. string.format('| style="background:#%s" | \'\'%s\'\'\n', row_colors[i][j], p.decode_quality(mosstep_vectors[i][j])) | result = result .. string.format('| style="background:#%s" | \'\'%s\'\'\n', row_colors[i][j], p.decode_quality(mosstep_vectors[i][j])) | ||
else | else | ||
| Line 704: | Line 708: | ||
-- This includes period intervals bold and alterations italicized | -- This includes period intervals bold and alterations italicized | ||
for j = 1, #mosstep_vectors[i] do | for j = 1, #mosstep_vectors[i] do | ||
if row_colors[i][j] == p. | if row_colors[i][j] == p.cell_color_none then | ||
result = result .. string.format('| | result = result .. string.format('| %s\n', p.decode_quality(mosstep_vectors[i][j])) | ||
elseif row_colors[i][j] == p. | elseif row_colors[i][j] == p.cell_color_lg_altered_size or row_colors[i][j] == p.cell_color_sm_altered_size then | ||
result = result .. string.format('| style="background:#%s" | \'\'%s\'\'\n', row_colors[i][j], p.decode_quality(mosstep_vectors[i][j])) | result = result .. string.format('| style="background:#%s" | \'\'%s\'\'\n', row_colors[i][j], p.decode_quality(mosstep_vectors[i][j])) | ||
else | else | ||