subsequence.chord_graphs ======================== .. py:module:: subsequence.chord_graphs .. autoapi-nested-parse:: Chord graph builders for different harmonic transition models. Package Contents ---------------- .. py:class:: ChordGraph Bases: :py:obj:`abc.ABC` Abstract base for chord transition graphs. .. py:method:: build(key_name: str) -> Tuple[subsequence.weighted_graph.WeightedGraph[subsequence.chords.Chord], subsequence.chords.Chord] :abstractmethod: Build the weighted graph and return it with the tonic chord. .. py:method:: gravity_sets(key_name: str) -> Tuple[Set[subsequence.chords.Chord], Set[subsequence.chords.Chord]] :abstractmethod: Return (diatonic_set, functional_set) for key gravity weighting. .. py:function:: build_diatonic_chords(scale_pcs: List[int], degree_qualities: List[str]) -> List[subsequence.chords.Chord] Build chords for each scale degree. :param scale_pcs: Pitch class for each degree (e.g., from ``scale_pitch_classes(key_pc, mode)``) :param degree_qualities: Chord quality for each degree (e.g., ``["major", "minor", ...]``) :returns: List of Chord objects, one per scale degree .. py:function:: validate_key_name(key_name: str) -> int Validate a key name and return its pitch class. Raises ValueError if the key name is not recognised. :param key_name: Note name (e.g., ``"C"``, ``"F#"``, ``"Bb"``) :returns: Pitch class integer (0-11)