Module:MOS in EDO: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
m rename |
||
| (12 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
local p = {} | |||
local mos = require("Module:MOS") | local mos = require("Module:MOS") | ||
local step_vis = require("Module:Step vis") | |||
local tamnams = require("Module:TAMNAMS") | |||
local utils = require("Module:Utils") | local utils = require("Module:Utils") | ||
local yesno = require("Module:Yesno") | local yesno = require("Module:Yesno") | ||
-- Global variables for cell colors | -- Global variables for cell colors | ||
| Line 62: | Line 64: | ||
end | end | ||
return string.format("%iL %is", large_step_count, small_step_count) | return string.format("%iL %is", large_step_count, small_step_count) | ||
end | end | ||
| Line 153: | Line 155: | ||
return next_step_array | return next_step_array | ||
end | end | ||
-- Primary function | -- Primary function | ||
| Line 243: | Line 192: | ||
-- Create table, starting with headers | -- Create table, starting with headers | ||
local result = "{| class=\"wikitable center-all\"\n" | local result = "{| class=\"wikitable center-all\"\n" | ||
.. "|+ style=\"font-size: 105%;\" | " .. string.format("Generators %i\\%i and %i\\%i\n", gen_in_edosteps, edo, comp_in_edosteps, edo) | .. "|+ style=\"font-size: 105%; white-space: nowrap;\" | " .. string.format("Generators %i\\%i and %i\\%i\n", gen_in_edosteps, edo, comp_in_edosteps, edo) | ||
.. "|-\n" | .. "|-\n" | ||
.. string.format("! colspan=\"%i\" | Steps\n", edo) | .. string.format("! colspan=\"%i\" | Steps\n", edo) | ||
| Line 335: | Line 284: | ||
end | end | ||
result = result .. "|} | result = result .. "|}" | ||
return result | return result | ||
| Line 384: | Line 333: | ||
-- Create table, starting with headers | -- Create table, starting with headers | ||
local result = "{| class=\"wikitable center-all\"\n" | local result = "{| class=\"wikitable center-all\"\n" | ||
.. "|+ style=\"font-size: 105%;\" | " .. string.format("Generators %i\\%i and %i\\%i\n", gen_in_edosteps, edo, comp_in_edosteps, edo) | .. "|+ style=\"font-size: 105%; white-space: nowrap;\" | " .. string.format("Generators %i\\%i and %i\\%i\n", gen_in_edosteps, edo, comp_in_edosteps, edo) | ||
.. "|-\n" | .. "|-\n" | ||
.. "! Step visualization\n" | .. "! Step visualization\n" | ||
| Line 408: | Line 357: | ||
-- Add the step visualization | -- Add the step visualization | ||
local sv = step_vis._step_vis(current_scale) | |||
result = result .. string.format(" | result = result .. string.format("| %s\n", sv) | ||
-- Add the scale sig | -- Add the scale sig | ||
| Line 425: | Line 374: | ||
-- Add the step sizes | -- Add the step sizes | ||
result = result .. string.format("| %i, %i\n", current_step_sizes["L"], current_step_sizes["s"]) | result = result .. string.format("| %i, %i\n", current_step_sizes["L"], current_step_sizes["s"]) | ||
-- Add step ratio | -- Add step ratio | ||
| Line 445: | Line 394: | ||
end | end | ||
result = result .. "|} | result = result .. "|}" | ||
return result | return result | ||
| Line 458: | Line 407: | ||
local generation_limit = tonumber(frame.args["Generation Limit"]) | local generation_limit = tonumber(frame.args["Generation Limit"]) | ||
local debugg = yesno(frame.args["debug"]) | local debugg = yesno(frame.args["debug"]) | ||
local result = p.mos_in_edo_simplified(edo, gen_in_edosteps, number_of_periods, generation_limit, temperament) | |||
-- Debugger option | |||
if debugg == true then | |||
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" | |||
end | |||
return frame:preprocess( | return frame:preprocess(result) | ||
end | end | ||
return p | return p | ||