# music21.analysis.neoRiemannian¶

This module defines the L, P, and R objects and their related transformations as called on a chord.Chord.

music21.analysis.neoRiemannian.L(c, raiseException=False)

L is a function that takes a major or minor triad and returns a chord that is the L transformation. L transforms a chord to its Leading-Tone exchange.

Example 1: A C major chord, under P, will return an E minor chord

```>>> from music21 import *
>>> c1 = chord.Chord("C4 E4 G4")
>>> c2 = analysis.neoRiemannian.L(c1)
>>> c2.pitches
[<music21.pitch.Pitch B3>, <music21.pitch.Pitch E4>, <music21.pitch.Pitch G4>]
⁠
>>> try:
...     c3 = chord.Chord("C4 D4 E4")
...     c4 = analysis.neoRiemannian.L(c3, raiseException=True)
... except analysis.neoRiemannian.LRPException:
...     pass
```
music21.analysis.neoRiemannian.LRP_combinations(c, transformationString, raiseException=False, leftOrdered=False, simplifyEnharmonic=False)

LRP_combinations is a function that takes a major or minor triad and a transformationString and returns a transformed triad, using the L, R, and P transformations. Certain combinations, such as LPLPLP, are cyclical, and therefore will return the original chord if simplifyEnharmonic = True.

leftOrdered allows a user to work with the function notation that they prefer. leftOrdered = False, the default, will mean that a transformationString that reads “LPRLPR” will start by transforming the chord by L, then P, then R, etc. Conversely, if leftOrdered = True (set by user), then “LPRLPR” will start by transforming the chord by R, then P, then L–by reading the transformations left to right.

simplifyEnharmonic allows a user to determine if they want the transformation to return the actual results of such combined transformations, which may include multiple sharps and flats. if simplifyEnharmonic= True, the resulting chord will be simplified to notes with at most 1 flat or 1 sharp, in their most common form.

```>>> from music21 import *
>>> c1 = chord.Chord("C4 E4 G4")
>>> c2 = analysis.neoRiemannian.LRP_combinations(c1, 'LP')
>>> c2
<music21.chord.Chord B3 E4 G#4>
⁠
>>> c3 = chord.Chord("C4 E4 G4 C5 E5")
>>> c4 = analysis.neoRiemannian.LRP_combinations(c3, 'RLP')
>>> c4
<music21.chord.Chord C4 F4 A-4 C5 F5>
```
music21.analysis.neoRiemannian.LRP_transform(c, transposeInterval, changingPitch)
music21.analysis.neoRiemannian.P(c, raiseException=False)

P is a function that takes a major or minor triad and returns a chord that is the P transformation. P transforms a chord to its parallel, i.e. to the chord of the same diatonic name but opposite model.

Example 1: A C major chord, under P, will return an C minor chord

```>>> from music21 import *
>>> c2 = chord.Chord("C4 E4 G4")
>>> c3 = analysis.neoRiemannian.P(c2)
>>> c3.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch E-4>, <music21.pitch.Pitch G4>]
⁠
>>> try:
...     c3 = chord.Chord("C4 D4 E4")
...     c4 = analysis.neoRiemannian.P(c3, raiseException=True)
... except analysis.neoRiemannian.LRPException:
...     pass
```
music21.analysis.neoRiemannian.R(c, raiseException=False)

R is a function that takes a major or minor triad and returns a chord that is the R transformation. R transforms a chord to its relative, i.e. if major, to its relative minor and if minor, to its relative major.

Example 1: A C major chord, under R, will return an A minor chord

```>>> from music21 import *
>>> c1 = chord.Chord("C4 E4 G4")
>>> c2 = analysis.neoRiemannian.R(c1)
>>> c2.pitches
[<music21.pitch.Pitch C4>, <music21.pitch.Pitch E4>, <music21.pitch.Pitch A4>]
⁠
>>> try:
...     c3 = chord.Chord("C4 D4 E4")
...     c4 = analysis.neoRiemannian.R(c3, raiseException=True)
... except analysis.neoRiemannian.LRPException:
...     pass
```
music21.analysis.neoRiemannian.completeHexatonic(c)
```>>> from music21 import *
>>> c1 = chord.Chord("C4 E4 G4")
>>> analysis.neoRiemannian.completeHexatonic(c1)
[<music21.chord.Chord C4 E-4 G4>,
<music21.chord.Chord C4 E-4 A-4>,
<music21.chord.Chord C-4 E-4 A-4>,
<music21.chord.Chord C-4 F-4 A-4>,
<music21.chord.Chord C-4 F-4 A--4>]
```