Module:Infobox ET: Difference between revisions
+1 Tag: Reverted |
These all looked too dumb tbh Tag: Undo |
||
| Line 105: | Line 105: | ||
-- step size in cents | -- step size in cents | ||
local step_size = ET.cents(et, 1) | local step_size = ET.cents(et, 1) | ||
if | if step_size > 100 then | ||
categories = categories .. "[[Category:Macrotonal|" .. string.rep("#", string.len(et.size)) .. "]]" | categories = categories .. "[[Category:Macrotonal|" .. string.rep("#", string.len(et.size)) .. "]]" | ||
end | end | ||
| Line 118: | Line 118: | ||
local fifth = -octave + twelfth -- 3/2 = [-1 1> | local fifth = -octave + twelfth -- 3/2 = [-1 1> | ||
local fifth_error = | local fifth_error = ET.cents(et, fifth) - rat.cents(rat.new(3, 2)) | ||
local is_dual_fifth = | 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> | ||
local m2 = 8 * octave - 5 * twelfth -- 256/243 = [8 -5> | local m2 = 8 * octave - 5 * twelfth -- 256/243 = [8 -5> | ||
local A1_cents = | local A1_cents = utils._round(ET.cents(et, A1), 4) | ||
local m2_cents = | local m2_cents = utils._round(ET.cents(et, m2), 4) | ||
-- display | -- display | ||
| Line 136: | Line 136: | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"Step size", | "Step size", | ||
utils._round(step_size, 6) .. "{{c}}" .. note_12edo .. " ", | |||
}) | }) | ||