scamp_extensions.pitch.chord_builder.chord_from_pitch_classes

scamp_extensions.pitch.chord_builder.chord_from_pitch_classes(pcs, min_pitch, max_pitch, num_notes, prefer_unique_pcs=True, spacing_and_range_prefs=('compact', 'mid', 'even'))[source]

Find the single voicing of the given pitch classes that best fits the given preferences. See chords_from_pitch_classes(), of which this is the single-result version.

Parameters:
  • pcs – the pitch classes (integers from 0 to 11) to voice

  • min_pitch – lowest MIDI pitch the voicing may use

  • max_pitch – highest MIDI pitch the voicing may use

  • num_notes – how many notes the chord should have; capped at the number of pitches available

  • prefer_unique_pcs – if True, prefer voicings covering as many distinct pitch classes as possible

  • spacing_and_range_prefs – the qualities to prefer, in decreasing order of priority

Returns:

the best voicing, as a tuple of MIDI pitches