Module:TAMNAMS: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
local p = {} | |||
local mos = require("Module:MOS") | local mos = require("Module:MOS") | ||
local rat = require("Module:Rational") | local rat = require("Module:Rational") | ||
-- TODO | |||
--Function to parse a UDP and (possibly) scale degrees. | |||
--Separate interval/degree lookup into separate functions for for abbrevs and non-abbrev formats. | |||
--Added arbitrary hardness lookup for a single ratio (e.g., passing in 13:8 would return "quasisoft". | |||
| Line 122: | Line 128: | ||
["1L 1s"] = "monwd", | ["1L 1s"] = "monwd", | ||
["2L 2s"] = "biwd", | ["2L 2s"] = "biwd", | ||
["2L 3s"] = "pent", | |||
["1L 5s"] = "amech", | ["1L 5s"] = "amech", | ||
["2L 4s"] = "mal", | ["2L 4s"] = "mal", | ||
| Line 809: | Line 816: | ||
if alterations ~= nil then | if alterations ~= nil then | ||
for i = 1, #alterations do | for i = 1, #alterations do | ||
alterations_as_string = alterations_as_string .. " " .. alterations[i] | alterations_as_string = alterations_as_string .. " " .. alterations[i] | ||
end | end | ||
end | end | ||
return (periods == 1 | |||
and string.format("%s{{pipe}}%s", gens_up_per_period, gens_down_per_period) | |||
or string.format("%s{{pipe}}%s(%s)", gens_up_per_period * periods, gens_down_per_period * periods, periods)) | |||
.. alterations_as_string | |||
end | end | ||
| Line 950: | Line 957: | ||
-- vectors (a table containing the number of L's and s's for that interval). | -- vectors (a table containing the number of L's and s's for that interval). | ||
function p.differences_between_modes(base_step_matrix, altered_step_matrix) | function p.differences_between_modes(base_step_matrix, altered_step_matrix) | ||
local differences = {} | local differences = {} | ||
for i = 1, #altered_step_matrix do | for i = 1, #altered_step_matrix do | ||
| Line 988: | Line 994: | ||
function p.tester() | function p.tester() | ||
local input_mos = mos.new(5,2) | local input_mos = mos.new(5, 2) | ||
return p.preprocess_scalesig(input_mos) | return p.preprocess_scalesig(input_mos) | ||
end | end | ||
return p | return p | ||