Module:Infobox ET: Difference between revisions

Suppress convergence notice for 1ed's since it's often confusing
Categorize macrotonal tunings to Category: Macrotonal
Line 103: Line 103:
local next_one = "[[" .. (et.size + increment) .. et.suffix .. "|" .. (et.size + increment) .. et.suffix .. " →]]"
local next_one = "[[" .. (et.size + increment) .. et.suffix .. "|" .. (et.size + increment) .. et.suffix .. " →]]"


-- step size
-- step size in cents
local step_size = ET.cents(et, 1)
local step_size = ET.cents(et, 1)
if step_size > 100 then
categories = categories .. "[[Category:Macrotonal|" .. string.rep("#", string.len(et.size)) .. "]]"
end
local note_12edo = ""
local note_12edo = ""
if rat.eq(et.equave, 2) and et.size == 12 then
if rat.eq(et.equave, 2) and et.size == 12 then
Line 110: Line 113:
end
end


-- octave, twelfth, and fifth sizes
-- octave, twelfth, and fifth in steps
local octave = ET.approximate(et, 2)
local octave = ET.approximate(et, 2)
local twelfth = ET.approximate(et, 3)
local twelfth = ET.approximate(et, 3)
Line 116: Line 119:
local fifth = -octave + twelfth -- 3/2 = [-1 1>
local fifth = -octave + twelfth -- 3/2 = [-1 1>
local fifth_error = ET.cents(et, fifth) - rat.cents(rat.new(3, 2))
local fifth_error = ET.cents(et, fifth) - rat.cents(rat.new(3, 2))
local dual_fifth = math.abs(fifth_error) > step_size / 3
local is_dual_fifth = math.abs(fifth_error) > step_size / 3


local A1 = -11 * octave + 7 * twelfth -- 2187/2048 = [-11 7>
local A1 = -11 * octave + 7 * twelfth -- 2187/2048 = [-11 7>
Line 156: Line 159:
A1 .. ":" .. m2 .. " (" .. A1_cents .. "¢ : " .. m2_cents .. "¢)",
A1 .. ":" .. m2 .. " (" .. A1_cents .. "¢ : " .. m2_cents .. "¢)",
})
})
if dual_fifth and et.size > 0 then
if is_dual_fifth and et.size > 0 then
table.insert(infobox_data, {
table.insert(infobox_data, {
"Dual sharp fifth",
"Dual sharp fifth",