brand-music
Version:
Strongly typed music theory library
31 lines (28 loc) • 1.69 kB
text/typescript
import { R as RangedNat, I as Int } from './NonNegativeInt-vzHTayKS.cjs';
declare const min = 0;
declare const max = 11;
type Shape = RangedNat<typeof min, typeof max>;
declare const hasShape: <T>(v: T) => v is T & (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11);
interface PitchIntervalClassBrand {
readonly PitchIntervalClass: unique symbol;
}
/**
* Ordered pitch-class interval
*
* Number of ascending semitones from one pitch-class to the next, ordered from lowest to highest
* @see {@link https://en.wikipedia.org/wiki/Pitch_interval#Ordered_pitch-class_intervals_('pitch_interval_class;_PIC')}
*/
type PitchIntervalClass = Shape & PitchIntervalClassBrand;
declare const mark: (_v: Shape) => _v is PitchIntervalClass;
declare const markNum: (v: number) => v is PitchIntervalClass;
declare const markUnknown: (v: unknown) => v is PitchIntervalClass;
declare const from: (v: Shape) => PitchIntervalClass;
declare const fromNum: (v: number) => PitchIntervalClass | undefined;
declare const fromIntClamp: (v: Int) => PitchIntervalClass;
declare const fromIntMod: (v: Int) => PitchIntervalClass;
declare const fromUnknown: (v: unknown) => PitchIntervalClass | undefined;
declare const MIN: 0 & PitchIntervalClassBrand;
declare const MAX: 11 & PitchIntervalClassBrand;
declare const ALL: readonly PitchIntervalClass[];
declare const invert: (v: PitchIntervalClass, index?: Shape) => PitchIntervalClass;
export { ALL as A, MAX as M, type PitchIntervalClass as P, type Shape as S, MIN as a, type PitchIntervalClassBrand as b, fromIntClamp as c, fromIntMod as d, fromNum as e, from as f, fromUnknown as g, hasShape as h, invert as i, markNum as j, markUnknown as k, mark as m };