https://github.com/benjamindehli/music-utils
Detect chord names from MIDI note input
https://github.com/benjamindehli/music-utils
chords javascript midi music scales typescript
Last synced: 2 months ago
JSON representation
Detect chord names from MIDI note input
- Host: GitHub
- URL: https://github.com/benjamindehli/music-utils
- Owner: benjamindehli
- License: gpl-3.0
- Created: 2026-03-07T16:22:32.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-06T21:17:35.000Z (3 months ago)
- Last Synced: 2026-04-07T13:31:03.486Z (3 months ago)
- Topics: chords, javascript, midi, music, scales, typescript
- Language: TypeScript
- Homepage:
- Size: 598 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @benjamindehli/music-utils
A TypeScript/JavaScript library for music theory utilities and chord detection from MIDI note input.
## Features
- Detect chord names from MIDI note input
- Music theory classes: Chord, Interval, Note, Scale, Midi, NoteSelection
- Data modules for chords, intervals, notes, scales, selection types
- Helper functions for matching and note normalization
- Deep import support for optimized usage and tree-shaking
- TypeScript type definitions included
## Installation
```bash
yarn add @benjamindehli/music-utils
# or
npm install @benjamindehli/music-utils
```
## Usage
### Top-level import
```js
import { Midi, getChordsFromSelectedNotes } from '@benjamindehli/music-utils';
const midi = new Midi();
midi.init(handleMIDIMessage);
const detectedChord = getChordsFromSelectedNotes([60, 64, 67]);
```
### Deep imports
```js
import Chord from '@benjamindehli/music-utils/classes/Chord';
import chords from '@benjamindehli/music-utils/data/chords';
import { getChordsFromSelectedNotes } from '@benjamindehli/music-utils/helpers/matchHelpers';
```
## API Overview
- **Classes**: Chord, Interval, Midi, Note, NoteSelection, Scale
- **Data**: chords, intervals, notes, scales, selectionTypes
- **Helpers**: getChordsFromSelectedNotes, getRelativeNoteNumber, normalizeHalfStep, normalizeHalfSteps
## TypeScript Support
All exports include type definitions for seamless TypeScript integration.