Skip to content

Instantly share code, notes, and snippets.

View josiah-wolf-oberholtzer's full-sized avatar
㊙️
info goblin

J. Wolf Oberholtzer josiah-wolf-oberholtzer

㊙️
info goblin
View GitHub Profile
from abjad import *
def compute_prime_form(pitch_class_set):
rotations = pitch_class_set_to_rotations(pitch_class_set)
intervals, pitch_class_set = sorted(rotations.items())[0]
inverted_pitch_class_set = [12 - _ for _ in pitch_class_set]
inverted_rotations = pitch_class_set_to_rotations(inverted_pitch_class_set)
inverted_intervals, inverted_pitch_class_set = sorted(
inverted_rotations.items())[0]