|
|
(8 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
| This module provides several functions to work with [[interval]]-related math. | | {{documentation| |
| | {{dochead|header=none}}{{lua|Limits|Rational}} |
| | This module provides a means to calculate harmonic Shannon entropy of a particular interval. |
|
| |
|
| Namely, the functions in this module can be called from other modules by using <code>require('Module:Interval')</code> and calling the <code>_</code>-prefixed functions.
| | It can be called from other modules by using <code>require("Module:Harmonic entropy")</code> and calling the <code>_</code>-prefixed functions. |
|
| |
|
| == 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>harmonic_entropy(c, ratios, deviation, norm)</code> |
| * <code>parse_ET(input)</code> returns the size (number of divisions) and the [[equave]] of an [[equal tuning]] given its name. Currently only supports equal divisions (e.g. no 88cET yet). This function is designed to be used by other modules only; it cannot be called with <code><nowiki>{{#invoke:}}</nowiki></code>.
| | : Computes [[Harmonic entropy#Basic Model: Shannon Entropy|harmonic Shannon entropy]] of an interval of <code>c</code> [[cent]]s across <code>ratios</code> with a Gaussian with standard <code>deviation</code> (also in [[cent]]s) and a <code>norm</code> associated with the <code>ratios</code>. |
| * <code>parse_ET_size(frame)</code> and <code>parse_ET_equave</code> respectively return the size (number of divisions) and the equave of an [[equal tuning]] given its name. This function is designed to be used with <code><nowiki>{{#invoke:}}</nowiki></code> only.
| | }} |
| * <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>
| |