Code, everydays, p5.js

Pythagorean Harmony Explorer

Michael Becker

In preperation for a (physical) musical project, I made a small Pyhagorean harmony generator / explorer in p5.js.

2D work was refreshing, but some of the affordances of p5.sound were less than amazing; I needed to use a third party music lib to quickly equate between midi values, note values and frequencies.

I particularly enjoyed implement a lowest-common-denominator algorithm which had to accommodate for the fact equal temperament pitches are not rational numbers, so it had to be a little loosey-goosey when looking for simple, beautiful ratios. The color change upon finding a “pretty” ratio (i.e simple, i.e where neither numerator nor the denominator are more than one digit long, which is a crass oversimplification but was fine for this experiment) is minimalistic but satisfying.

 

[everyday 6/6/17]

Leave a Reply

Back to top walmart pillows