brand-music
Version:
Strongly typed music theory library
1 lines • 40.1 kB
Source Map (JSON)
{"version":3,"sources":["../src/index.ts","../src/IntervalClass.ts","../src/internal/utils.ts","../src/internal/refined/Literal.ts","../src/internal/MidiNoteNumber.ts","../src/internal/refined/Int.ts","../src/internal/PitchClass.ts","../src/internal/refined/NonNegative.ts","../src/internal/PitchInterval.ts","../src/internal/PitchIntervalClass.ts","../src/internal/refined/NonNegativeInt.ts","../src/internal/Semitones.ts","../src/internal/conversion.ts","../src/internal/IntervalClass.ts","../src/MidiNoteNumber.ts","../src/PitchClass.ts","../src/PitchClassSet.ts","../src/internal/refined/TwelveBits.ts","../src/internal/PitchClassSet.ts","../src/PitchInterval.ts","../src/PitchIntervalClass.ts","../src/PitchIntervalClassSet.ts","../src/internal/PitchIntervalClassSet.ts","../src/Semitones.ts"],"sourcesContent":["export * as IntervalClass from \"./IntervalClass.js\";\nexport * as MidiNoteNumber from \"./MidiNoteNumber.js\";\nexport * as PitchClass from \"./PitchClass.js\";\nexport * as PitchClassSet from \"./PitchClassSet.js\";\nexport * as PitchInterval from \"./PitchInterval.js\";\nexport * as PitchIntervalClass from \"./PitchIntervalClass.js\";\nexport * as PitchIntervalClassSet from \"./PitchIntervalClassSet.js\";\nexport * as Semitones from \"./Semitones.js\";\n","export {\n icBetweenPc as between,\n icFromPic as fromPic,\n} from \"./internal/conversion.js\";\nexport * from \"./internal/IntervalClass.js\";\n","// mod(-3, 5) = 2\nexport const mod = (a: number, n: number) => ((a % n) + n) % n;\n","import { mod } from \"../utils.js\";\nimport { Int } from \"./Int.js\";\n\nexport type Negate<N extends number> = N extends 0\n ? 0\n : `${N}` extends `-${infer X extends number}`\n ? X\n : `-${N}` extends `${infer X extends number}`\n ? X\n : number;\n\nexport type RangedNat<\n START extends number,\n END extends number,\n ARR extends unknown[] = [],\n ACC extends number = never,\n> = ARR[\"length\"] extends END\n ? ACC | START | END\n : RangedNat<\n START,\n END,\n [...ARR, 1],\n ARR[START] extends undefined ? ACC : ACC | ARR[\"length\"]\n >;\n\nexport const is =\n <S extends number, E extends number>(start: S, end: E) =>\n <T>(v: T): v is T & RangedNat<S, E> =>\n Number.isSafeInteger(v) &&\n start <= (v as unknown as number) &&\n (v as unknown as number) <= end;\n\nexport const clamp =\n <S extends number, E extends number>(start: S, end: E) =>\n (v: Int): RangedNat<S, E> =>\n v < start ? start : v > end ? end : (v as RangedNat<S, E>);\n\n// range: [s, e]\n// input: -5 -4 -3 -2 -1 0 1 2 3 4 5\n// output: 1 2 3 -2 -1 0 1 2 3 -2 -1\nexport const modded =\n <S extends number, E extends number>(start: S, end: E) =>\n (v: Int): RangedNat<S, E> => {\n const size = end - start + 1;\n const zero = v - start;\n\n const m = mod(zero, size);\n return (m + start) as RangedNat<S, E>;\n };\n\nexport const all = <S extends number, E extends number>(\n start: S,\n end: E,\n): readonly RangedNat<S, E>[] =>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n [...Array(end - start + 1)].map((_, i) => (start + i) as RangedNat<S, E>);\n\nexport const asInt = (v: RangedNat<number, number>) => v as Int;\n","import { Int } from \"./refined/Int.js\";\nimport { all, clamp, is, modded, RangedNat } from \"./refined/Literal.js\";\n\nconst min = 0;\nconst max = 127;\n\nexport type Shape = RangedNat<typeof min, typeof max>;\nexport const hasShape = is(min, max);\n\nexport interface MidiNoteNumberBrand {\n readonly MidiNoteNumber: unique symbol;\n}\nexport type MidiNoteNumber = Shape & MidiNoteNumberBrand;\n\nexport const mark = (_v: Shape): _v is MidiNoteNumber => true;\nexport const markNum = (v: number): v is MidiNoteNumber => hasShape(v);\nexport const markUnknown = (v: unknown): v is MidiNoteNumber => hasShape(v);\n\nexport const from = (v: Shape) => v as MidiNoteNumber;\nexport const fromNum = (v: number) => (markNum(v) ? v : undefined);\nexport const fromIntClamp = (v: Int) => from(clamp(min, max)(v));\nexport const fromIntMod = (v: Int) => from(modded(min, max)(v));\nexport const fromUnknown = (v: unknown) => (markUnknown(v) ? v : undefined);\n\nconst const_ = <T extends Shape>(v: T) => v as T & MidiNoteNumber;\nexport const MIN = const_(min);\nexport const MAX = const_(max);\nexport const ALL: readonly MidiNoteNumber[] = all(min, max).map(const_);\n\n// TODO: other constants\nexport const C_1 = const_(0);\nexport const C4 = const_(60);\nexport const G9 = const_(127);\n","export interface IntBrand {\n readonly Int: unique symbol;\n}\n\nexport type Int = number & IntBrand;\n\nexport const isInt = <T>(v: T): v is T & Int => Number.isInteger(v);\nexport const fromUnknown = <T>(v: T) => (isInt(v) ? v : undefined);\nexport const makeChecked = <T extends number>(v: T) => fromUnknown(v);\nexport const makeRound = <T extends number>(v: T) => Math.round(v) as T & Int;\nexport const makeTrunc = <T extends number>(v: T) => Math.trunc(v) as T & Int;\n\nexport const add = (a: Int, b: Int) => (a + b) as Int;\nexport const addChecked = (a: number, b: number) => makeChecked(a + b);\n\nexport const sub = (a: Int, b: Int) => (a - b) as Int;\nexport const subChecked = (a: number, b: number) => makeChecked(a - b);\n\nexport const mul = (a: Int, b: Int) => (a * b) as Int;\nexport const mulChecked = (a: number, b: number) => makeChecked(a * b);\nexport const mulRound = (a: number, b: number) => makeRound(a * b);\nexport const mulTrunc = (a: number, b: number) => makeTrunc(a * b);\n\nexport const divChecked = (a: number, b: number) => makeChecked(a * b);\nexport const divRound = (a: number, b: number) => makeRound(a * b);\nexport const divTrunc = (a: number, b: number) => makeTrunc(a * b);\n","import * as I from \"./refined/Int.js\";\nimport { all, asInt, clamp, is, modded, RangedNat } from \"./refined/Literal.js\";\n\nconst min = 0;\nconst max = 11;\nexport type Shape = RangedNat<typeof min, typeof max>;\nexport const hasShape = is(min, max);\n\nexport interface PitchClassBrand {\n readonly PitchClass: unique symbol;\n}\n\n/**\n * Integer notation of pitch class\n *\n * @see {@link https://en.wikipedia.org/wiki/Pitch_class}\n */\nexport type PitchClass = Shape & PitchClassBrand;\n\nexport const mark = (_v: Shape): _v is PitchClass => true;\nexport const markNum = (v: number): v is PitchClass => hasShape(v);\nexport const markUnknown = (v: unknown): v is PitchClass => hasShape(v);\n\nexport const from = (v: Shape) => v as PitchClass;\nexport const fromNum = (v: number) => (markNum(v) ? v : undefined);\nexport const fromIntClamp = (v: I.Int) => from(clamp(min, max)(v));\nexport const fromIntMod = (v: I.Int) => from(modded(min, max)(v));\nexport const fromUnknown = (v: unknown) =>\n is(min, max)(v) ? from(v) : undefined;\n\nconst const_ = <T extends Shape>(value: T) => value as T & PitchClass;\nexport const MIN = const_(min);\nexport const MAX = const_(max);\nexport const ALL: readonly PitchClass[] = all(min, max).map(const_);\n\nexport const invert = (v: PitchClass, index: Shape = 0) =>\n fromIntMod(I.sub(asInt(index), asInt(v)));\n","export interface NonNegativeBrand {\n readonly NonNegative: unique symbol;\n}\n\nexport type NonNegative = number & NonNegativeBrand;\n\nexport const isNonNegative = <T>(v: T): v is T & NonNegative =>\n typeof v === \"number\" && v >= 0;\n\nexport function makeAbs<T extends number, N extends NonNegative>(\n v: T,\n edgeCases: { NaN: N },\n): (T & NonNegative) | N;\nexport function makeAbs<T extends number>(\n v: T,\n edgeCases?: { NaN?: never },\n): (T & NonNegative) | (0 & NonNegative);\nexport function makeAbs(v: number, edgeCases?: { NaN?: NonNegative }) {\n const caseNaN = edgeCases?.NaN ?? (0 as 0 & NonNegative);\n\n if (Number.isNaN(v)) {\n return caseNaN;\n } else {\n return Math.abs(v);\n }\n}\n","import type { Int } from \"./refined/Int.js\";\nimport * as I from \"./refined/Int.js\";\nimport { Negate, RangedNat } from \"./refined/Literal.js\";\nimport { makeAbs } from \"./refined/NonNegative.js\";\nimport { NonNegativeInt } from \"./refined/NonNegativeInt.js\";\n\ntype Shape = Int;\nexport const hasShape = I.isInt;\n\nexport interface PitchIntervalBrand {\n readonly PitchInterval: unique symbol;\n}\n\n/**\n * Ordered pitch interval\n *\n * Number of semitones that separates one pitch from another, upward or downward.\n * @see {@link https://en.wikipedia.org/wiki/Pitch_interval#Ordered_Pitch_Interval}\n */\nexport type PitchInterval = Shape & PitchIntervalBrand;\n\nexport const mark = (_v: Int): _v is PitchInterval => true;\nexport const markNum = (v: number): v is PitchInterval => hasShape(v);\nexport const markUnknown = (v: unknown): v is PitchInterval => hasShape(v);\n\ntype PartialPositivePitchInterval = RangedNat<1, 999>;\ntype PartialPitchInterval =\n | PartialPositivePitchInterval\n | 0\n | Negate<PartialPositivePitchInterval>;\n\nexport const from = (v: Shape | PartialPitchInterval) => v as PitchInterval;\nexport const fromNum = (v: number) => (markNum(v) ? v : undefined);\nexport const fromNumRound = (v: number) => from(I.makeRound(v));\nexport const fromNumTrunc = (v: number) => from(I.makeTrunc(v));\nexport const fromUnknown = (v: unknown) => (markUnknown(v) ? v : undefined);\n\nconst fromUndefinedable = (v?: Int | undefined) => (v != null ? from(v) : v);\n\n// operators\nexport const add = (a: PitchInterval, b: PitchInterval) => from(I.add(a, b));\nexport const addChecked = (a: PitchInterval, b: PitchInterval) =>\n fromUndefinedable(I.addChecked(a, b));\n\nexport const sub = (a: PitchInterval, b: PitchInterval) => from(I.sub(a, b));\nexport const subChecked = (a: PitchInterval, b: PitchInterval) =>\n fromUndefinedable(I.subChecked(a, b));\n\nexport const mul = (a: PitchInterval, b: Int) => from(I.mul(a, b));\nexport const mulChecked = (a: PitchInterval, b: PitchInterval) =>\n fromUndefinedable(I.mulChecked(a, b));\nexport const mulRound = (a: PitchInterval, b: number) => from(I.mulRound(a, b));\nexport const mulTrunc = (a: PitchInterval, b: number) => from(I.mulTrunc(a, b));\n\nexport const divChecked = (a: PitchInterval, b: PitchInterval) =>\n fromUndefinedable(I.divChecked(a, b));\nexport const divRound = (a: PitchInterval, b: number) => from(I.divRound(a, b));\nexport const divTrunc = (a: PitchInterval, b: number) => from(I.divTrunc(a, b));\n\nexport const octaves = (pi: PitchInterval): NonNegativeInt =>\n pi === 0\n ? (0 as NonNegativeInt)\n : (makeAbs(I.makeTrunc(pi / 12)) as NonNegativeInt);\nexport const direction = (pi: PitchInterval) => (pi < 0 ? -1 : pi > 0 ? 1 : 0);\n","import * as I from \"./refined/Int.js\";\nimport { all, asInt, clamp, is, modded, RangedNat } from \"./refined/Literal.js\";\n\nconst min = 0;\nconst max = 11;\nexport type Shape = RangedNat<typeof min, typeof max>;\nexport const hasShape = is(min, max);\n\nexport interface PitchIntervalClassBrand {\n readonly PitchIntervalClass: unique symbol;\n}\n\n/**\n * Ordered pitch-class interval\n *\n * Number of ascending semitones from one pitch-class to the next, ordered from lowest to highest\n * @see {@link https://en.wikipedia.org/wiki/Pitch_interval#Ordered_pitch-class_intervals_('pitch_interval_class;_PIC')}\n */\nexport type PitchIntervalClass = Shape & PitchIntervalClassBrand;\n\nexport const mark = (_v: Shape): _v is PitchIntervalClass => true;\nexport const markNum = (v: number): v is PitchIntervalClass => hasShape(v);\nexport const markUnknown = (v: unknown): v is PitchIntervalClass => hasShape(v);\n\nexport const from = (v: Shape) => v as PitchIntervalClass;\nexport const fromNum = (v: number) => (markNum(v) ? v : undefined);\nexport const fromIntClamp = (v: I.Int) => from(clamp(min, max)(v));\nexport const fromIntMod = (v: I.Int) => from(modded(min, max)(v));\nexport const fromUnknown = (v: unknown) => (markUnknown(v) ? v : undefined);\n\nconst const_ = <T extends Shape>(value: T) => value as T & PitchIntervalClass;\nexport const MIN = const_(min);\nexport const MAX = const_(max);\nexport const ALL: readonly PitchIntervalClass[] = all(min, max).map(const_);\n\nexport const invert = (v: PitchIntervalClass, index: Shape = 0) =>\n fromIntMod(I.sub(asInt(index), asInt(v)));\n","import { Int, isInt } from \"./Int.js\";\nimport { isNonNegative, NonNegative } from \"./NonNegative.js\";\n\nexport type NonNegativeInt = Int & NonNegative;\n\nexport const isNonNegativeInt = (v: unknown): v is NonNegativeInt =>\n isInt(v) && isNonNegative(v);\n","import * as I from \"./refined/Int.js\";\nimport { RangedNat } from \"./refined/Literal.js\";\nimport { makeAbs } from \"./refined/NonNegative.js\";\nimport { isNonNegativeInt, NonNegativeInt } from \"./refined/NonNegativeInt.js\";\n\ntype Shape = NonNegativeInt;\nexport const hasShape = isNonNegativeInt;\n\nexport interface SemitonesBrand {\n readonly Semitones: unique symbol;\n}\n\n/**\n * Unordered pitch interval\n *\n * Number of semitones that separates one pitch from another.\n * @see {@link https://en.wikipedia.org/wiki/Pitch_interval#Unordered_Pitch_Interval}\n */\nexport type Semitones = NonNegativeInt & SemitonesBrand;\n\nexport const mark = (_v: Shape): _v is Semitones => true;\nexport const markNum = (v: number): v is Semitones => hasShape(v);\nexport const markUnknown = (v: unknown): v is Semitones => hasShape(v);\n\nexport const from = (v: Shape | RangedNat<0, 999>) => v as Semitones;\nexport const fromNum = (v: number) => (markNum(v) ? v : undefined);\nexport const fromIntAbs = (v: I.Int) => from(makeAbs(v) as NonNegativeInt);\nexport const fromUnknown = (v: unknown) => (markUnknown(v) ? v : undefined);\n\nconst const_ = <T>(v: T) => v as T & Semitones;\nexport const MIN = const_(0);\n\nexport const octaves = (st: Semitones) =>\n st === 0 ? (0 as NonNegativeInt) : (I.makeTrunc(st / 12) as NonNegativeInt);\n","import * as IC from \"./IntervalClass.js\";\nimport * as MNN from \"./MidiNoteNumber.js\";\nimport * as PC from \"./PitchClass.js\";\nimport * as PI from \"./PitchInterval.js\";\nimport * as PIC from \"./PitchIntervalClass.js\";\nimport * as I from \"./refined/Int.js\";\nimport { asInt } from \"./refined/Literal.js\";\nimport * as ST from \"./Semitones.js\";\n\nexport const icFromPic = (pic: PIC.PitchIntervalClass) =>\n Math.min(pic, PIC.invert(pic)) as IC.IntervalClass;\nexport const icBetweenPc = (a: PC.PitchClass, b: PC.PitchClass) =>\n icFromPic(picBetweenPc(a, b));\n\nconst mnnAdd = (value: MNN.MidiNoteNumber, interval: PI.PitchInterval) =>\n I.add(asInt(value), asInt(interval));\nexport const mnnTransposeChecked = (\n value: MNN.MidiNoteNumber,\n interval: PI.PitchInterval,\n) => MNN.fromNum(mnnAdd(value, interval));\nexport const mnnTransposeClamped = (\n value: MNN.MidiNoteNumber,\n interval: PI.PitchInterval,\n) => MNN.fromIntClamp(mnnAdd(value, interval));\nexport const mnnTransposeModded = (\n value: MNN.MidiNoteNumber,\n interval: PI.PitchInterval,\n) => MNN.fromIntMod(mnnAdd(value, interval));\n\nexport const pcTranspose = (\n value: PC.PitchClass,\n interval: PIC.PitchIntervalClass,\n) => PC.fromIntMod(I.add(asInt(value), asInt(interval)));\nexport const pcFromMnn = (mnn: MNN.MidiNoteNumber) => PC.fromIntMod(asInt(mnn));\n\nexport const piBetweenMnn = (\n from: MNN.MidiNoteNumber,\n to: MNN.MidiNoteNumber,\n) => PI.from(I.sub(asInt(to), asInt(from)));\n\nexport const picBetweenPc = (from: PC.PitchClass, to: PC.PitchClass) =>\n PIC.fromIntMod(I.sub(asInt(to), asInt(from)));\n\n/**\n * Gets the pitch interval class of the pitch interval.\n *\n * @example\n * ```ts\n * import * as PI from \"brand-music/PitchInterval\";\n * import * as PIC from \"brand-music/PitchIntervalClass\";\n *\n * const picOfPi = PIC.fromPi(PI.from(-2)); // 10\n * const picOfSemitones = PIC.fromSemitones(PI.semitones(PI.from(-2))); // 2\n * ```\n */\nexport const picFromPi = (pi: PI.PitchInterval) => PIC.fromIntMod(pi);\nexport const picFromSemitones = (semitones: ST.Semitones) =>\n PIC.fromIntMod(semitones);\n\nexport const stFromPi = (pi: PI.PitchInterval) => ST.fromIntAbs(pi);\nexport const stBetweenMnn = (a: MNN.MidiNoteNumber, b: MNN.MidiNoteNumber) =>\n ST.fromIntAbs(I.sub(asInt(a), asInt(b)));\n","import * as I from \"./refined/Int.js\";\nimport { all, clamp, is, modded, RangedNat } from \"./refined/Literal.js\";\n\nconst min = 0;\nconst max = 6;\nexport type Shape = RangedNat<typeof min, typeof max>;\nexport const hasShape = is(min, max);\n\nexport interface IntervalClassBrand {\n readonly IntervalClass: unique symbol;\n}\n\n/**\n * Unordered pitch-class interval\n *\n * Number of ascending semitones from one pitch-class to the next, ordered from lowest to highest\n * @see {@link https://en.wikipedia.org/wiki/Pitch_interval#Unordered_pitch-class_intervals_('interval_class;_IC')}\n */\nexport type IntervalClass = Shape & IntervalClassBrand;\n\nexport const mark = (_v: Shape): _v is IntervalClass => true;\nexport const markNum = (v: number): v is IntervalClass => hasShape(v);\nexport const markUnknown = (v: unknown): v is IntervalClass => hasShape(v);\n\nexport const from = (v: Shape) => v as IntervalClass;\nexport const fromNum = (v: number) => (markNum(v) ? v : undefined);\nexport const fromIntClamp = (v: I.Int) => from(clamp(min, max)(v));\nexport const fromIntMod = (v: I.Int) => from(modded(min, max)(v));\nexport const fromUnknown = (v: unknown) => (markUnknown(v) ? v : undefined);\n\nconst const_ = <T extends Shape>(value: T) => value as T & IntervalClass;\nexport const MIN = const_(min);\nexport const MAX = const_(max);\nexport const ALL: readonly IntervalClass[] = all(min, max).map(const_);\n","export {\n pcFromMnn as pc,\n piBetweenMnn as pi,\n stBetweenMnn as semitones,\n mnnTransposeChecked as transposeChecked,\n mnnTransposeClamped as transposeClamped,\n mnnTransposeModded as transposeModded,\n} from \"./internal/conversion.js\";\nexport * from \"./internal/MidiNoteNumber.js\";\n","export {\n pcFromMnn as fromMnn,\n icBetweenPc as ic,\n picBetweenPc as pic,\n pcTranspose as transpose,\n} from \"./internal/conversion.js\";\nexport * from \"./internal/PitchClass.js\";\n","export * from \"./internal/PitchClassSet.js\";\n","import { all, RangedNat } from \"./Literal.js\";\nimport { isNonNegativeInt, NonNegativeInt } from \"./NonNegativeInt.js\";\n\nexport interface TwelveBitsBrand {\n readonly TwelveBits: unique symbol;\n}\n\nexport type TwelveBits = NonNegativeInt & TwelveBitsBrand;\n\nexport const isTwelveBits = (v: unknown): v is TwelveBits =>\n isNonNegativeInt(v) && v < 1 << 12;\n\nexport type PartialTwelveBits =\n | 0b000000000000\n | 0b000000000001\n | 0b000000000010\n | 0b000000000100\n | 0b000000001000\n | 0b000000010000\n | 0b000000100000\n | 0b000001000000\n | 0b000010000000\n | 0b000100000000\n | 0b001000000000\n | 0b010000000000\n | 0b100000000000\n | 0b111111111101\n | 0b111111111011\n | 0b111111110111\n | 0b111111101111\n | 0b111111011111\n | 0b111110111111\n | 0b111101111111\n | 0b111011111111\n | 0b110111111111\n | 0b101111111111\n | 0b011111111111\n | 0b111111111111;\n\nexport type Value = RangedNat<0, 11>;\n\nexport const EMPTY = 0 as TwelveBits;\nexport const ALL = 0b111111111111 as TwelveBits;\n\nexport const masked = (v: number) => (v & ALL) as TwelveBits;\n\nconst one = (value: Value) => (1 << value) as TwelveBits;\nexport const fromValues = (...values: Value[]) => values.map(one).reduce(union);\n\nexport const values = (a: TwelveBits) =>\n all(0, 11).filter((value) => has(a, value));\n\nexport const complement = (a: TwelveBits) => masked(~a);\n\nexport const union = (a: TwelveBits, b: TwelveBits) => (a | b) as TwelveBits;\n\nexport const intersection = (a: TwelveBits, b: TwelveBits) =>\n (a & b) as TwelveBits;\n\nexport const symmetricDifference = (a: TwelveBits, b: TwelveBits) =>\n (a ^ b) as TwelveBits;\n\nexport const difference = (a: TwelveBits, b: TwelveBits) =>\n intersection(a, complement(b));\n\nexport const has = (a: TwelveBits, value: Value) =>\n Boolean(intersection(a, fromValues(value)));\n\nexport const add = (a: TwelveBits, value: Value) => union(a, fromValues(value));\n\nexport const remove = (a: TwelveBits, value: Value) =>\n intersection(a, complement(fromValues(value)));\n\nexport const toggle = (a: TwelveBits, value: Value) =>\n symmetricDifference(a, fromValues(value));\n\nexport const isSuperset = (a: TwelveBits, of: TwelveBits) =>\n !intersection(complement(a), of);\n\nexport const isSubset = (a: TwelveBits, of: TwelveBits) => isSuperset(of, a);\n","import { PitchClass } from \"./PitchClass.js\";\nimport * as PC from \"./PitchClass.js\";\nimport * as TB from \"./refined/TwelveBits.js\";\n\nexport type Shape = TB.TwelveBits;\nexport const hasShape = TB.isTwelveBits;\n\nexport interface PitchClassSetBrand {\n readonly PitchClassSet: unique symbol;\n}\n\nexport type PitchClassSet = Shape & PitchClassSetBrand;\n\nexport const mark = (_v: Shape): _v is PitchClassSet => true;\nexport const markRaw = (v: number): v is PitchClassSet => hasShape(v);\nexport const markRawUnknown = (v: unknown): v is PitchClassSet => hasShape(v);\n\nexport const fromRaw = (v: TB.TwelveBits | TB.PartialTwelveBits) =>\n v as PitchClassSet;\nexport const fromRawMasked = (v: number) => fromRaw(TB.masked(v));\nexport const fromRawUnknown = (v: unknown) =>\n TB.isTwelveBits(v) ? fromRaw(v) : undefined;\n\nexport const EMPTY = fromRaw(TB.EMPTY);\nexport const ALL = fromRaw(TB.ALL);\n\nexport const from = (...values: PitchClass[]) =>\n fromRaw(TB.fromValues(...values));\n\nexport const toggleAll = (pcs: PitchClassSet) => fromRaw(TB.complement(pcs));\n\nexport const union = (a: PitchClassSet, b: PitchClassSet) =>\n fromRaw(TB.union(a, b));\n\nexport const intersection = (a: PitchClassSet, b: PitchClassSet) =>\n fromRaw(TB.intersection(a, b));\n\nexport const symmetricDifference = (a: PitchClassSet, b: PitchClassSet) =>\n fromRaw(TB.symmetricDifference(a, b));\n\nexport const difference = (a: PitchClassSet, b: PitchClassSet) =>\n fromRaw(TB.difference(a, b));\n\nexport const has = (pcs: PitchClassSet, pc: PitchClass) => TB.has(pcs, pc);\n\nexport const add = (pcs: PitchClassSet, pc: PitchClass) =>\n fromRaw(TB.add(pcs, pc));\n\nexport const remove = (pcs: PitchClassSet, pc: PitchClass) =>\n fromRaw(TB.remove(pcs, pc));\n\nexport const toggle = (pcs: PitchClassSet, pc: PitchClass) =>\n fromRaw(TB.toggle(pcs, pc));\n\nexport const isSuperset = (value: PitchClassSet, of: PitchClassSet) =>\n TB.isSuperset(value, of);\n\nexport const isSubset = (value: PitchClassSet, of: PitchClassSet) =>\n TB.isSubset(value, of);\n\nexport const values = (pcs: PitchClassSet) => TB.values(pcs).map(PC.from);\n","export {\n piBetweenMnn as between,\n picFromPi as pic,\n stFromPi as semitones,\n} from \"./internal/conversion.js\";\nexport * from \"./internal/PitchInterval.js\";\n","export {\n picBetweenPc as between,\n picFromPi as fromPi,\n picFromSemitones as fromSemitones,\n icFromPic as ic,\n} from \"./internal/conversion.js\";\nexport * from \"./internal/PitchIntervalClass.js\";\n","export * from \"./internal/PitchIntervalClassSet.js\";\n","import { PitchIntervalClass } from \"./PitchIntervalClass.js\";\nimport * as PIC from \"./PitchIntervalClass.js\";\nimport * as TB from \"./refined/TwelveBits.js\";\n\nexport type Shape = TB.TwelveBits;\nexport const hasShape = TB.isTwelveBits;\n\nexport interface PitchIntervalClassSetBrand {\n readonly PitchIntervalClassSet: unique symbol;\n}\n\nexport type PitchIntervalClassSet = Shape & PitchIntervalClassSetBrand;\n\nexport const mark = (_v: Shape): _v is PitchIntervalClassSet => true;\nexport const markRaw = (v: number): v is PitchIntervalClassSet => hasShape(v);\nexport const markRawUnknown = (v: unknown): v is PitchIntervalClassSet =>\n hasShape(v);\n\nexport const fromRaw = (v: TB.TwelveBits | TB.PartialTwelveBits) =>\n v as PitchIntervalClassSet;\nexport const fromRawMasked = (v: number) => fromRaw(TB.masked(v));\nexport const fromRawUnknown = (v: unknown) =>\n TB.isTwelveBits(v) ? fromRaw(v) : undefined;\n\nexport const EMPTY = fromRaw(TB.EMPTY);\nexport const ALL = fromRaw(TB.ALL);\n\nconst one = (pc: PitchIntervalClass) => (1 << pc) as PitchIntervalClassSet;\nexport const from = (...values: PitchIntervalClass[]) =>\n values.map(one).reduce(union);\n\nexport const toggleAll = (pcs: PitchIntervalClassSet) =>\n (~pcs & ALL) as PitchIntervalClassSet;\n\nexport const union = (a: PitchIntervalClassSet, b: PitchIntervalClassSet) =>\n (a | b) as PitchIntervalClassSet;\n\nexport const intersection = (\n a: PitchIntervalClassSet,\n b: PitchIntervalClassSet,\n) => (a & b) as PitchIntervalClassSet;\n\nexport const symmetricDifference = (\n a: PitchIntervalClassSet,\n b: PitchIntervalClassSet,\n) => (a ^ b) as PitchIntervalClassSet;\n\nexport const difference = (\n a: PitchIntervalClassSet,\n b: PitchIntervalClassSet,\n) => intersection(a, toggleAll(b));\n\nexport const has = (pcs: PitchIntervalClassSet, pc: PitchIntervalClass) =>\n Boolean(intersection(pcs, from(pc)));\n\nexport const add = (pcs: PitchIntervalClassSet, pc: PitchIntervalClass) =>\n union(pcs, from(pc));\n\nexport const remove = (pcs: PitchIntervalClassSet, pc: PitchIntervalClass) =>\n intersection(pcs, toggleAll(from(pc)));\n\nexport const toggle = (pcs: PitchIntervalClassSet, pc: PitchIntervalClass) =>\n symmetricDifference(pcs, from(pc));\n\nexport const isSuperset = (\n value: PitchIntervalClassSet,\n of: PitchIntervalClassSet,\n) => !intersection(toggleAll(value), of);\n\nexport const isSubset = (\n value: PitchIntervalClassSet,\n of: PitchIntervalClassSet,\n) => isSuperset(of, value);\n\nexport const values = (pics: PitchIntervalClassSet) =>\n TB.values(pics).map(PIC.from);\n","export {\n stBetweenMnn as between,\n stFromPi as fromPi,\n picFromSemitones as pic,\n} from \"./internal/conversion.js\";\nexport * from \"./internal/Semitones.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA,uBAAAC;AAAA,EAAA,0BAAAC;AAAA,EAAA;AAAA,mBAAAC;AAAA;AAAA;;;ACAA;AAAA;AAAA,aAAAC;AAAA,EAAA,WAAAC;AAAA,EAAA,WAAAC;AAAA,EAAA;AAAA,cAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA;AAAA,qBAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,mBAAAC;AAAA;;;ACCO,IAAM,MAAM,CAAC,GAAW,OAAgB,IAAI,IAAK,KAAK;;;ACwBtD,IAAM,KACX,CAAqC,OAAU,QAC/C,CAAI,MACF,OAAO,cAAc,CAAC,KACtB,SAAU,KACT,KAA2B;AAEzB,IAAM,QACX,CAAqC,OAAU,QAC/C,CAAC,MACC,IAAI,QAAQ,QAAQ,IAAI,MAAM,MAAO;AAKlC,IAAM,SACX,CAAqC,OAAU,QAC/C,CAAC,MAA4B;AAC3B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Aa,CACxB,GACA,MACGF,cAAa,GAAGD,WAAU,CAAC,CAAC;AAE1B,IAAMI,OAAM,CAAC,KAA4B,OAC9C,QAAQH,cAAa,KAAKJ,MAAK,EAAE,CAAC,CAAC;AAE9B,IAAMQ,OAAM,CAAC,KAA4B,OAC9CN,OAAM,KAAKF,MAAK,EAAE,CAAC;AAEd,IAAMS,UAAS,CAAC,KAA4B,OACjDL,cAAa,KAAKD,WAAUH,MAAK,EAAE,CAAC,CAAC;AAEhC,IAAMU,UAAS,CAAC,KAA4B,OACjDL,qBAAoB,KAAKL,MAAK,EAAE,CAAC;AAE5B,IAAMW,cAAa,CACxB,OACA,OACG,CAACP,cAAaD,WAAU,KAAK,GAAG,EAAE;AAEhC,IAAMS,YAAW,CACtB,OACA,OACGD,YAAW,IAAI,KAAK;AAElB,IAAMV,UAAS,CAAC,SAClB,OAAO,IAAI,EAAE,IAAQD,KAAI;;;AC3E9B,IAAAa,qBAAA;AAAA,SAAAA,oBAAA;AAAA,aAAAC;AAAA,EAAA;AAAA,cAAAC;AAAA,EAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA,qBAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA;AAAA;","names":["MidiNoteNumber_exports","PitchClass_exports","PitchInterval_exports","PitchIntervalClass_exports","Semitones_exports","ALL","MAX","MIN","from","fromIntClamp","fromIntMod","fromNum","fromUnknown","hasShape","mark","markNum","markUnknown","fromUnknown","min","max","hasShape","mark","markNum","markUnknown","from","fromNum","fromIntClamp","fromIntMod","fromUnknown","const_","MIN","MAX","ALL","hasShape","mark","markNum","markUnknown","from","fromNum","fromUnknown","add","addChecked","sub","subChecked","mul","mulChecked","mulRound","mulTrunc","divChecked","divRound","divTrunc","min","max","hasShape","mark","markNum","markUnknown","from","fromNum","fromIntClamp","fromIntMod","fromUnknown","const_","MIN","MAX","ALL","invert","hasShape","mark","markNum","markUnknown","from","fromNum","fromUnknown","const_","MIN","octaves","invert","fromIntMod","from","min","max","hasShape","mark","markNum","markUnknown","from","fromNum","fromIntClamp","fromIntMod","fromUnknown","const_","MIN","MAX","ALL","MidiNoteNumber_exports","PitchClass_exports","ALL","MAX","MIN","from","fromIntClamp","fromIntMod","fromNum","fromUnknown","hasShape","mark","markNum","markUnknown","ALL","EMPTY","add","difference","from","has","hasShape","intersection","isSubset","isSuperset","mark","remove","symmetricDifference","toggle","union","values","ALL","values","add","hasShape","mark","EMPTY","ALL","from","values","union","intersection","symmetricDifference","difference","has","add","remove","toggle","isSuperset","isSubset","PitchInterval_exports","add","addChecked","divChecked","divRound","divTrunc","from","fromNum","fromUnknown","hasShape","mark","markNum","markUnknown","mul","mulChecked","mulRound","mulTrunc","sub","subChecked","PitchIntervalClass_exports","ALL","MAX","MIN","from","fromIntClamp","fromIntMod","fromNum","fromUnknown","hasShape","invert","mark","markNum","markUnknown","ALL","EMPTY","add","difference","from","fromRaw","fromRawMasked","fromRawUnknown","has","hasShape","intersection","isSubset","isSuperset","mark","markRaw","markRawUnknown","remove","symmetricDifference","toggle","toggleAll","union","values","hasShape","mark","markRaw","markRawUnknown","fromRaw","fromRawMasked","fromRawUnknown","EMPTY","ALL","one","from","values","union","toggleAll","intersection","symmetricDifference","difference","has","add","remove","toggle","isSuperset","isSubset","Semitones_exports","MIN","from","fromNum","fromUnknown","hasShape","mark","markNum","markUnknown","octaves"]}