d9 $midicmd "start" # s "midi"   let melody = slow 6$ "0 2 [4 8 .] [3 4 3] 8 4 9"   d4 -- $rev \n$ note ((scaleP scalePattern -- $off 4 ((+ 2 ).slow 2) \n --$ off 1 (inversion.slow 2) \n $(rotR 1.5 )$(+ slow 8 "x" <~> generateMelodicSeed) -- $inversion \n$ generateMelodicSeed ))#s "[pe-gtr:12,midi]" #gain 1.2 #orbit 3 #midichan 4   generateMelodicSeed = slow 4 $linger 0.5$ repeatCycles 3 -- $palindrome \n$ (+ (slow (irand (4)+1) (sometimes (inversion) (run (irand (4)+1))))) $slow ((irand 3) + 1)$ e ("x"<~>(irand 8)) 8 \$ "x*16"<~>(irand 5) 

# Primary Chords

In 20th Century Harmony by Vincent Persichetti, in the section on modal writing, Persichetti proposes the idea of thinking about modal harmony in terms of Primary chords, secondary chords, and avoid chords.

### Primary Chords

The primary chords for the mode will include one of the mode’s [[ characteristic scale degrees]]. For example, [[Dorian ]] is distinguished by its minor 3rd, and raised 6th degree. Alternating these chords creates a sense of cadence that falls back on the home chord of the mode. For Dorian, these chords are the i, ii, and IV chords. Tensions can be freely added to these chords as long as they do not create a dissonance that pulls toward the major key.

### Secondary chords

The secondary chords are the chords that do not contain the characteristic notes for the mode but also do not contain the diminished 5th (tritone) interval that belongs to the major key. They can be used to lead away from the home chord before cadencing again with one of the primary chords. For Dorian, these chords are the III, V, and VII chords. Tensions can be freely added to these chords as long as they do not create a dissonance that pulls toward the major key.

### Avoid chords

Some chords contain the dissonant diminished 5th (tritone) interval that pull towards the major key. Using these chords risks re-centering to the major key and ending the sense of modality. For Dorian, the vi° should be avoided if you want to maintain the sense of Dorian-ness.

## Primary Chords for the diatonic modes

The following is a list of all the primary and secondary chords for each mode with a list of the tensions that can be added without distorting the modal flavor. Locrian is omitted as it contains tritones in its primary chords plays by its own rules.

### Ionian (major)

#### Primary

I with tensions: maj7, 6, 9, 11 IV with tensions: maj7, 6, 9, #11 V with tensions: 7, 6, 9, 11

#### Secondary

ii with 7, 6, 9, 11 iiiwith 7, 6, 9, 11 vi with 7, 6, 9, 11 vii° with 7, 6, 9, 11

### Dorian

#### Primary

i with 7, 9, 11 ii with 7, 6, 11 IV with 6, 9, 11

#### Secondary

III with maj7, 6, 9 v with 7, 6, 9, 11 but not 6 and 9 VII with maj7, 6, 9, 11 but not 11 and maj7

### Phrygian

#### Primary

i with 7, 6, 11 II with 7, 6, 9 vii with 7, 9, 11

#### Secondary

III with 6, 9, 11 vi with 7, 6, 9, 11 but not 6 and 9 VI with maj7, 6, 9, 11

### Lydian

#### Primary

I with 7, 6, 9 II with 6, 9, 11 vii with 7, 6, 11

#### Secondary

iii with 7, 6, 9, 11 but not 6 and 9 V with maj7, 6, 9, 11 vi with 6, 9, 11

### Mixolydian

#### Primary

I with 6, 9, 11 v with 7, 9, 11 VII with 7, 6, 9

#### Secondary

ii with 7, 6, 9, 11 but not 6 and 9 IV with maj7, 6, 9, 11 vi with 6, 9, 11