Module:MOS mode degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Row coloring for perfect intervals now only applies to periods
Ganaram inukshuk (talk | contribs)
Added italicized text for alterations and bold text for perfect periods
Line 5: Line 5:
local et = require('Module:ET')
local et = require('Module:ET')
local p = {}
local p = {}
-- Global variables for cell colors
p.cell_color_perfect_size = "NONE" -- Only applies for periods, including the root and equave
p.cell_color_large_size = "fffff0"
p.cell_color_small_size = "eaeaff"
p.cell_color_altered_size = "ffe0e0"


-- TODO?: Move some functions to the mos notation module
-- TODO?: Move some functions to the mos notation module
Line 525: Line 531:
local brightest_vector = p.calculate_mode_degrees(input_mos, brightest_true_mode)
local brightest_vector = p.calculate_mode_degrees(input_mos, brightest_true_mode)
local darkest_vector = p.calculate_mode_degrees(input_mos, darkest_true_mode)
local darkest_vector = p.calculate_mode_degrees(input_mos, darkest_true_mode)
local cell_color_perfect_size = "NONE" -- Only applies for periods, including the root and equave
local cell_color_large_size = "fffff0"
local cell_color_small_size = "eaeaff"
local cell_color_altered_size = "ffe0e0"
local row_colors = {}
local row_colors = {}
Line 616: Line 617:
-- Add scale degrees with cell coloring
-- Add scale degrees with cell coloring
-- 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] == "NONE" then
if row_colors[i][j] == p.cell_color_perfect_size then
result = result .. string.format('| %s\n', p.decode_quality(mosstep_vectors[i][j]))
result = result .. string.format('| \'\'\'%s\'\'\'\n', p.decode_quality(mosstep_vectors[i][j]))
elseif row_color[i][j] == p.cell_color_altered_size then
result = result .. string.format('| style="background:#%s" | \'\%s\'\'\n', row_colors[i][j], p.decode_quality(mosstep_vectors[i][j]))
else
else
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]))
Line 698: Line 702:
-- Add scale degrees with cell coloring
-- Add scale degrees with cell coloring
-- 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] == "NONE" then
if row_colors[i][j] == p.cell_color_perfect_size then
result = result .. string.format('| %s\n', p.decode_quality(mosstep_vectors[i][j]))
result = result .. string.format('| \'\'\'%s\'\'\'\n', p.decode_quality(mosstep_vectors[i][j]))
elseif row_color[i][j] == p.cell_color_altered_size then
result = result .. string.format('| style="background:#%s" | \'\%s\'\'\n', row_colors[i][j], p.decode_quality(mosstep_vectors[i][j]))
else
else
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]))