Module:Harmonic entropy/doc: Difference between revisions
Jump to navigation
Jump to search
Created page with "This module provides several functions to work with interval-related math. Namely, the functions in this module can be called from other modules using <code>require('Modu..." |
m Update intro |
||
Line 1: | Line 1: | ||
This module provides several functions to work with [[interval]]-related math. | This module provides several functions to work with [[interval]]-related math. | ||
Namely, the functions in this module can be called from other modules using <code>require('Module:Interval')</code> and calling the <code>_</code>-prefixed functions. | 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. | ||
== Functions == | == Functions == |
Revision as of 06:19, 19 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.- Known issue: the ratio cannot be given as a fraction (e.g. 3/2); it must be given as a decimal number (e.g. 1.5).