Module:Powharmonic series: Difference between revisions

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
Condense
Line 7: Line 7:
     "{| class=\"wikitable center-all\"\n" ..
     "{| class=\"wikitable center-all\"\n" ..
    "|+ Intervals of the " .. expo .. "-Powharmonic series\n" ..
    "|+ Intervals of the " .. expo .. "-Powharmonic series\n" ..
    "! rowspan=\"2\" | Pitch #\n" ..
    "! rowspan=\"2\" | Pitch !! colspan=\"2\" | Frequency multiplier !! colspan=\"3\" | Pitch\n" ..
    "! colspan=\"2\" | Frequency multiplier\n" ..
    "! colspan=\"3\" | Pitch\n" ..
    "|-\n" ..
    "|-\n" ..
    "! Definition\n" ..
    "! Definition !! Decimal !! [[Cent]]s !! Change (cents) !! Octave-reduced (cents)\n"
    "! Decimal\n" ..
    "! [[Cent]]s\n" ..
    "! Change (cents)\n" ..
    "! Octave-reduced (cents)\n"
     local fmt_cent = string.format("%%.%df", tonumber(frame.args["prec"]))
     local fmt_cent = string.format("%%.%df", tonumber(frame.args["prec"]))
     local p_prev = 0
     local p_prev = 0
Line 24: Line 18:
         out_str = out_str ..
         out_str = out_str ..
             "|-\n" ..
             "|-\n" ..
             "| " .. i .. "\n" ..
             "| " .. i ..
             "| " .. i .. "<sup>" .. expo .. "</sup>\n" ..
             "|| " .. i .. "<sup>" .. expo .. "</sup>" ..
             "| " .. string.format(fmt_cent, i^expo) .. "\n" ..
             "|| " .. string.format(fmt_cent, i^expo) ..
             "| " .. string.format(fmt_cent, p_current) .. "\n" ..
             "|| " .. string.format(fmt_cent, p_current) ..
             "| " .. string.format(fmt_cent, p_current - p_prev) .. "\n" ..
             "|| " .. string.format(fmt_cent, p_current - p_prev) ..
             "| " .. string.format(fmt_cent, math.fmod(p_current, 1200)) .. "\n"
             "|| " .. string.format(fmt_cent, math.fmod(p_current, 1200)) .. "\n"
         p_prev = p_current
         p_prev = p_current
     end
     end