Module:Infobox regtemp: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Lériendil (talk | contribs)
No edit summary
Lériendil (talk | contribs)
No edit summary
Line 30: Line 30:
local acc2 = frame.args["acc2"]
local acc2 = frame.args["acc2"]
local infobox_data = {}
local data = {}
table.insert(infobox_data, {
-- processed mapping
local map = {}
table.insert(data, {
"Subgroups",
"Subgroups",
subgroup
subgroup
})
})


table.insert(infobox_data, {
table.insert(data, {
"Comma basis",
"Comma basis",
basis
basis
})
})


table.insert(infobox_data, {
table.insert(data, {
"Edo join",
"Edo join",
"[[" .. edo_first .. "edo|" .. edo_first .. "]] & [[" .. edo_second .. "edo|" .. edo_second .. "]]"
"[[" .. edo_first .. "edo|" .. edo_first .. "]] & [[" .. edo_second .. "edo|" .. edo_second .. "]]"
})
})


table.insert(infobox_data, {
table.insert(data, {
"Generator ([[" .. method .. "]])",
"Generator ([[" .. method .. "]])",
"~" .. genfrac .. " = " .. tuning .. "c"
"~" .. genfrac .. " = " .. tuning .. "c"
})
})


table.insert(infobox_data, {
table.insert(data, {
"MOS scales",
"MOS scales",
mos
mos
})
})


table.insert(infobox_data, {
table.insert(data, {
"Reduced mapping",
"Reduced mapping",
"<" .. mapping .. "]"
"<" .. mapping .. "]"
})
})


table.insert(infobox_data, {
for num in mapping:gmatch("; ") do
table.insert(map, num)
end
 
table.insert(data, {
"Ploidacot",
"Ploidacot",
ploidacot
ploidacot
})
})


table.insert(infobox_data, {
table.insert(data, {
"Minmax error",
"Minmax error",
"(" .. limit1 .. "-[[odd limit]]) " .. acc1 .. "c; <br> (" .. limit2 .. "-[[odd limit]]) " .. acc2 .. "c"
"(" .. limit1 .. "-[[odd limit]]) " .. acc1 .. "c; <br> (" .. limit2 .. "-[[odd limit]]) " .. acc2 .. "c"
})
})


table.insert(infobox_data, {
table.insert(data, {
"Target scale size",
"Target scale size",
"(" .. limit1 .. "-[[odd limit]]) " .. comp1 .. " notes; <br> (" .. limit2 .. "-[[odd limit]]) " .. comp2 .. " notes"
"(" .. limit1 .. "-[[odd limit]]) " .. comp1 .. " notes; <br> (" .. limit2 .. "-[[odd limit]]) " .. comp2 .. " notes"
})
table.insert(data, {
"?",
map
})
})


local result = infobox.build(
local result = infobox.build(
name,
name,
infobox_data
data
)
)

Revision as of 23:25, 20 October 2024

Module documentation[view] [edit] [history] [purge]
This module should not be invoked directly; use its corresponding template instead: Template:Infobox regtemp.
Module:Infobox regtemp is a draft module. It is incomplete and may not be in active development. If possible, editors are encouraged to help with its development. In the meantime, editors should avoid using this module across the Xenharmonic Wiki, except for testing.

This module generates an infobox providing information about a given regular temperament.

Introspection summary for Module:Infobox regtemp 
Functions provided (1)
Line Function Params
5 infobox_RT (invokable) (frame)
Lua modules required (2)
Variable Module Functions used
infobox Module:Infobox build
u Module:Utils dependency not used

No function descriptions were provided. The Lua code may have further information.


local p = {}
local u = require("Module:Utils")
local infobox = require("Module:Infobox")

function p.infobox_RT(frame)
	
	-- no real math functionality... yet
	local name = frame.args["tempname"]
	
	local subgroup = frame.args["subgroup"]
	local basis = frame.args["commas"]
	
	local edo_first = frame.args["edo_first"]
	local edo1 = tonumber(edo_first)
	local edo_second = frame.args["edo_second"]
	local edo2 = tonumber(edo_second)
	
	local tuning = frame.args["tuning"]
	local genfrac = frame.args["genfrac"]
	local method = frame.args["method"]
	
	local mos = frame.args["mosses"]
	local mapping = frame.args["mapping"]
	local ploidacot = frame.args["ploidacot"]
	local limit1 = frame.args["lim1"]
	local comp1 = frame.args["comp1"]
	local acc1 = frame.args["acc1"]
	local limit2 = frame.args["lim2"]
	local comp2 = frame.args["comp2"]
	local acc2 = frame.args["acc2"]
	
	local data = {}
	
	-- processed mapping
	local map = {}
	table.insert(data, {
		"Subgroups",
		subgroup
	})

	table.insert(data, {
		"Comma basis",
		basis
	})

	table.insert(data, {
		"Edo join",
		"[[" .. edo_first .. "edo|" .. edo_first .. "]] & [[" .. edo_second .. "edo|" .. edo_second .. "]]"
	})

	table.insert(data, {
		"Generator ([[" .. method .. "]])",
		"~" .. genfrac .. " = " .. tuning .. "c"
	})

	table.insert(data, {
		"MOS scales",
		mos
	})

	table.insert(data, {
		"Reduced mapping",
		"<" .. mapping .. "]"
	})

	for num in mapping:gmatch("; ") do
		table.insert(map, num)
	end

	table.insert(data, {
		"Ploidacot",
		ploidacot
	})

	table.insert(data, {
		"Minmax error",
		"(" .. limit1 .. "-[[odd limit]]) " .. acc1 .. "c; <br> (" .. limit2 .. "-[[odd limit]]) " .. acc2 .. "c"
	})

	table.insert(data, {
		"Target scale size",
		"(" .. limit1 .. "-[[odd limit]]) " .. comp1 .. " notes; <br> (" .. limit2 .. "-[[odd limit]]) " .. comp2 .. " notes"
	})

	table.insert(data, {
		"?",
		map
	})

	local result = infobox.build(
		name,
		data
	)
	
	return result
end

return p