Skip to content

Instantly share code, notes, and snippets.

View joshstovall's full-sized avatar
😎
coding

Josh Stovall joshstovall

😎
coding
View GitHub Profile
@joshstovall
joshstovall / pythagorean.js
Last active September 10, 2021 07:30
pythagorean.js
function pythagorean(e){
var frequency = e;
var cents;
// multiply/divide frequency until between 440 & 880
for (let step = 0; step < 100; step++) {
if (frequency < tuningHz) { frequency = frequency * 2; }
else if (frequency > tuningHz * 2) { frequency = frequency / 2; }
else { break; }
}