Module:Infobox interval: Difference between revisions

Plumtree (talk | contribs)
mNo edit summary
Plumtree (talk | contribs)
mNo edit summary
Line 230: Line 230:
'[[File:' .. sound .. '|270px]]<br/><small>[[:File:' .. sound .. '|[sound info]]]</small>'
'[[File:' .. sound .. '|270px]]<br/><small>[[:File:' .. sound .. '|[sound info]]]</small>'
})
})
elseif rational then
elseif cents then
local hz = rat.hz(ratio)
local hz = 2 ^ (math.log(440)/math.log(2) + cents/1200)
if hz and hz > 0 then
table.insert(infobox_data, {
table.insert(infobox_data, {
frame:expandTemplate{
frame:expandTemplate{
title = 'User:Plumtree/Interval Sound',
title = 'User:Plumtree/Interval Sound',
args = { Frequency=tostring(hz), Timbre='violin' }
args = { Frequency=tostring(hz), Timbre='violin' }
}
}
})
})
end
end
end