Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pitch

Hierarchy

  • Pitch

Index

Constructors

constructor

Properties

Private accidental

accidental: AccidentalEnum = AccidentalEnum.NONE

Private frequency

frequency: number

Private fundamentalNote

fundamentalNote: NoteEnum

Private halfTone

halfTone: number

Private octave

octave: number

Static Private halftoneFactor

halftoneFactor: number = 12 / (Math.LN2 / Math.LN10)

Static Private octXmlDiff

octXmlDiff: number = 3

Static pitchEnumValues

pitchEnumValues: NoteEnum[] = [NoteEnum.C, NoteEnum.D, NoteEnum.E, NoteEnum.F, NoteEnum.G, NoteEnum.A, NoteEnum.B,]

Accessors

Accidental

Frequency

  • get Frequency(): number

FundamentalNote

Octave

  • get Octave(): number

Static OctaveXmlDifference

  • get OctaveXmlDifference(): number

Methods

DoEnharmonicChange

  • DoEnharmonicChange(): void

OperatorEquals

  • OperatorEquals(p2: Pitch): boolean

OperatorNotEqual

  • OperatorNotEqual(p2: Pitch): boolean

ToString

  • ToString(): string

getHalfTone

  • getHalfTone(): number

Private getHigherPitchByTransposeFactor

  • getHigherPitchByTransposeFactor(factor: number): Pitch

Private getLowerPitchByTransposeFactor

  • getLowerPitchByTransposeFactor(factor: number): Pitch

Private getNextFundamentalNote

Private getPreviousFundamentalNote

getTransposedPitch

  • getTransposedPitch(factor: number): Pitch

Static CalculateTransposedHalfTone

  • CalculateTransposedHalfTone(pitch: Pitch, transpose: number): object
  • constructor

    Parameters

    • pitch: Pitch
    • transpose: number

    Returns object

    ret[0] = the transposed fundamental. ret[1] = the octave shift (not the new octave!)

    • overflow: number
    • value: number

Static WrapAroundCheck

  • WrapAroundCheck(value: number, limit: number): object

Static calcFractionalKey

  • calcFractionalKey(frequency: number): number

Static calcFrequency

  • calcFrequency(obj: Pitch | number): number

Static ceiling

Static floor

Static fromFrequency

  • fromFrequency(frequency: number): Pitch

Static fromHalftone

  • fromHalftone(halftone: number): Pitch

Static getNoteEnumString

  • getNoteEnumString(note: NoteEnum): string

Generated using TypeDoc