Skip to content

Instantly share code, notes, and snippets.

View smallhadroncollider's full-sized avatar

Mark Wales smallhadroncollider

View GitHub Profile
@smallhadroncollider
smallhadroncollider / note-frequencies--equal-temperament.js
Last active October 11, 2019 13:06
Generates an object mapping notes to frequencies in equal temperament (e.g. "A4" = 440, "C#2" ~= 17.32)
// generic range function
const range = (start, stop) => Array(stop - start + 1).fill().map((_, i) => start + i);
// frequency of A4
const A = 440;
// the octave range - here 0 - 8
const octaveRange = range(0, 8).map(val => [val, val - 4]);
// semitone offset

Keybase proof

I hereby claim:

  • I am smallhadroncollider on github.
  • I am smallhadron (https://keybase.io/smallhadron) on keybase.
  • I have a public key whose fingerprint is 0B9B 854F 2AC8 2A06 70DF 81A4 4FC4 9C94 7B6F 764F

To claim this, I am signing this object: