Module:MOS in EDO: Difference between revisions

Ganaram inukshuk (talk | contribs)
Removing use of double-border, as it cluttered up the output
Ganaram inukshuk (talk | contribs)
Rearranged/added columns
Line 359: Line 359:
result = result .. string.format('|+ Generators %i\\%i and %i\\%i\n', gen_in_edosteps, edo, comp_in_edosteps, edo)
result = result .. string.format('|+ Generators %i\\%i and %i\\%i\n', gen_in_edosteps, edo, comp_in_edosteps, edo)
result = result .. string.format('|-\n')
result = result .. string.format('|-\n')
result = result .. string.format('! Steps\n')
result = result .. string.format('!MOS (name)\n') -- Scale sig (and name)
result = result .. string.format('!MOS (name)\n')
result = result .. string.format('!Step sizes\n') -- Step sizes
result = result .. string.format('!Step ratio\n')
result = result .. string.format('!Step ratio\n') -- Step ratio
if show_temperament then
if show_temperament then
result = result .. string.format('!Temperament\n')
result = result .. string.format('!Temperament\n') -- Temperament, if given
end
end
result = result .. string.format('! Step visualization\n')


-- Add the step pattern for successive mosses until the pattern becomes that for an edo
-- Add the step pattern for successive mosses until the pattern becomes that for an edo
Line 374: Line 375:
local large_step_size = current_step_sizes["L"]
local large_step_size = current_step_sizes["L"]
local small_step_size = current_step_sizes["s"]
local small_step_size = current_step_sizes["s"]
-- Is the first step a large step?
local first_step_is_large_step = current_scale[1] == large_step_size
-- Add the step visualization
local step_vis = p.step_pattern_to_simple_visualization(current_scale, period_in_edosteps)
result = result .. string.format('|-\n')
result = result .. string.format('| %s\n', step_vis)
-- Add the scale sig
-- Add the scale sig
-- Also add tamnams name if there is one
local scale_sig = p.mos_step_pattern_to_scale_sig(current_scale)
local scale_sig = p.mos_step_pattern_to_scale_sig(current_scale)
-- Get the tamnams name, if there is one
-- Don't show tamnams names for mosses with 5 notes or fewer (to keep the table from being cluttered)
local tamnams_name = mos.tamnams_name[scale_sig]
local tamnams_name = mos.tamnams_name[scale_sig]
local current_step_count = #current_scale
local current_step_count = #current_scale
if large_step_size == small_step_size then
-- Use step sizes to determine whether the mos is an edo
local reduced_large_step_size = current_step_sizes["L"] / step_ratio_gcd
local reduced_small_step_size = current_step_sizes["s"] / step_ratio_gcd
if reduced_large_step_size == reduced_small_step_size then
result = result .. string.format("| [[%iedo]]\n", edo / step_ratio_gcd)
result = result .. string.format("| [[%iedo]]\n", edo / step_ratio_gcd)
elseif tamnams_name ~= nil and current_step_count > 5 then
elseif tamnams_name ~= nil and current_step_count > 5 then
Line 403: Line 389:
end
end
-- Add the step ratio
-- Add the step sizes
result = result .. string.format("| %s:%s\n", current_step_sizes["L"] / step_ratio_gcd, current_step_sizes["s"] / step_ratio_gcd)
result = result .. string.format("| %i\\%i and %i\\%i\n", current_step_sizes["L"], edo, current_step_sizes["s"], edo)
-- Add step ratio
local reduced_large_step_size = large_step_size / step_ratio_gcd
local reduced_small_step_size = small_step_size / step_ratio_gcd
result = result .. string.format("| %s:%s\n", reduced_large_step_size, reduced_small_step_size)
-- Add the temperament name, if there is one
-- Add the temperament name, if there is one
Line 411: Line 402:
result = result .. string.format("| %s[%i]\n", temperament, current_step_count)
result = result .. string.format("| %s[%i]\n", temperament, current_step_count)
end
end
-- Add the step visualization
local step_vis = p.step_pattern_to_simple_visualization(current_scale, period_in_edosteps)
result = result .. string.format('|-\n')
result = result .. string.format('| %s\n', step_vis)
-- Produce the next scale in the sequence
-- Produce the next scale in the sequence