Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sassy Scope] Inconsistency between frequency and note #688

Open
ValeraTychov opened this issue Jul 16, 2024 · 0 comments
Open

[Sassy Scope] Inconsistency between frequency and note #688

ValeraTychov opened this issue Jul 16, 2024 · 0 comments

Comments

@ValeraTychov
Copy link

ValeraTychov commented Jul 16, 2024

Version

24.05

Plugin type

Native / JACK, AU, CLAP, LV2, VST2, VST3

OS

Windows

DAW / Host (if applicable)

No response

Description

Sassy Scope incorrectly calculates note from frequency.
C#6 instead of A5 (~880 Hz)
Ableton_Live_12_Lite_5SJpLGlcPF
C#5 instead of A4 (~440 Hz)
Ableton_Live_12_Lite_Se0ETsc9eA
E3 instead of C3 (~130.8 Hz)
Ableton_Live_12_Lite_zxG8i4K0jd

https://en.wikipedia.org/wiki/Piano_key_frequencies

The root cause is wrong calculation here

int note = (int)(12 * log(32 * POW_2_3_4TH * (freqbins[(int)(mp.x / uiScale)] / (sizef-1))) / log(2));

Most likely this worked correctly previously with a different value of sizef.

I'd suggest to exclude sizef from the expression because note index only depends to variable frequency and base note frequency.
So the final expression should be something like the following
int note = (int)(12 * log(<Multiplicative_inverse_of_C-1_frequency> * (freqbins[(int)(mp.x / uiScale)])) / log(2));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant