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. Musical Maths • Twelve-tone scales

  4. Musical Maths • Circle of Fifths – Pythagoras!

  5. 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)
  6. 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
  7. Geometry of Intervals • Pictures of the cycles • 1

    Semitone at a time
  8. Geometry of Intervals • Pictures of the cycles • 2

    semitones at a time
  9. Geometry of Intervals • Pictures of the cycles • The

    other ones
  10. 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)
  11. A Tuneful Torus

  12. Color Spaces • RGB • Cubic

  13. Color Spaces • HSV • Cylindrical

  14. Color Spaces • Lab... • Weird

  15. Cyclical Space Mappings • Circle of Fifths → HSV Hue

    Dimension
  16. Fiddling around • Using Lab space and Delta-E on same

    SV
  17. Better Differentiation

  18. Sheet Music

  19. Instruments of Colour