chord-voicings

0.0.1 • Public • Published

chord-voicings

This package contains logic to find chords voicings for a given chord symbol.

Install

npm i chord-voicings --save

Usage

import { dictionaryVoicing, minTopNoteDiff, lefthand } from 'chord-voicings';

const getVoicing = (chord, lastVoicing) =>
  dictionaryVoicing({
    chord,
    dictionary: lefthand,
    range: ['F3', 'A4'],
    picker: minTopNoteDiff,
    lastVoicing,
  });

getVoicing('Dm7'); // ['F3', 'A3', 'C3', 'E3']
getVoicing('Dm7', ['F3', 'A3', 'C3', 'E3']); // ['C4', 'E4', 'F4', 'A4']
  • chord: the chord (= note + chord symbol) we want to voice. The available symbols depend on your dictionary.
  • dictionary: Maps chord symbols to possible interval structures. You can either use one of the available voicing dictionaries, or create your own.
  • range: The range inside which we are allowed to voice.
  • lastVoicing (optional): voicing that came before. If given, the best voice leading will be chosen using picker.
  • picker: Function that picks the best voicing after lastVoicing. Currently, there is only minTopNoteDiff, which picks the voicing with the smallest top note distance (or first if no lastVoicing given).

I made this lib after writing this post. I also started to integrate this idea directly into tonaljs, see this issue. Currently, I just want some lib I can use directly without waiting for the tonal integration to fruit.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    21
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    21

Package Sidebar

Install

npm i chord-voicings

Weekly Downloads

21

Version

0.0.1

License

ISC

Unpacked Size

30.3 kB

Total Files

28

Last publish

Collaborators

  • felixroos