Module: Musa::Chords

Included in:
All
Defined in:
lib/musa-dsl/music/chord-definition.rb,
lib/musa-dsl/music/chords.rb

Overview

Chord construction and manipulation framework.

The Chords module provides a comprehensive system for defining, creating, and manipulating musical chords. It supports standard chord types (triads, sevenths, ninths, etc.) with various qualities (major, minor, diminished, augmented, dominant).

Architecture

  • ChordDefinition: Template defining chord structure (intervals and features)
  • Chord: Actual chord instance with specific root and scale context

Basic Usage

# Create chord from scale note
scale = Scales::Scales.default_system.default_tuning.major[60]
chord = scale.tonic.chord         # C major triad
chord = scale.tonic.chord :triad  # Explicitly specify size

Features

Chords are defined by features:

  • quality: :major, :minor, :diminished, :augmented, :dominant
  • size: :triad, :seventh, :ninth, :eleventh, :thirteenth

Registered chord definitions.

Triads

Basic three-note chords:

  • :maj - Major triad (1-3-5): root, major third, perfect fifth
  • :min - Minor triad (1-♭3-5): root, minor third, perfect fifth
  • :dim - Diminished triad (1-♭3-♭5): root, minor third, diminished fifth
  • :aug - Augmented triad (1-3-♯5): root, major third, augmented fifth

Seventh Chords

Four-note chords with added seventh:

  • :maj7 - Major seventh (1-3-5-7): major triad + major seventh
  • :min7 - Minor seventh (1-♭3-5-♭7): minor triad + minor seventh
  • :dom7 - Dominant seventh (1-3-5-♭7): major triad + minor seventh

Extended Chords

Chords with ninths, elevenths, and thirteenths:

  • :maj9, :min9, :dom9 - Ninth chords
  • :maj11, :min11 - Eleventh chords
  • :maj13, :min13 - Thirteenth chords

Defined Under Namespace

Classes: Chord, ChordDefinition