Snippets Collections
from music21 import chord, interval

# Create a Chord object for C major
c_major_chord = chord.Chord("C4 E4 G4")

# Get the root note of the chord
root_note = c_major_chord.root()

# Get the chord tensions
tensions = []
for degree in [2, 4, 6]:
    tension_pitch = root_note.transpose(interval.GenericInterval(degree))
    tensions.append(tension_pitch.name)
print("Chord Tensions:", tensions)
star

Mon Jul 03 2023 05:15:09 GMT+0000 (Coordinated Universal Time)

##music21 #jazz #piano #python

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension