Package selection guidance compiled from public package information, community data, and project usage.
A comprehensive Dart library designed to simplify working with music theory concepts. It provides tools for handling notes, scales, chords, intervals, and key signatures with intuitive APIs. Ideal for developers building music applications, educational tools, or audio processing features, it supports cross-platform development across Android, iOS, Web, macOS, Windows, and Linux. The library abstracts complex musical relationships into easy-to-use functions, enabling accurate and efficient music-related computations.
Use cases
Music app development
Interactive music education
Chord and scale generation
Audio application logic
Real-time music analysis
Composition assistance
Key features
Note and interval manipulation
Scale and chord construction
Key signature support
Cross-platform compatibility
Intuitive API design
Accurate music theory calculations
Suitable for
Dart developers in music apps
Educational software creators
Audio processing projects
Musicians using code-based tools
App builders needing music theory logic
Considerations
Requires understanding of basic music theory
Limited to theoretical aspects (not audio playback)
No built-in sound synthesis
Best used with additional audio libraries
May need customization for advanced use cases
Documentation focused on core functionality
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
A comprehensive Dart library for effortlessly working with music theory concepts,
offering an elegant and beautifully crafted API.
Features
Notes, accidentals, and enharmonic operations
Intervals, qualities, and circle of fifths
Chords, scales, harmonic functions, inversions and retrogrades
Keys, key signatures, and modes
Frequencies and tuning systems (work in progress)
Usage
Import the package into your Dart code:
import'package:music_notes/music_notes.dart';
Now, you can use the provided APIs to perform various music theory operations.
For more detailed usage instructions and examples, please refer to the
API documentation.
Notes
Define a Note from a NoteName (.a to .g) and an Accidental, or using their
shorthand static constants:
constNote(.e, .flat); // E♭Note.c; // CNote.d; // DNote.f; // F
NoteNames can be obtained from semitones or ordinal:
ScalePattern.lydian.on(Note.d); // D Lydian (D E F♯ G♯ A B C♯ D)ScalePattern.wholeTone.on(Note.f); // F Whole-tone (F G A B C♯ D♯ F)ScalePattern.majorPentatonic.on(Note.g.flat);
// G♭ Major pentatonic (G♭ A♭ B♭ D♭ E♭ G♭)
Or get it from a Key:
Note.a.flat.major.scale; // A♭ Major (ionian) (A♭ B♭ C D♭ E♭ F G A♭)Note.d.minor.scale; // D Natural minor (aeolian) (D E F G A B♭ C D)
Even experiment with any ScaleDegree or HarmonicFunction:
ScalePattern.lydian.on(Note.e).degree(.iv); // A♯Note.c.major.scale.functionChord(
HarmonicFunction.dominantV / .dominantV,
); // D
Rearrange any collection of Notes, Pitches or PitchClasses
as inversion or retrograde:
ScalePattern
.lydian // Lydian (M2 M2 M2 m2 M2 M2 m2)
.on(Note.parse('a')) // A Lydian (A B C♯ D♯ E F♯ G♯ A)
.transposeBy(.M2) // B Lydian (B C♯ D♯ E♯ F♯ G♯ A♯ B)
.degree(.iii) // D♯
.respelledUpwards // E♭
.major // E♭ major
.relative // C minor
.scale // C Natural minor (aeolian) (C D E♭ F G A♭ B♭ C)
.degreeChord(.v) // G-
.add9(); // G-9
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.