Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PyConZA 2013: "Harmonies and Hues" by David Fraser

Pycon ZA
October 04, 2013

PyConZA 2013: "Harmonies and Hues" by David Fraser

Mapping music to colours in Python.

Pycon ZA

October 04, 2013
Tweet

More Decks by Pycon ZA

Other Decks in Programming

Transcript

  1. Harmonies and Hues Pythonic explorations of tones colourful and musical

    David Fraser PyConZA 2013 http://frasergo.org/projects/harmonihue/
  2. Introduction • Will there be a finale? • Children learning.

    Stupid coloured notes. • I did use Python to do all this
  3. Harmonic Space a function hd that is a metric on

    the frequency space, which approximates the harmonic difference between two frequencies. The result should be low for frequencies that are close harmonies of each other, and high for frequencies that aren't. Principle Mathematical Formulation Notes are perfectly harmonious with themselves hd(a, a) = 0 Notes exactly an octave apart are equivalent hd(a, 2a) = 0 independent of direction (commutative) hd(a, b) = hd(b, a) constant for any interval - independent under transposition hd(a, b) = hd(ra, rb)
  4. Harmonic Space • Circle of Fifths – Fifth is Closest

    Harmony • hd(a, b) = p(a) - p(b) (mod 12) (where p is the position in the circle of fifths) represents this distance
  5. Relative Discordancy • How relatively discordant are different intervals? •

    In Western Music, roughly like this: 0 = d(0) < d(5) < d(4) < d(3) < d(2) < d(1) < d(6) • Using the circle of fifths generates this: 0 = d(0) < d(5) < d(2) < d(3) < d(4) < d(1) < d(6)