一個全面的 Dart 庫,旨在簡化音樂理論概念的使用。它提供了處理音符、音階、和弦、音程和調號的工具,擁有直觀的 API。非常適合用於建構音樂應用程式、教育工具或音訊處理功能的開發者,支援在 Android、iOS、Web、macOS、Windows 和 Linux 上進行跨平台開發。該庫將複雜的音樂關係抽象為易於使用的函數,從而實現準確且高效的音樂相關計算。
適用情境
音樂應用開發
互動音樂教育
和弦與音階生成
音頻應用邏輯
即時音樂分析
成分輔助
主要特色
注意和音程操作
音階和和弦構成
調號支援
跨平台相容性
直覺的 API 設計
準確的音樂理論計算
適合對象
Dart 開發者在音樂應用中
教育軟體創作者
音頻處理專案
使用基於代碼的工具的音樂家
需要音樂理論邏輯的應用建構者
使用建議
需要了解基本的音樂理論
僅限理論方面(不包括音訊播放)
無內建音效合成
最佳搭配其他音訊程式庫使用
可能需要針對進階使用案例進行客製化
專注於核心功能的文件
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
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.