Module:ADIN
From Xenharmonic Reference
Documentation for this module may be created at Module:ADIN/doc
local p = {}
-- WIP
-- WIP
-- WIP
function p.findClosest(edo,cents)
return math.floor((edo*cents/1200)+0.5)
end
function p.findSmallestAbove(edo,cents)
return math.ceil((edo*cents/1200))
end
function p.findSmallestBelow(edo,cents)
return math.floor((edo*cents/1200))
end
function p.ADIN(step,edo)
gen = (math.log(3/2)/math.log(2))*1200
dgen = 1200-gen
third = (((gen*4)%1200) + ((gen*-3)%1200))/2
sixth = 1200-third
second = dgen-third
seventh = 1200-second
fifth = gen-((gen*7)%1200)/2
fourth = 1200-fifth
names = {}
sthird = p.findClosest(edo,third)
names[p.findClosest(edo,third)] = "neutral third"
names[p.findClosest(edo,sixth)] = "neutral sixth"
names[p.findClosest(edo,second)] = "neutral second"
names[p.findClosest(edo,seventh)] = "neutral seventh"
names[p.findClosest(edo,fourth)] = "neutral fourth"
names[p.findClosest(edo,fifth)] = "neutral fifth"
names[edo] = "octave"
return fifth
end
-- module disabled for now cuz this is WIP
-- return p
