Bunny is a JavaScript library for music theory calculations, providing some common methods and constants for music theory calculations.
Install via npm:
npm install @emotionl/bunny --save
getScale(key: Note, mode: Mode, isSharp: boolean = true, withOctave: boolean = false): SingleNoteList
Gets the scale of a specified mode.
key
: The tonic of the scale.mode
: The name of the mode.isSharp
: Whether to use sharps or flats in the scale (default istrue
).withOctave
: Whether to include an octave of notes (default isfalse
).- Returns: An array containing a list of notes.
Gets the circle of fifths for all modes.
isSharp
: Whether to use sharps or flats in the modes (default istrue
).- Returns: An array of objects containing the name of the mode and the notes for the major and relative minor keys.
getNoteListByStep(startNote: Note, interval: Interval, amount: number, isSharp: boolean = true): SingleNoteList
Gets a list of notes starting from a specified note and following a specified interval pattern.
startNote
: The starting note.interval
: The interval pattern.amount
: The number of notes to include in the list.isSharp
: Whether to use sharps or flats in the notes (default istrue
).- Returns: An array containing a list of notes.
Gets the list of semitones for a specified mode.
mode
: The name of the mode.withOctave
: Whether to include an octave of notes (default isfalse
).- Returns: An array containing a list of semitones.
Gets the list of mode names.
- Returns: An array containing a list of mode names.
Gets the list of intervals for a specified mode.
mode
: The name of the mode.withOctave
: Whether to include an octave of notes (default isfalse
).- Returns: An array containing a list of intervals.
MIT.