Module:MOS in EDO allperiods: Difference between revisions
Added option to toggle displaying mosses of subset edos; for ease of entering temperaments, this requires entering temperaments as key-value pairs rather than an array, so entering temperaments is temporarily disabled |
Added back parse_entries function, even though it isn't used here |
||
| Line 4: | Line 4: | ||
local mosinedo = require('Module:MOS in EDO') | local mosinedo = require('Module:MOS in EDO') | ||
local p = {} | local p = {} | ||
-- Helper function | |||
-- Parses entries from a semicolon-delimited string and returns them in an array | |||
-- TODO: Separate this and related functions (parse_pair and parse_kv_pairs) into its own module, as they're included | |||
-- in various modules at this point, such as: scale tree, mos mdoes | |||
function p.parse_entries(unparsed) | |||
local parsed = {} | |||
for entry in string.gmatch(unparsed, '([^;]+)') do | |||
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1") | |||
table.insert(parsed, trimmed) -- Add to array | |||
end | |||
return parsed | |||
end | |||
-- Main function | -- Main function | ||