original_docstring: Generates four-part voicings for a fifth or seventh chord.
  
      The bass note is kept intact, though other notes (and doublings) are
      allowed to vary between different voicings. Intervals between adjacent
      non-bass parts are limited to a single octave.
      
docstring: Generates four-part voicings for a fifth or seventh chord.
  The bass note is kept intact, though other notes (and doublings) are
  allowed to vary between different voicings. Intervals between adjacent
  non-bass parts are limited to a single octave.
docstring_tokens: Generates four - part voicings for a fifth or seventh chord . The bass note is kept intact though other notes ( and doublings ) are allowed to vary between different voicings . Intervals between adjacent non - bass parts are limited to a single octave .
code: def voiceChord(key, chord):
      """Generates four-part voicings for a fifth or seventh chord.
  
      The bass note is kept intact, though other notes (and doublings) are
      allowed to vary between different voicings. Intervals between adjacent
      non-bass parts are limited to a single octave.
      """
      leadingTone = key.getLeadingTone().name
      noteNames = [pitch.name for pitch in chord.pitches]
      if chord.containsSeventh():
          yield from _voiceChord(noteNames)
      elif chord.inversion() == 2:
          # must double the fifth
          yield from _voiceChord(noteNames + [chord.fifth.name])
      else:
          # double the root
          if chord.root().name != leadingTone:
              yield from _voiceChord(noteNames + [chord.root().name])
          # double the third
          if chord.third.name != leadingTone:
              yield from _voiceChord(noteNames + [chord.third.name])
          # double the fifth
          if chord.fifth.name != leadingTone:
              yield from _voiceChord(noteNames + [chord.fifth.name])
          # option to omit the fifth
          if chord.romanNumeral == "I" and chord.inversion() == 0:
              yield from _voiceChord([chord.root().name] * 3 + [chord.third.name])
code_tokens: def voiceChord ( key , chord ) : leadingTone = key . getLeadingTone ( ) . name noteNames = [ pitch . name for pitch in chord . pitches ] if chord . containsSeventh ( ) : yield from _voiceChord ( noteNames ) elif chord . inversion ( ) == 2 : yield from _voiceChord ( noteNames + [ chord . fifth . name ] ) else : if chord . root ( ) . name != leadingTone : yield from _voiceChord ( noteNames + [ chord . root ( ) . name ] ) if chord . third . name != leadingTone : yield from _voiceChord ( noteNames + [ chord . third . name ] ) if chord . fifth . name != leadingTone : yield from _voiceChord ( noteNames + [ chord . fifth . name ] ) if chord . romanNumeral == "I" and chord . inversion ( ) == 0 : yield from _voiceChord ( [ chord . root ( ) . name ] * 3 + [ chord . third . name ] )
short_docstring: Generates four-part voicings for a fifth or seventh chord.
short_docstring_tokens: Generates four - part voicings for a fifth or seventh chord .
comment: """Generates four-part voicings for a fifth or seventh chord.
  
      The bass note is kept intact, though other notes (and doublings) are
      allowed to vary between different voicings. Intervals between adjacent
      non-bass parts are limited to a single octave.
      """$SEP$# must double the fifth$SEP$# double the root$SEP$# double the third$SEP$# double the fifth$SEP$# option to omit the fifth