Module:MOSes by EDO: Difference between revisions

BudjarnLambeth (talk | contribs)
mNo edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Sintel (talk | contribs)
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:
local utils = require("Module:Utils")
local utils = require("Module:Utils")
local mosinedo = require("Module:MOS in EDO")
local mosinedo = require("Module:MOS in EDO")
local yesno = require("Module:Yesno")
local p = {}
local p = {}


-- Copied from Ganaram Inukshuk's module on 22 Oct 2024, the only change was changing from 2nd headings to bold text.
-- Copied from Ganaram Inukshuk's module on 22 Oct 2024, the only change was changing from 2nd level headings to plain bold text and removing the auto-categories, to allow calling multiple times inside of a single page.


-- Helper function
-- Helper function
Line 62: Line 63:
-- TODO: Show period/note/subset limits if applicable
-- TODO: Show period/note/subset limits if applicable
local result = ""
local result = ""
result = result .. string.format("This page lists all [[moment of symmetry]] scales in [[%iedo]].\n", edo)
result = result .. string.format("These are all [[moment of symmetry]] scales in [[%iedo]].\n", edo)
-- Call a for loop that produces a set of tables for each period count
-- Call a for loop that produces a set of tables for each period count
Line 115: Line 116:
local temperament_index = 1 + i - starting_generator
local temperament_index = 1 + i - starting_generator
if show_temperament then
if show_temperament then
result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit, temperaments[temperament_index])
result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit, temperaments[temperament_index]) .. "\n"
else
else
result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit)
result = result .. mosinedo.mos_in_edo_simplified(edo, i, number_of_periods, generation_limit) .. "\n"
end
end
end
end
Line 123: Line 124:
end
end
end
end
-- Auto-add categories
result = result .. string.format("[[Category:%iedo]]\n", edo)
.. "[[Category:Lists of scales]]\n"
.. "[[Category:MOS scales]]"
return result
return result
Line 152: Line 148:
local max_periods = tonumber(frame.args["Period Limit"]) or -1
local max_periods = tonumber(frame.args["Period Limit"]) or -1
local generation_limit = tonumber(frame.args["Generation Limit"]) or -1
local generation_limit = tonumber(frame.args["Generation Limit"]) or -1
local debugg = yesno(frame.args["debug"])
return p.mos_in_edo_allperiods(edo, max_periods, show_subsets, generation_limit, temperaments)
local result = p.mos_in_edo_allperiods(edo, max_periods, show_subsets, generation_limit, temperaments)
-- Debugger option
if debugg == true then
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
end
 
return frame:preprocess(result)
end
end


return p
return p