scales.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * SETHARES: The spectrum of an individual tone determines what notes (forming a scale)
  3. * will sound in-tune or consonant, and which not. e.g. in tempered or just intonation,
  4. * the octave sounds in tune because of the harmonic structure of the spectra of tones,
  5. * but we can construct spectra such that a minor-9th sounds less harsh than an octave.
  6. *
  7. * Naive solution
  8. *
  9. * (1) m scale-tones -> (m-1) interval ratios r[1],r[2],r[3] .....r[m-1]
  10. * (2) Choose a set of n partials f[1],f[2]....f[n], and amplitudes a[1],a[2]...a[n]
  11. * to minimise the sum of the dissonance over all the (m-1) intervals.
  12. *
  13. * Constraints required
  14. *
  15. * (1) a[k] all set to zero always give minimal dissonance
  16. * (2) r[k] all very large also minimises dissonance
  17. *
  18. * so we want to avoid these special cases.
  19. *
  20. *
  21. * INTRINSIC OR INHERENT DISSONANCE
  22. *
  23. * Dissonance of a spectrum (the intrinsic or inherent dissonance - within one tone)
  24. *
  25. * Df = 1/2 Z(j=1 to n)Z(k=1 to n)d(f[j],f[k],l[a],l[k])
  26. *
  27. * where d(f[j],f[k],l[a],l[k]) = dissonance between partials f[j],f[k] with loudnesses l[j],l[k].
  28. *
  29. * and "Z" = Sigma (i.e. sum over all values from j = 1 to j = n)
  30. *
  31. * (see accompanying text document)
  32. *
  33. * Dissonance is defined in terms of SENSORY DISSONANCE.
  34. *
  35. * If we play two sine tones of the same frequency together we hear 1 tone.
  36. * If we then gradually increase the frequency of the 2nd tone ..
  37. * (1) When tones are very close, we hear one pitch, with slow beating, relatively pleasant
  38. * (resolution of the ear cannot distinguish the two tones)
  39. * (2) The beating then becomes rapid and "rough" or "gritty", the peak of sensory dissonance.
  40. * (3) The two tones then gradually become distinguishable and dissonance fades away,
  41. * until we hear 2 clear tones.
  42. *
  43. * The shape of the dissonance curve varies with the frequency chosen for the FIXED tone.
  44. * (see accompanying text document)
  45. *
  46. *
  47. *
  48. *
  49. *
  50. *
  51. *
  52. *
  53. *
  54. *
  55. *
  56. *
  57. *
  58. *
  59. *
  60. *
  61. *
  62. */