Skip to content

Fix D#/Eb frequency in synth key_to_freq - #845

Merged
smathot merged 1 commit into
open-cogsci:nightingalefrom
chenyangsu:fix/synth-dsharp-freq
Dec 1, 2026
Merged

smathot merged 1 commit into
open-cogsci:nightingalefrom
chenyangsu:fix/synth-dsharp-freq

Conversation

@chenyangsu

Copy link
Copy Markdown
Contributor

In openexp/synth.py, key_to_freq('d#1') and key_to_freq('eb1') return 698.47 Hz, which sits above e1 (659.48 Hz) and matches f1 (698.48 Hz). Under 12-tone equal temperament with A4 at 440 Hz, D#5/Eb5 is 440 * 2**(6/12) = 622.25 Hz.

Could we update the d#/eb entry in key_to_freq() to 622.25 and add a unit test in tests/basic/test_synth.py? Happy to compute the chromatic table directly from 440 * 2**(k/12) instead if you prefer.

Testing: pytest tests/ -q -> 18 passed (new tests/basic/test_synth.py fails on nightingale with 698.47 vs 622.25).

@smathot

smathot commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this! 👍

@smathot
smathot merged commit f026079 into open-cogsci:nightingale Dec 1, 2026
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

Successfully merging this pull request may close these issues.

2 participants