interval-density

1.0.2 • Public • Published

interval-density npm version

tonal

Returns the interval density of a collection of notes:

var density = require('interval-density')
density('C3 D5 F#2 G4') // => [ 2, 1, 0, 1, 1, 1 ]

API: interval.density(notes)

Get the intervals analysis of a collection of notes

Returns an array with the format [p, m, n, s, d, t] where:

  • p: the number of perfect fourths or fifths
  • m: the number of major thirds or minor sixths
  • n: the number of major sixths or minor thirds
  • s: the number of major seconds or minor sevenths
  • d: the number of major sevents or minor seconds
  • t: the number of tritones

This is, mostly, an academic puzzle to show the expresiveness of tonal. Implements the ideas found in "The Analysis of Intervals" chapter from Harmonic Materials of Modern Music:

The letters pmn, therefore, represent intervals commonly considered consonant, whereas the letters sdt represent the intervals commonly considered dissonant. (...) A sonority represented, for example, by the symbol sd^2, indicating a triad composed of one major second and two minor seconds, would be recognized as a highly dissonant sound, while the symbol pmn would indicate a consonant sound.

Parameters

  • notes Array or String the notes to analyze

Returns Array the pmnsdt array

License

MIT License

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i interval-density

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • danigb