SOUL icon indicating copy to clipboard operation
SOUL copied to clipboard

Generalize `noteNumberToFrequency` to use any periodic tuning

Open ellapollack opened this issue 4 years ago • 4 comments

  • scale is an array containing the frequency interval of each scale degree, beginning with the first degree above the tonic (1. is implied) and ending with the octave.
  • noteNumberToFrequency(rootNote, rootNote, rootFrequency, scale) == rootFrequency

ellapollack avatar May 16 '20 02:05 ellapollack

I support this PR!

:heart:

I would swap the term EDO with TET, as it is the more commonly used term outside of the microtonal community.

👍

I would also add (or replace the above with) a method to pass a complete tuning table to cover all 128 MIDI notes, i.e. float32[128]. This would give ultimate flexibility for e.g. stretched temperaments, giving the host complete control over the tuning of each note. This is also closer to the way MIDI 2.0 will work as I currently understand it.

Is it necessary to add a method for this if all it would do is index that array?

ellapollack avatar May 16 '20 11:05 ellapollack

Ha, I realised this after posting the comment! If a host has the option of triggering a note with a given frequency then yes, I agree, not much point in a method that indexes an array.

adamski avatar May 16 '20 13:05 adamski

Sorry, I only just noticed this PR. It's a bit hard to see what you're actually changing because the diff is pulling in thousands of other changes, so you might want to try cleaning it up against the latest version?

Seems like a simple and sensible FR though - this github repo is just a mirror, so have to way to accept PRs directly, but we can add the function manually to our master repo :)

julianstorer avatar May 25 '20 07:05 julianstorer

Thanks! Should be all clean now ✨

ellapollack avatar May 25 '20 15:05 ellapollack