Command-line interface for Celeritas Music Engine. Provides music analysis, MIDI processing, chord recognition, key detection, transposition, and more.
$ dotnet add package Celeritas.CLI<p align="center"> <img src="assets/banner.jpg" alt="Celeritas Banner" width="800"/> </p>Celeritas (Latin: swiftness) — High-Performance Music Engine for .NET
Author: Vladimir V. Shein
Celeritas is a high-performance symbolic music analysis and generation engine focused on harmony, structure, and algorithmic composition. It leverages SIMD instructions (AVX-512, AVX2, SSE2, NEON) for maximum performance.
This is NOT:
This IS:
🚧 Active Development — Experimental / Research Project
⚠️ API is not stable yet — Breaking changes may occur
Current version: v0.9.0 (December 2025)
350 tests passing (C#) + 35 tests (Python)
ctypes layer backed by a NativeAOT library for core operations.pythonnet so you can call the entire managed Celeritas API from Python.Quick start (full .NET API):
pip install -e ./bindings/python
pip install pythonnet
dotnet build src/Celeritas/Celeritas.csproj -c Release
from celeritas import load_celeritas
Celeritas = load_celeritas().namespace
Celeritas is designed for extreme performance.
Benchmark numbers below are example measurements on AMD Ryzen 9 7900X (.NET 10, AVX-512). Results vary by CPU, OS, .NET version, and workload:
Transpose_1M_Notes : 29.5 µs (~34 ns/note, ~34 million notes/sec)
Transpose_10M_Notes : 742 µs (~74 ns/note, ~13 million notes/sec)
ChordAnalysis_GetMask : 1.0 ns (bit mask generation)
ChordAnalysis_Identify : 1.7 ns (chord identification from mask)
MusicNotation_ParseSingle : 12.2 ns (parse "C#4" → pitch)
Progression_Analyze : 2.3 µs (full harmonic analysis)
Quantize_1M_Notes : 1.29 ms (rhythmic quantization)
Run benchmarks:
dotnet run --project src/Celeritas.Benchmarks -c Release
"C4/4 [E4 G4]/4 G4/2." supports notes, chords, rests[C4 E4 G4]/4 or (C4 E4 G4):qPitchClass, ChromaticInterval, SpnNote for mod-12 pitch classes, intervals, and SPN notesR/4, R:q, etc.C4/4~ C4/4 → single note<< bass | melody >> for piano, SATB, counterpoint| bars and validate durations match time signature@bpm 120 -> 140 /2 (accelerando/ritardardo)@dynamics, @cresc, @dimFormatNoteSequence, FormatWithDirectives with chord groupingDm7, C7(b9,#11), C7+5, C|G, C/Edotnet add package Celeritas
Or via NuGet Package Manager:
Install-Package Celeritas
# Install globally
dotnet tool install --global Celeritas.CLI
# Use from anywhere
celeritas --version
celeritas analyze --notes C4 E4 G4
Update to latest version:
dotnet tool update --global Celeritas.CLI
Parse music notation:
using Celeritas.Core;
// Simple notes
var notes = MusicNotation.Parse("C4 E4 G4 B4");
// With durations and chords
var melody = MusicNotation.Parse("C4/4 [E4 G4]/4 G4/2.");
// Time signatures and measures
var song = MusicNotation.Parse("4/4: C4/4 E4/4 G4/4 C5/4 | D4/1");
// With directives (tempo, dynamics)
var result = MusicNotationAntlrParser.Parse(
"@bpm 120 @dynamics mf C4/4 E4/4 G4/4");
Analyze chords and keys:
using Celeritas.Core.Analysis;
// Chord identification
var chord = ChordAnalyzer.Identify("C4 E4 G4 B4");
Console.WriteLine(chord); // Output: Cmaj7
// Key detection
var melody = MusicNotation.Parse("C4/4 D4/4 E4/4 F4/4 G4/4");
var key = KeyAnalyzer.DetectKey(melody);
Console.WriteLine(key); // Output: C major
// Modal analysis
var scale = MusicNotation.Parse("D4 E4 F4 G4 A4 B4 C5 D5");
var mode = ModeLibrary.DetectModeWithRoot(scale);
Console.WriteLine(mode); // Output: D Dorian
Parse chord symbols (ANTLR):
using Celeritas.Core.Analysis;
var pitches1 = ProgressionAdvisor.ParseChordSymbol("C7(b9,#11)");
var pitches2 = ProgressionAdvisor.ParseChordSymbol("C7+5");
var pitches3 = ProgressionAdvisor.ParseChordSymbol("C|G"); // polychord layering
var pitches4 = ProgressionAdvisor.ParseChordSymbol("C/E"); // slash bass
Console.WriteLine(string.Join(" ", pitches1));
Note arithmetic (pitch classes, intervals, scientific pitch notation):
using Celeritas.Core;
// Pitch-class arithmetic wraps modulo 12
var pc = PitchClass.C;
var d = pc + 2;
Console.WriteLine(d); // D
// Differences return intervals
var asc = PitchClass.C - PitchClass.B; // +1 (ascending wrap)
var shortest = PitchClass.C.SignedIntervalTo(PitchClass.B); // -1 (shortest signed)
Console.WriteLine(asc.SimpleName); // m2
Console.WriteLine(shortest.Semitones); // -1
// Notes with octave (SPN) + transposition
var c4 = SpnNote.C(4);
var e4 = c4 + ChromaticInterval.MajorThird;
Console.WriteLine(e4); // E4
// Control enharmonic spelling when formatting
Console.WriteLine(SpnNote.CSharp(4).ToNotation(preferSharps: false)); // Db4
Examples - Working code samples organized by topic
Cookbook - Common patterns and recipes
Python Guide - Using Celeritas from Python
# Chord analysis
celeritas analyze --notes C4 E4 G4 B4
# Key detection
celeritas keydetect --notes C4 E4 G4 B4 D5
# Mode detection
celeritas mode --notes C D Eb F G A Bb
# Progression analysis
celeritas progression --chords Dm7 G7 Cmaj7 Am7
# MIDI file analysis
celeritas midi analyze --in song.mid
# Transpose notes or MIDI
celeritas transpose --semitones 5 --notes C4 E4 G4
celeritas midi transpose --in song.mid --out transposed.mid --semitones 2
# Export to MIDI
celeritas midi export --out output.mid --notes "4/4: C4/4 E4/4 G4/4"
# System info
celeritas info
For complete CLI documentation, see celeritas --help.
Requirements:
git clone https://github.com/sheinv78/Celeritas.git
cd Celeritas
dotnet build
dotnet test
dotnet publish src/Celeritas.CLI -c Release -r win-x64
dotnet publish src/Celeritas.CLI -c Release -r linux-x64
dotnet publish src/Celeritas.CLI -c Release -r osx-arm64
# C# tests
dotnet test
# Python tests
cd bindings/python
python test_celeritas.py
Current: 350 C# tests + 35 Python tests, all passing
Highlights:
| Platform | SIMD | Status | Performance |
|---|---|---|---|
| x64 Intel/AMD | AVX-512 | ✅ | ~34M notes/sec |
| x64 Intel/AMD | AVX2 | ✅ | ~13M notes/sec |
| x64 Intel/AMD | SSE2 | ✅ | ~10M notes/sec |
| ARM64 | NEON | ✅ | ~10-15M notes/sec |
| WebAssembly | SIMD128 | ✅ | ~5-10M notes/sec |
| Fallback | Scalar | ✅ | ~1M notes/sec |
Licensed under the Business Source License 1.1 (BSL-1.1).
Change Date: 2030-01-01 (then: Apache-2.0)
Until the Change Date, commercial production use requires a commercial license.
For commercial use, contact us.
Celeritas uses the following third-party libraries:
All other functionality (SIMD acceleration, harmonic analysis, voice leading, rhythm analysis, etc.) is implemented natively in Celeritas.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)git clone https://github.com/sheinv78/Celeritas.git
cd Celeritas
dotnet restore
dotnet build
dotnet test
Releases are automated via GitHub Actions:
Development builds - Automatic on push to main
Stable releases - Create a tag:
git tag v0.9.0
git push origin v0.9.0
This triggers:
Note: Set NUGET_API_KEY secret in GitHub repository settings.
Made with ⚡ and 🎵