Module:MOS gamut: Difference between revisions
Undo revision 115790 by Ganaram inukshuk (talk) - colors are wip Tag: Undo |
m Simplified comments |
||
| Line 22: | Line 22: | ||
-- - note_symbols - the note names entered as a string, such as "CDEFGAB" | -- - note_symbols - the note names entered as a string, such as "CDEFGAB" | ||
-- - chroma_symbol - the symbol for the chroma used, such as "#" (for ascending chain) or | -- - chroma_symbol - the symbol for the chroma used, such as "#" (for ascending chain) or | ||
-- "b" (for descending chain) | -- "b" (for descending chain), or & and @ for diamond-mos | ||
-- - going_up - bool; whether the genchain is going up or down; true for up, false for down | -- - going_up - bool; whether the genchain is going up or down; true for up, false for down | ||
function p.mos_genchain(input_mos, genchain_init, genchain_length, note_symbols, chroma_symbol, going_up) | function p.mos_genchain(input_mos, genchain_init, genchain_length, note_symbols, chroma_symbol, going_up) | ||
| Line 138: | Line 138: | ||
chroma_minus_symbol = "b" | chroma_minus_symbol = "b" | ||
end | end | ||
-- Reconstruct the UDP up|dp (u times p pipe d times p) | -- Reconstruct the UDP up|dp (u times p pipe d times p) | ||
| Line 157: | Line 150: | ||
local gens_down_per_period = generators_down / periods | local gens_down_per_period = generators_down / periods | ||
-- | -- Get and simplify the step ratio | ||
local kp = step_ratio[1] | local kp = step_ratio[1] | ||
local kq = step_ratio[2] | local kq = step_ratio[2] | ||
| Line 176: | Line 163: | ||
-- How many esteps are in the equave? Gamut does not include any notes reached by | -- How many esteps are in the equave? Gamut does not include any notes reached by | ||
-- increments smaller than a chroma, so if the step ratio is not simplified, the | -- increments smaller than a chroma, so if the step ratio is not simplified, the | ||
-- gamut will be for a simplified step ratio | -- gamut returned will be for a simplified step ratio | ||
local estedps_per_equave = input_mos.nL * num + input_mos.ns * den | local estedps_per_equave = input_mos.nL * num + input_mos.ns * den | ||