← Back

JazzArchitect: A Jazz Harmony Generation System Based on Recursive Probabilistic Grammar

MADZINE · January 2, 2026
Abstract

This paper presents JazzArchitect, a jazz chord progression generation system based on the recursive Probabilistic Context-Free Grammar (PCFG) framework proposed by Rohrmeier (2020). Implemented in C++ with the JUCE audio framework, the system provides real-time audio synthesis and MIDI output capabilities. Through a 15-parameter style vector, the system can generate chord progressions in 9 different jazz styles, including Bebop, Cool Jazz, and Modal Jazz. The system implements three major substitution rules (tritone substitution, backdoor dominant, and Coltrane changes) along with Smither (2019) guide-tone voice leading optimization. This paper details the system architecture, algorithm design, and implementation specifics.

Keywords: Jazz harmony, Probabilistic context-free grammar, Chord progression generation, Voice leading, Music information retrieval

1. Introduction

1.1 Motivation

Jazz harmony is renowned for its complex chord progressions and rich substitution rules. Traditional jazz improvisers master these rules through years of study, but for computer music generation systems, simulating this musical knowledge remains a significant challenge.

Existing music generation methods fall into two main categories:

  1. Data-driven methods: Using deep learning (such as LSTM, Transformer) to learn harmonic patterns from corpora
  2. Rule-based methods: Generating based on music theory rules

While data-driven methods can produce fluent results, they lack interpretability and controllability. Rule-based methods offer precise control over the generation process, but traditional implementations tend to be overly rigid.

1.2 Research Objectives

This research aims to combine the advantages of both approaches:

  1. Adopt the recursive grammar framework proposed by Rohrmeier (2020) for theoretical foundation
  2. Use probabilistic weights to control rule selection, increasing generation diversity
  3. Implement a style parameter system allowing cross-era jazz style generation
  4. Provide complete audio synthesis and MIDI output functionality

1.3 Contributions

The main contributions of this research are:

2. Related Work

2.1 Formal Grammar for Jazz Harmony

Steedman (1984) first proposed analyzing jazz chord sequences using formal grammar, treating jazz harmony as a linguistic structure. This study defined basic generation rules but did not address probabilistic weighting.

Rohrmeier (2020) extended this framework, proposing a recursive grammar containing the following core concepts:

2.2 Probabilistic Context-Free Grammar

Harasim et al. (2018, 2020) applied PCFG to the Jazz Harmony Treebank (JHT), extracting rule weights from 150 jazz standards. This method combines the structural nature of formal grammar with the flexibility of statistical methods.

2.3 Voice Leading Theory

Smither (2019) proposed guide-tone voice leading theory for jazz harmony. Core concepts include:

2.4 Substitution Rules

Common substitution rules in jazz harmony include:

Substitution Type Original Chord Substitute Chord Theoretical Basis
Tritone substitutionV7bII7Shared tritone interval
Backdoor dominantV7bVII7Minor key borrowing
Coltrane changesIMajor third cycleColtrane style

3. System Architecture

3.1 Overall Architecture

JazzArchitect employs a layered architecture design:

User Interface Layer
├── JUCE GUI
└── Parameter Controls

Generation Layer
├── PCFG Engine
│   ├── Generator
│   └── Rule Library
└── Style Engine
    ├── Substitution Processing
    ├── Voice Leading Optimization
    └── Style Parameters

Core Layer
├── Chord Symbol
├── Pitch Class
└── Interval Calculation

Output Layer
├── Chord Synthesizer (8-voice polyphony)
└── MIDI Exporter

3.2 Module Description

Core Module

Grammar Module

Style Module

Substitution Module

Voice Leading Module

Synthesis Module

MIDI Module

4. Grammar Engine

4.1 Non-Terminal Symbols

The system defines the following non-terminal symbols:

SymbolNameFunction
SStartStart symbol (entire piece)
TTonicTonic region
DDominantDominant region
SDSubdominantSubdominant region
PREPPreparationPreparation region
PROLProlongationProlongation region

4.2 Core Production Rules

Prolongation Rules

Prolongation rules repeat or elaborate functionally equivalent chords:

Preparation Rules

Preparation rules insert dominant function chords:

Substitution Rules

Substitution rules are unary productions:

4.3 Rule Probabilities

Rule probabilities are controlled by the StyleVector. For the ii-V pattern:

4.4 Derivation Algorithm

The system employs top-down recursive derivation:

  1. Initialize derivation tree with start symbol S
  2. While tree contains non-terminals:
    • Select leftmost non-terminal N
    • Get applicable rules for N
    • Weight rules according to style parameters
    • Sample rule r according to probabilities
    • Apply r, replacing N with RHS symbols
  3. Map terminals to chord symbols in the key
  4. Return chord progression

5. Style System

5.1 StyleVector Parameters

StyleVector contains 15 parameters controlling generation behavior:

ParameterRangeDescription
tritoneSubProb0.0-1.0Tritone substitution probability
iiVPreference0.0-1.0ii-V progression preference
modalInterchange0.0-1.0Modal interchange frequency
chromaticApproach0.0-1.0Chromatic approach frequency
dominantChainDepth1-5Maximum dominant chain depth
rhythmDensity0.0-1.0Chord change density
extensionLevel0.0-1.0Extension usage level
backdoorProb0.0-1.0Backdoor dominant probability
coltraneProb0.0-1.0Coltrane changes probability
minorBorrowing0.0-1.0Minor key borrowing frequency
diminishedUsage0.0-1.0Diminished chord usage frequency
deceptiveResolution0.0-1.0Deceptive cadence probability
plagalCadence0.0-1.0Plagal cadence probability
suspensionUsage0.0-1.0Suspension usage frequency
pedalPointProb0.0-1.0Pedal point probability

5.2 Style Presets

The system provides 9 style presets:

StyleTritoneii-VModalExtensionCharacteristics
Bebop0.300.900.200.70Fast ii-V, rich extensions
Cool0.200.700.300.50Slower tempo, spacious
Modal0.100.300.700.30Few functional progressions, modal color
Hard Bop0.350.850.250.60Blues influence, strong rhythm
Post-Bop0.400.600.600.80Modern harmony, complex structure
Swing0.150.800.100.40Traditional progressions, concise
Fusion0.300.500.500.90Rich extensions, modal mixture
Contemporary0.350.400.700.85Modern techniques, free structure
Blues0.200.600.400.50Blues progressions, parallel chords

5.3 Style Engine

StyleEngine integrates the generation workflow:

  1. Generate base progression using PCFG
  2. Apply substitution engine to process substitution rules
  3. Optimize using voice leading optimizer
  4. Return final progression

6. Substitution Rules

6.1 Tritone Substitution

Tritone substitution is based on V7 and bII7 sharing the same tritone interval:

Both share B/Cb and F, making them interchangeable.

In implementation, the system replaces V7 with bII7 according to tritoneSubProb. The new root is calculated as the original root plus 6 semitones (tritone interval).

6.2 Backdoor Dominant

Backdoor dominant comes from minor key borrowing, replacing V7 with bVII7:

Implementation is controlled by backdoorProb. The new root is the original root plus 3 semitones (ascending minor third).

6.3 Coltrane Changes

Coltrane changes originate from John Coltrane's "Giant Steps," replacing simple progressions with major third cycles:

Implementation expands a single I chord into a sequence of 5 chords.

7. Voice Leading Optimization

7.1 Guide-Tone Analysis

According to Smither (2019), guide tones are the third and seventh of each chord:

Chord TypeThirdSeventh
Cmaj7E (4)B (11)
Dm7F (5)C (0)
G7B (11)F (5)

7.2 Voice Leading Cost

Voice leading cost between two chords is defined as the minimum movement of guide tones:

Cost = |third1 - third2| + |seventh1 - seventh2|

Intervals are calculated as minimum values (considering octave equivalence).

7.3 Optimization Algorithm

VoiceLeadingOptimizer checks each pair of adjacent chords, attempting substitution if cost is too high:

  1. For each pair of adjacent chords
  2. Calculate voice leading cost
  3. If cost > 2:
    • Try tritone substitution on the first chord
    • Calculate new cost
    • If new cost is lower, apply substitution
  4. Return optimized progression

8. Audio Synthesis

8.1 Synthesizer Architecture

ChordSynth is an 8-voice polyphonic chord synthesizer supporting three timbres:

TimbreSynthesis MethodCharacteristics
Electric PianoFM SynthesisRhodes style, decaying modulation
OrganAdditive SynthesisHammond style, harmonic stacking
PadSubtractive SynthesisSawtooth wave + low-pass filter

8.2 Envelope Settings

Each SynthVoice contains an independent ADSR envelope:

TimbreAttackDecaySustainRelease
Electric Piano5ms300ms0.3400ms
Organ10ms50ms0.9100ms
Pad200ms500ms0.7800ms

8.3 Chord Voicing

ChordSymbol.getMIDINotes() generates MIDI notes:

  1. Calculate root MIDI value = baseOctave * 12 + root
  2. Add root note
  3. For each interval in chord quality, add corresponding note
  4. For each extension, add corresponding note
  5. Return note list

9. Implementation Details

9.1 Development Environment

9.2 File Structure

cpp/
├── Source/
│   ├── Core/           # Core classes
│   ├── Grammar/        # Grammar engine
│   ├── Style/          # Style system
│   ├── Substitution/   # Substitution rules
│   ├── VoiceLeading/   # Voice leading
│   ├── Synthesis/      # Audio synthesis
│   ├── MIDI/           # MIDI output
│   ├── Main.cpp
│   ├── MainComponent.h
│   └── MainComponent.cpp
├── JUCE/               # JUCE submodule
├── CMakeLists.txt
└── build/

9.3 Build Instructions

cd cpp
mkdir build && cd build
cmake ..
cmake --build . --config Release

9.4 Application Specifications

10. User Interface

10.1 Interface Layout

┌─────────────────────────────────────────────────────────────┐
│ Jazz Architect                                              │
├─────────────────────────────────────────────────────────────┤
│ Style: [Bebop   v]  Key: [C      v]  Sound: [E.Piano  v]   │
│ BPM: [===120===]    Length: [===8===]                      │
│                                                             │
│ [Generate]  [Play]  [Stop]  [Export MIDI]                  │
├─────────────────────────────────────────────────────────────┤
│                    CHORD PROGRESSION                        │
│  ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐     │
│  │Dm7   │ │G7    │ │Cmaj7 │ │A7    │ │Dm7   │ │G7    │     │
│  └──────┘ └──────┘ └──────┘ └──────┘ └──────┘ └──────┘     │
├─────────────────────────────────────────────────────────────┤
│ Tritone [═══○═══]  ii-V [═══════○]  Modal [═○═══════]      │
│ Ext     [═════○═]                                          │
└─────────────────────────────────────────────────────────────┘

10.2 Operation Flow

  1. Select style preset (or adjust parameter sliders)
  2. Select key and length
  3. Click Generate to create new progression
  4. Click Play to playback (select timbre)
  5. Click Export MIDI to export file

11. Conclusion and Future Work

11.1 Summary of Results

This research successfully implemented the JazzArchitect system, achieving the following objectives:

  1. Theoretical Integration: Complete implementation of Rohrmeier (2020) PCFG framework
  2. Style Control: 15-parameter style vector and 9 presets
  3. Substitution Rules: Tritone, backdoor, and Coltrane substitutions
  4. Voice Optimization: Smither (2019) guide-tone voice leading
  5. Practical Tool: GUI, audio synthesis, MIDI output

11.2 Future Work

  1. Corpus Training: Extract rule probabilities from Jazz Harmony Treebank
  2. Evaluation Integration: Add MusDr evaluation metrics
  3. Listening Experiments: Conduct A/B comparison tests
  4. Score Display: Add staff notation visualization
  5. Real-time MIDI: Connect to external synthesizers
  6. Cross-platform: Windows/Linux versions

References

  1. Rohrmeier, M. (2020). Towards a Syntax of Jazz Harmony. Music Theory and Analysis, 7(1), 1-62.
  2. Steedman, M. J. (1984). A generative grammar for jazz chord sequences. Music Perception, 2(1), 52-77.
  3. Smither, S. (2019). Guide-tone voice leading in jazz. Music Theory Online, 25(2).
  4. Harasim, D., Finkensiep, C., Ericson, P., O'Donnell, T. J., & Rohrmeier, M. (2020). The jazz harmony treebank. Proceedings of ISMIR 2020.
  5. Tymoczko, D. (2006). The geometry of musical chords. Science, 313(5783), 72-74.
  6. Wu, S. L., & Yang, Y. H. (2020). The jazz transformer on the front line: Exploring the shortcomings of AI-composed music through quantitative measures. Proceedings of ISMIR 2020.
  7. Granroth-Wilding, M., & Steedman, M. (2014). A robust parser-interpreter for jazz chord sequences. Journal of New Music Research, 43(4), 355-374.

Appendix A: Chord Quality Interval Table

Chord QualityIntervals (semitones)
MAJ70, 4, 7, 11
MIN70, 3, 7, 10
DOM70, 4, 7, 10
HDIM70, 3, 6, 10
DIM70, 3, 6, 9
AUG0, 4, 8
MAJ60, 4, 7, 9
MIN60, 3, 7, 9

Appendix B: Non-Terminal to Terminal Mapping

Non-TerminalFunctionCommon Terminals
TTonicImaj7, vi7, iii7
DDominantV7, vii-7
SDSubdominantIV, ii7
PREPPreparationii7, IV

JazzArchitect v1.0 - January 2, 2026

© 2025 MADZINE. All rights reserved.