Coltrane Documentation
repository·master·Indexed 25 days ago
https://github.com/pedrozath/coltraneA Ruby-based music calculation library and CLI tool for musicians. Coltrane provides functionality for chord and scale discovery, progression generation, and visual fretboard representations for guitar, bass, piano, and ukulele. It includes a Core Theory library for music theory computations and an interactive shell for executing commands such as finding chords by notes, identifying common chords between scales, and generating genre-based or custom chord progressions.
What's inside Coltrane
- Coltrane includes a Core Theory library for music theory computations. Detailed documentation on how to interface with and use this library can be found in the project's Wiki.
Install Coltrane via RubyGems
masterInstall the Coltrane CLI using the RubyGems package manager. This requires Ruby to be installed on your system.
gem install coltraneRun the Coltrane CLI
masterColtrane is a Ruby-based command-line application. You can start the application by executing thecoltranebinary. The application automatically detects terminal color support via theCOLORTERMenvironment variable to enable true color mode. If your terminal does not support true color, it will default to standard mode and display a warning.Troubleshoot Coltrane theory errors
masterWhen working with the
Coltrane::Theorymodule, you may encounter several specific error classes. Most errors inherit fromColtrane::Theory::TheoryError. Understanding these can help you debug invalid musical inputs or incorrect API usage.Common Error Categories
Input and Argument Errors
Coltrane::Theory::BadConstructorError: A base error for initialization issues.Coltrane::Theory::WrongKeywordsError: Occurs when an invalid keyword is passed. It suggests the correct set of keywords in the message.Coltrane::Theory::WrongArgumentsError: Occurs when arguments do not match the expected signature.
Coltrane::Theory::InvalidNoteError: Raised when a single note is invalid.Coltrane::Theory::InvalidNotesError: Raised when a collection of notes is invalid.Coltrane::Theory::InvalidNoteSymbolError: Raised when musical notation contains an unrecognizable symbol.Coltrane::Theory::InvalidNoteLetterError: Raised when musical notation contains an unrecognizable letter.Coltrane::Theory::HasNoNotesError: Raised when an object used in an operation does not respond to the:notesmethod.
Musical Theory Errors
Coltrane::Theory::WrongDegreeError: Raised when a scale degree is outside the valid range for a specific scale.Coltrane::Theory::ChordNotFoundError: Raised when a requested chord is not in the library. Tip: Ensure you include the letterMfor major chords (e.g.,CMinstead of justC).Coltrane::Theory::IntervalNotFoundError: Raised when a requested interval is not recognized.Coltrane::Theory::InvalidPitchClassError: Raised when a frequency is not considered part of a pitch class.
Discover a chord name from notes
masterUse the
find chord by notescommand to identify a chord based on a provided list of notes. Notes should be separated by dashes.coltrane find chord by notes notes:C-E-GFind possible progressions from a chord sequence
masterAnalyze a sequence of chords to find the most likely scales and progression notations they belong to. The results are sorted by the number of notes that fall outside the scale (0 notes out being the best match).
coltrane find progressions from chords chords:Am-F-C-GDiscover scales by providing chords or notes
masterFind scales that contain a specific set of chords or notes.
- To provide chords: use
--chordswith dash-separated values (e.g.,chords:E6/9-BM). - To provide notes: use
--noteswith dash-separated values (e.g.,notes:C-Ab-F-G).
coltrane find scale by chords chords:E6/9-BM- To provide chords: use
Generate chord progressions
masterGenerate chord progressions for specific genres or custom patterns.
Genre-based progressions: Specify a genre like
Jazz,Pop, orBlues. You can also specify arootand arepresentation(e.g.,Piano).coltrane show progression progression:Jazz representation:Piano root:ACustom progressions: Use
progression_notationwith Roman numerals to define a custom sequence.coltrane custom progression progression_notation:I-vi-V-iidim representation:Text key:Dcoltrane show progression progression:Jazz representation:Piano root:A coltrane custom progression progression_notation:I-vi-V-iidim representation:Text key:DGenerate scale fretboard sheets
masterVisualize a scale on a fretboard for improvisation purposes. Use the
show scalecommand.coltrane show scale scale:Pentatonic-Major tone:FTip: You can force guitar fretboard visualization for chords by using the
--on guitar_fretsoption with theshow chordcommand.Show chord details and instrument representations
masterUse the
show chordcommand to see the notes of a chord and its visual representation on a specific instrument.Available
chord_representationoptions include:Guitar,Bass,Piano, orUkelele.coltrane show chord chord:CM7 chord_representation:GuitarFind common chords between scales
masterUse the
find common chords in scalescommand to identify chords shared between two scales. This is useful for finding bridge chords for modulation.coltrane find common chords in scalesUse Coltrane Interactive Mode
masterEnter an interactive shell where you can run commands without prefixing them with
coltrane.coltrane # or coltrane shellOnce in the shell, you can run commands directly, such as:
scale D harmonic minor