When working with sets in continuous pitch-class spaces (i.e., where
octave equivalence is needed), R's normal operator for modulo division
%% does not always give ideal results. Values that are very close to
(but below) the octave appear to be far from 0. This function uses
rounding to give octave-equivalent results that music theorists expect.
Usage
fpmod(set, edo = 12, rounder = 10)
Value
Numeric vector the same length as set
Arguments
set
Numeric vector of pitch-classes in the set
edo
Number of unit steps in an octave. Defaults to 12.
rounder
Numeric (expected integer), defaults to 10:
number of decimal places to round to when testing for equality.