Frequently Asked Questions
General Questions
What is MusicTheory?
MusicTheory is a comprehensive .NET library that models music theory concepts as code. It provides immutable domain objects for notes, intervals, scales, chords, and more, making it easy to work with music theory programmatically.
Who is this library for?
The library is designed for:
Developers building music applications
Music educators creating teaching tools
Musicians who want to analyze music programmatically
Students learning music theory through code
Researchers working on music analysis projects
What .NET versions are supported?
The library targets .NET 9.0 and is compatible with:
.NET 9.0 and later
Any platform that supports .NET (Windows, macOS, Linux)
Technical Questions
Why are all objects immutable?
Immutability provides several benefits:
Thread safety: Objects can be safely shared between threads
Predictability: Objects never change after creation
Performance: The compiler can optimize immutable objects
Functional programming: Supports functional programming patterns
How does the library handle enharmonic equivalents?
The library recognizes enharmonic equivalents (notes that sound the same but are spelled differently):
How accurate is the frequency calculation?
The library uses the equal temperament tuning system with A4 = 440 Hz as the reference:
Frequencies are calculated using the formula: f = 440 × 2^((n-69)/12)
where n is the MIDI note number.
Usage Questions
How do I create a chord progression?
Use the ChordProgression
class with a key signature:
How do I transpose a melody?
Transpose individual notes or entire collections:
How do I work with different scale types?
The library supports 15+ scale types:
How do I check if a note is in a scale?
Use the Contains
method:
Common Issues
Why does my chord sound wrong?
Check these common issues:
Wrong octave: Ensure notes are in the intended octave
Enharmonic spelling: Use the correct enharmonic (C# vs Db)
Chord type: Verify you're using the right ChordType enum value
How do I handle MIDI note ranges?
MIDI notes range from 0-127. The library validates this:
Why are there no audio playback features?
The MusicTheory library focuses on music theory concepts and calculations. For audio playback, integrate with audio libraries like:
NAudio
CSCore
Unity Audio (for games)
Web Audio API (for web apps)
Best Practices
Should I use ChordQuality or ChordType?
Use ChordType
for specific chord types:
How should I handle user input?
Parse and validate user input carefully:
What's the best way to learn the library?
Contributing
How can I contribute?
Fork the repository on GitHub
Create a feature branch
Write tests first (TDD approach)
Implement your feature
Ensure all tests pass
Submit a pull request
Where do I report bugs?
Report issues on the GitHub Issues page.
Is there a roadmap?
Check the README for planned features. Current priorities include:
Advanced chord progressions
Voice leading analysis
Music notation support
Audio synthesis integration