Module:TAMNAMS: Difference between revisions

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user 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")
local p = {}


-- TODO
-- TODO
Line 818: Line 819:
end
end
end
end
if periods == 1 then
 
return string.format("%s{{pipe}}%s", gens_up_per_period, gens_down_per_period) .. alterations_as_string
return (periods == 1
else
and string.format("%s{{pipe}}%s", gens_up_per_period, gens_down_per_period)
return string.format("%s{{pipe}}%s(%s)", gens_up_per_period * periods, gens_down_per_period * periods, periods) .. alterations_as_string
or string.format("%s{{pipe}}%s(%s)", gens_up_per_period * periods, gens_down_per_period * periods, periods))
end
.. alterations_as_string
end
end


Line 956: 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 994: 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