Coltrane Documentation

repository·master·Indexed 25 days ago

https://github.com/pedrozath/coltrane

A 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.

Tokens
6.6K
Snippets
9
Records
56
Agent score
79%

What's inside Coltrane

  1. Run the Coltrane CLI

    master
    Coltrane is a Ruby-based command-line application. You can start the application by executing the coltrane binary. The application automatically detects terminal color support via the COLORTERM environment variable to enable true color mode. If your terminal does not support true color, it will default to standard mode and display a warning.
  2. Troubleshoot Coltrane theory errors

    master

    When working with the Coltrane::Theory module, you may encounter several specific error classes. Most errors inherit from Coltrane::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 :notes method.

    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 letter M for major chords (e.g., CM instead of just C).
    • 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.
  3. Find possible progressions from a chord sequence

    master

    Analyze 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-G
  4. Discover scales by providing chords or notes

    master

    Find scales that contain a specific set of chords or notes.

    • To provide chords: use --chords with dash-separated values (e.g., chords:E6/9-BM).
    • To provide notes: use --notes with dash-separated values (e.g., notes:C-Ab-F-G).
    coltrane find scale by chords chords:E6/9-BM
  5. Generate chord progressions

    master

    Generate chord progressions for specific genres or custom patterns.

    Genre-based progressions: Specify a genre like Jazz, Pop, or Blues. You can also specify a root and a representation (e.g., Piano).

    coltrane show progression progression:Jazz representation:Piano root:A

    Custom progressions: Use progression_notation with Roman numerals to define a custom sequence.

    coltrane custom progression progression_notation:I-vi-V-iidim representation:Text key:D
    coltrane show progression progression:Jazz representation:Piano root:A
    
    coltrane custom progression progression_notation:I-vi-V-iidim representation:Text key:D
  6. Generate scale fretboard sheets

    master

    Visualize a scale on a fretboard for improvisation purposes. Use the show scale command.

    coltrane show scale scale:Pentatonic-Major tone:F

    Tip: You can force guitar fretboard visualization for chords by using the --on guitar_frets option with the show chord command.

  7. Show chord details and instrument representations

    master

    Use the show chord command to see the notes of a chord and its visual representation on a specific instrument.

    Available chord_representation options include: Guitar, Bass, Piano, or Ukelele.

    coltrane show chord chord:CM7 chord_representation:Guitar
  8. Use Coltrane Interactive Mode

    master

    Enter an interactive shell where you can run commands without prefixing them with coltrane .

    coltrane
    # or
    coltrane shell

    Once in the shell, you can run commands directly, such as: scale D harmonic minor