Module:JI ratios in ED: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added et template (as it can parse ets)
Ganaram inukshuk (talk | contribs)
Added back unison (unison should always be part of the first column of the first row)
Line 82: Line 82:
result = result .. string.format('| %.3f\n', step_in_cents)
result = result .. string.format('| %.3f\n', step_in_cents)
-- Override ratios for steps for the unison and equave
filtered_ratios = jiraf.filter_ratios_by_range(candidate_ratios, step_in_cents - tolerance, step_in_cents + tolerance)
-- Otherwise, filter ratios by range
local filtered_ratios = {}
if i == 1 then
filtered_ratios = { rat.new(1, 1) }
elseif i == steps + 1 then
filtered_ratios = { equave }
else
filtered_ratios = jiraf.filter_ratios_by_range(candidate_ratios, step_in_cents - tolerance, step_in_cents + tolerance)
end
-- Add ratios according to harmonic class
-- Add ratios according to harmonic class
Line 98: Line 89:
local prime_filtered_ratios = {}
local prime_filtered_ratios = {}
-- Filter ratios by harmonic class
-- Override filtered ratios denpending on whether the ratio is the
prime_filtered_ratios = jiraf.filter_ratios_by_harmonic_class(filtered_ratios, current_prime)
-- unison or equave
if step == 0 and j == 1 then
-- Filter ratios by complement-agnostic tenney height
prime_filtered_ratios = { rat.new(1) }
prime_filtered_ratios = jiraf.filter_ratios_by_complement_agnostic_tenney_height(prime_filtered_ratios, tenney_height, equave)
elseif step == steps then
prime_filtered_ratios = jiraf.filter_ratios_by_harmonic_class({ equave }, current_prime)
else
-- Filter ratios by harmonic class, then by complement-agnostic
-- Tenney height
prime_filtered_ratios = jiraf.filter_ratios_by_harmonic_class(filtered_ratios, current_prime)
prime_filtered_ratios = jiraf.filter_ratios_by_complement_agnostic_tenney_height(prime_filtered_ratios, tenney_height, equave)
end
-- Add ratios to cells
-- Add ratios to cells