Module:MOS: Difference between revisions

Ganaram inukshuk (talk | contribs)
Minor renaming to some params; added unison(), which returns a zero vector
Ganaram inukshuk (talk | contribs)
Added functions for basic 1-step sizes
Line 230: Line 230:
return result
return result
end
end
--------------------------------------------------------------------------------
------------------ INTERVAL FUNCTIONS FOR SIMPLE INTERVALS ---------------------
--------------------------------------------------------------------------------


-- Compute the unison as a vector of L's and s's.
-- Compute the unison as a vector of L's and s's.
Line 241: Line 245:
}
}
return result
return result
end
-- Compute the vector for a single large step.
function p.large_step()
local result = {
['L'] = 1,
['s'] = 0
}
return result
end
-- Compute the vector for a single small step.
function p.large_step()
local result = {
['L'] = 0,
['s'] = 1
}
return result
end
-- Compute the vector for a single chroma. It's a large step minus a small step.
function p.chroma()
local result = {
['L'] = 1,
['s'] = -1
}
return result
end
-- Compute the vector for an augmented step. It's a large step plus a chroma.
function p.augmented_step()
return p.interval_add(p.large_step(), p.chroma())
end
-- Compute the vector for a diminished step. It's a small stuep minus a chroma.
function p.diminished_step()
return p.interval_sub(p.small_step(), p.chroma())
end
end