Fix temperament widget playing incorrect notes for default temperaments #4802
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where the temperament widget was playing incorrect notes for default temperaments (non-12EDO) such as 5EDO, 7EDO, 19EDO, and 31EDO. The widget was passing raw frequency values directly to the synth, which bypassed the temperament mapping system entirely.
Problem
When playing notes in the temperament widget for default temperaments:
synth.trigger()_getFrequency()method was bypassedtemperamentChanged()was not appliedSolution
Modified the
playNotefunction injs/widgets/temperament.jsto:["C", 4]→"C4")Changes Made
playNote()function to setsynth.inTemperamentandsynth.changeInTemperamentbefore playingTechnical Details
For default temperaments, the synth now:
"C4","D#4")_getFrequency()which triggerstemperamentChanged()noteFrequenciesTesting
Related Issue
Fixes #4033
Checklist
Note: This fix ensures that default temperaments (5EDO, 7EDO, 19EDO, 31EDO, etc.) play notes correctly according to their interval structure, resolving the issue where notes were playing at incorrect frequencies.