Module:MOS: Difference between revisions
No edit summary |
import gcd from utils |
||
| Line 1: | Line 1: | ||
local rat = require('Module:Rational') | local rat = require('Module:Rational') | ||
local seq = require('Module:Sequence') | local seq = require('Module:Sequence') | ||
local utils = require('Module:Utils') | |||
local et = require('Module:ET') | local et = require('Module:ET') | ||
local p = {} | local p = {} | ||
| Line 134: | Line 135: | ||
local nL = mos.nL | local nL = mos.nL | ||
local ns = mos.ns | local ns = mos.ns | ||
local d = | local d = utils.gcd(nL, ns) | ||
if d > 1 then -- use single period mos, with period as new equave | if d > 1 then -- use single period mos, with period as new equave | ||
nL = round(nL/d) | nL = round(nL/d) | ||
| Line 162: | Line 163: | ||
local nL = mos.nL | local nL = mos.nL | ||
local ns = mos.ns | local ns = mos.ns | ||
local d = | local d = utils.gcd(nL, ns) | ||
if d > 1 then -- use single period mos, with period as new equave | if d > 1 then -- use single period mos, with period as new equave | ||
nL = round(nL/d) | nL = round(nL/d) | ||