Namespace: PitchInterval
Interfaces
References
between
Renames and re-exports pi
Type Aliases
PitchInterval
Ƭ PitchInterval: Shape
& PitchIntervalBrand
Ordered pitch interval
Number of semitones that separates one pitch from another, upward or downward.
See
https://en.wikipedia.org/wiki/Pitch_interval#Ordered_Pitch_Interval
Defined in
Functions
add
▸ add(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | PitchInterval |
Returns
Defined in
addChecked
▸ addChecked(a
, b
): Int
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | PitchInterval |
Returns
Int
Defined in
direction
▸ direction(pi
): -1
| 0
| 1
Parameters
Name | Type |
---|---|
pi | PitchInterval |
Returns
-1
| 0
| 1
Defined in
divChecked
▸ divChecked(a
, b
): Int
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | PitchInterval |
Returns
Int
Defined in
divRound
▸ divRound(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | number |
Returns
Defined in
divTrunc
▸ divTrunc(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | number |
Returns
Defined in
from
▸ from(v
): PitchInterval
Parameters
Name | Type |
---|---|
v | Int | PartialPitchInterval |
Returns
Defined in
fromNum
▸ fromNum(v
): PitchInterval
Parameters
Name | Type |
---|---|
v | number |
Returns
Defined in
fromNumRound
▸ fromNumRound(v
): PitchInterval
Parameters
Name | Type |
---|---|
v | number |
Returns
Defined in
fromNumTrunc
▸ fromNumTrunc(v
): PitchInterval
Parameters
Name | Type |
---|---|
v | number |
Returns
Defined in
fromUnknown
▸ fromUnknown(v
): PitchInterval
Parameters
Name | Type |
---|---|
v | unknown |
Returns
Defined in
hasShape
▸ hasShape<T
>(v
): v is T & number & IntBrand
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
v | T |
Returns
v is T & number & IntBrand
Defined in
mark
▸ mark(_v
): _v is PitchInterval
Parameters
Name | Type |
---|---|
_v | Int |
Returns
_v is PitchInterval
Defined in
markNum
▸ markNum(v
): v is PitchInterval
Parameters
Name | Type |
---|---|
v | number |
Returns
v is PitchInterval
Defined in
markUnknown
▸ markUnknown(v
): v is PitchInterval
Parameters
Name | Type |
---|---|
v | unknown |
Returns
v is PitchInterval
Defined in
mul
▸ mul(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | Int |
Returns
Defined in
mulChecked
▸ mulChecked(a
, b
): Int
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | PitchInterval |
Returns
Int
Defined in
mulRound
▸ mulRound(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | number |
Returns
Defined in
mulTrunc
▸ mulTrunc(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | number |
Returns
Defined in
octaves
▸ octaves(pi
): NonNegativeInt
Parameters
Name | Type |
---|---|
pi | PitchInterval |
Returns
NonNegativeInt
Defined in
pic
▸ pic(pi
): PitchIntervalClass
Gets the pitch interval class of the pitch interval.
Parameters
Name | Type |
---|---|
pi | PitchInterval |
Returns
Example
import * as PI from "brand-music/PitchInterval";
import * as PIC from "brand-music/PitchIntervalClass";
const picOfPi = PIC.fromPi(PI.from(-2)); // 10
const picOfSemitones = PIC.fromSemitones(PI.semitones(PI.from(-2))); // 2
Defined in
semitones
▸ semitones(pi
): Semitones
Parameters
Name | Type |
---|---|
pi | PitchInterval |
Returns
Defined in
sub
▸ sub(a
, b
): PitchInterval
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | PitchInterval |
Returns
Defined in
subChecked
▸ subChecked(a
, b
): Int
Parameters
Name | Type |
---|---|
a | PitchInterval |
b | PitchInterval |
Returns
Int