tonaljs / tonal

A functional music theory library for Javascript
https://tonaljs.github.io/tonal/docs
3.77k stars 216 forks source link

Edge case with Interval, possibly note octave designation #428

Closed aure closed 1 month ago

aure commented 4 months ago

Hello, I am one of the authors of a similar package for Swift, Tonic: https://github.com/AudioKit/Tonic

I recently had some issues in my library around the interval between notes in adjacent octaves, and I wanted to test if your library had that solved in a similar way. In my testing, I noticed this problem which must be a bug:

  Tonal.Interval.distance("B#4", "C4");
  Tonal.Interval.distance("B#4", "C5"));

both return "-7A". If you're curious about how we handle octave number, you can check out my reasoning in this issue response: https://github.com/AudioKit/Tonic/issues/26

I'm not a javascript developer or else I would have dug into the code and offered a pull request instead of an issue. I hope this is helpful.

danigb commented 4 months ago

Interesting... I'll investigate the issue. Thanks a lot for reporting! 🙏