Module:MOS in EDO allperiods: Difference between revisions

Ganaram inukshuk (talk | contribs)
Created a variant function that populates an entire page
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 89: Line 89:
-- Creates tables for every mos in an edo, for every possible period count
-- Creates tables for every mos in an edo, for every possible period count
function p.moses_in_edo_all_periods(edo, show_subsets, temperaments)
function p.moses_in_edo_all_periods(edo, show_subsets, temperaments)
local edo = edo or 36
local edo = edo or 12
local show_subsets = show_subsets == 1
local show_subsets = show_subsets == 1
local temperaments = temperaments
local temperaments = temperaments
Line 101: Line 101:
-- Call a for loop that produces a set of tables for each period count
-- Call a for loop that produces a set of tables for each period count
local result = ""
for j = 1, math.ceil(math.sqrt(edo)) do
for j = 1, math.ceil(math.sqrt(edo)) do
local j = number_of_periods
local number_of_periods = j
if edo % number_of_periods == 0 then
if edo % number_of_periods == 0 then
-- Calculate the starting genpair
-- Calculate the starting genpair
-- If the generator and its complement are the same, skip that genpair by
-- If the generator and its complement are the same, skip that genpair by
-- incrementing the starting generator by 1
-- incrementing the starting generator by 1
local period_in_edosteps = edo
local starting_generator = math.ceil(period_in_edosteps / 2)
local starting_generator = math.ceil(period_in_edosteps / 2)
local complement = period_in_edosteps - starting_generator
local complement = period_in_edosteps - starting_generator
Line 121: Line 123:
-- Add a table for each genpair
-- Add a table for each genpair
local result = ""
for i = starting_generator, period_in_edosteps - 1 do
for i = starting_generator, period_in_edosteps - 1 do
-- Calculate current generators
-- Calculate current generators