Skip to main content

Module equal

Module equal 

Source
Expand description

Equal divisions of any interval, not only of the octave. Equal divisions of any interval, not only of the octave.

crate::tuningsystem::TuningSystem::EqualTemperament divides an octave, and is octave-repeating all the way down — its degree count is a count per octave, and its ratios double from one octave to the next. Plenty of tunings do not repeat at the octave at all: Bohlen-Pierce divides a twelfth into thirteen and never sounds an octave, and Carlos’s Alpha, Beta and Gamma repeat at nothing in particular. This is the type for those.

The period is kept as cents so that any interval can be one, and the ratio it came from is kept beside it so the division can still name itself the way the literature does — 13edt rather than 13 equal steps of 1901.955 cents.

use music21_rs::tuningsystem::EqualDivision;

let bohlen_pierce = EqualDivision::tritave(13)?;
assert_eq!(bohlen_pierce.to_string(), "13edt");
assert!((bohlen_pierce.step_cents() - 146.304).abs() < 1e-3);
// Its ninth degree is nowhere near an octave, which is the point of it.
assert!((bohlen_pierce.cents_at(8) - 1170.4).abs() < 0.1);

Structs§

EqualDivision
An equal division of an arbitrary interval.

Constants§

TRITAVE_CENTS
The tritave, 3/1, in cents — Bohlen-Pierce’s period.