Module:Harmonic entropy/doc: Difference between revisions
Jump to navigation
Jump to search
Added parse_ET |
m Forgot argument |
||
Line 5: | Line 5: | ||
== Functions == | == Functions == | ||
* <code>to_cents(ratio, prec)</code> returns the measure in [[cent]]s of an interval [[ratio]], rounded to a precision of <code>prec</code> decimal places. Parameter <code>prec</code> defaults to 3 if it is omitted. | * <code>to_cents(ratio, prec)</code> returns the measure in [[cent]]s of an interval [[ratio]], rounded to a precision of <code>prec</code> decimal places. Parameter <code>prec</code> defaults to 3 if it is omitted. | ||
* <code>parse_ET</code> returns the size and the equave of an [[equal tuning]] given its name. This function is designed to be used by other modules only; it cannot be called with <code><nowiki>{{#invoke:}}</nowiki></code>. | * <code>parse_ET(input)</code> returns the size and the equave of an [[equal tuning]] given its name. This function is designed to be used by other modules only; it cannot be called with <code><nowiki>{{#invoke:}}</nowiki></code>. | ||
* <code>backslash_ratio(input)</code> returns the ratio corresponding to an interval written in [[backslash notation]]. | * <code>backslash_ratio(input)</code> returns the ratio corresponding to an interval written in [[backslash notation]]. | ||
<includeonly><hr><small>Documentation transcluded from [[/doc]]</small> [[Category:Lua modules]]</includeonly> | <includeonly><hr><small>Documentation transcluded from [[/doc]]</small> [[Category:Lua modules]]</includeonly> |
Revision as of 21:15, 21 August 2022
This module provides several functions to work with interval-related math.
Namely, the functions in this module can be called from other modules by using require('Module:Interval')
and calling the _
-prefixed functions.
Functions
to_cents(ratio, prec)
returns the measure in cents of an interval ratio, rounded to a precision ofprec
decimal places. Parameterprec
defaults to 3 if it is omitted.parse_ET(input)
returns the size and the equave of an equal tuning given its name. This function is designed to be used by other modules only; it cannot be called with{{#invoke:}}
.backslash_ratio(input)
returns the ratio corresponding to an interval written in backslash notation.