Skip to content

Instantly share code, notes, and snippets.

@mazbox
Created February 6, 2013 18:00
Show Gist options
  • Save mazbox/4724484 to your computer and use it in GitHub Desktop.
Save mazbox/4724484 to your computer and use it in GitHub Desktop.
Convert a midi note to speed (1 is original speed, 0.5 would be an octave lower, 2, an octave higher etc.)
float midiNoteToSpeed(int midiNote, int originalNote) {
return pow(2, (midiNote-originalNote)/12.f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment