Module:MOS gamut: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Simplified names, so it's note['Nk'] and note['nc'] instead of note.index and note.chroma
Ganaram inukshuk (talk | contribs)
Reformatted table output
Line 345: Line 345:
local result = '{| class="wikitable"\n'
local result = '{| class="wikitable"\n'
-- Add a table caption; this requires adding an et
-- Create the first row; this needs an edo for the header, followed by the
local et_for_mos = et.new(#gamut - 1, input_mos.equave)
-- steps
local result = result .. '|+ Note names for ' .. scale_sig .. " in " .. et.as_string(et_for_mos) .. "\n"
local steps_in_et = input_mos.nL * step_ratio[1] + input_mos.ns + step_ratio[2]
local et_for_mos = et.new(steps_in_et, input_mos.equave)
local result = result .. "! Steps of " .. et.as_string(et_for_mos) .. "\n"
local step_ratio_gcd = rat.gcd(step_ratio[1], step_ratio[2]) -- GCD of the sizes of L and s, in case L:s isn't simplified
for i = 1, #gamut do
result = result .. "!" .. (i - 1) * step_ratio_gcd .. "\n"
end
-- The second row contains the note names
local result = result .. "|-\n"
local result = result .. "|-\n"
local result = result .. "! Note names on " .. string.sub(note_symbols, 1, 1)
for i = 1, #gamut do
for i = 1, #gamut do
-- Get the note name
-- Get the note name