Module:MOS in EDO: Difference between revisions
ArrowHead294 (talk | contribs) No edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 1: | Line 1: | ||
local mos = require( | local mos = require("Module:MOS") | ||
local utils = require( | local utils = require("Module:Utils") | ||
local tamnams = require( | local tamnams = require("Module:TAMNAMS") | ||
local p = {} | local p = {} | ||
| Line 7: | Line 7: | ||
-- Dark blue for large steps, light blue for small steps | -- Dark blue for large steps, light blue for small steps | ||
-- For mosses that are reversed (starts with s and ends with L), use orange instead | -- For mosses that are reversed (starts with s and ends with L), use orange instead | ||
p.cell_color_none = " | p.cell_color_none = "" -- For cells that don't have a color (default cell color applies) | ||
p.cell_color_perfect_size = " | p.cell_color_perfect_size = "" -- Only applies for steps of an edo | ||
p.cell_color_large = "BDD7EE" | p.cell_color_large = "#BDD7EE" | ||
p.cell_color_small = "DDEBF7" | p.cell_color_small = "#DDEBF7" | ||
p.cell_color_lg_rev = "F8CBAD" | p.cell_color_lg_rev = "#F8CBAD" | ||
p.cell_color_sm_rev = "FCE4D6" | p.cell_color_sm_rev = "#FCE4D6" | ||
-- Helper function | -- Helper function | ||
| Line 240: | Line 240: | ||
-- Create table, starting with headers | -- Create table, starting with headers | ||
local result = | local result = "{| class=\"wikitable center-all\"\n" | ||
.. string.format("|+ style=\"font-size: 105%%;\" | Generators %i\\%i and %i\\%i\n", gen_in_edosteps, edo, comp_in_edosteps, edo) | |||
.. "|-\n" | |||
.. string.format("! colspan=\"%i\" | Steps\n", edo) | |||
.. "! MOS (name)\n" | |||
.. "! Step ratio\n" | |||
if show_temperament then | if show_temperament then | ||
result = result .. string.format( | result = result .. string.format("! Temperament\n") | ||
end | end | ||
| Line 263: | Line 263: | ||
-- Add the step sizes | -- Add the step sizes | ||
result = result .. | result = result .. "|-\n" | ||
for i = 1, #current_scale do | for i = 1, #current_scale do | ||
local current_step = current_scale[i] | local current_step = current_scale[i] | ||
| Line 287: | Line 287: | ||
if current_step == 1 then | if current_step == 1 then | ||
if large_step_size == small_step_size then | if large_step_size == small_step_size then | ||
result = result .. | result = result .. "| 1\n" | ||
else | else | ||
result = result .. string.format( | result = result .. string.format("| style=\"background-color: %s;\" | 1\n", cell_color) | ||
end | end | ||
else | else | ||
if cell_color == p.cell_color_none then | if cell_color == p.cell_color_none then | ||
result = result .. string.format( | result = result .. string.format("| colspan=\"%i\" | %i\n", current_step, current_step) | ||
else | else | ||
result = result .. string.format( | result = result .. string.format("| style=\"background-color: %s\" colspan=\"%i\" | %i\n", cell_color, current_step, current_step) | ||
end | end | ||
end | end | ||
| Line 333: | Line 333: | ||
end | end | ||
result = result .. | result = result .. "|}\n" | ||
return result | return result | ||
| Line 381: | Line 381: | ||
-- Create table, starting with headers | -- Create table, starting with headers | ||
local result = | local result = "{| class=\"wikitable center-all\"\n" | ||
.. string.format("|+ style=\"font-size: 105%%;\" | Generators %i\\%i and %i\\%i\n", gen_in_edosteps, edo, comp_in_edosteps, edo) | |||
.. "|-\n" | |||
.. "! Step visualization\n" | |||
.. "! MOS (name)\n" -- Scale sig (and name) | |||
.. "! Step sizes\n" -- Step sizes | |||
.. "! Step ratio\n" -- Step ratio | |||
if show_temperament then | if show_temperament then | ||
result = result .. | result = result .. "! Temperament\n" -- Temperament, if given | ||
end | end | ||
| Line 403: | Line 403: | ||
-- New row | -- New row | ||
result = result .. | result = result .. "|-\n" | ||
-- Add the step visualization | -- Add the step visualization | ||
local step_vis = p.step_pattern_to_simple_visualization(current_scale) | local step_vis = p.step_pattern_to_simple_visualization(current_scale) | ||
result = result .. string.format( | result = result .. string.format("| %s\n", step_vis) | ||
-- Add the scale sig | -- Add the scale sig | ||
| Line 443: | Line 443: | ||
end | end | ||
result = result .. | result = result .. "|}\n" | ||
return result | return result | ||