Learn R Programming

musicMCT (version 0.1.2)

z: Frequency ratios to logarithmic pitch intervals (e.g. semitones)

Description

Simple convenience function for converting frequency ratios to semitones. Useful to have in addition to j() because j() is only defined for specific common values. Defaults to 12-tone equal temperament but edo parameter allows other units.

Usage

z(..., edo = 12)

Value

Numeric vector representing the input ratios converted to edo unit steps per octave

Arguments

...

One or more numerics values which represent frequency ratios.

edo

Number of unit steps in an octave. Defaults to 12.

Details

The name z() doesn't make a lot of sense but has the virtue of being a letter that isn't otherwise very common. r (for ratio) and q (for the rationals) were both avoided because they're already used for other functions.

See Also

j() is a more convenient input method for the most common frequency ratios.

Examples

Run this code
z(81/80) == j(synt)

mod_jdia <- z(1, 10/9, 5/4, 4/3, 3/2, 5/3, 15/8)
minimize_vl(j(dia), mod_jdia)

z(1, 5/4, 3/2, edo=53)

Run the code above in your browser using DataLab