Fix error of noteToFreq() in p5.sound.js #8040
Open
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.
Changes:
wholeNotes
object's value inp5.sound.js
(please help me updatep5.sound.min.js
as well...)When building a project using the p5.sound.js library, there's an error in the p5.MonoSynth.triggerAttack() function when passing a MIDI value in Note/Octave format (
"C4"
,"Eb3"
, etc.) as the parameter. The frequency of notes"A"
and"B"
(and related notes like"A#"
,"Ab"
) should belong to the next octave. (i.e., when passing"B5"
as the parameter, the result is actually the frequency of"B4"
).This sketch showcases the error: https://editor.p5js.org/CharlieEL/sketches/cit_Ecpdm
By adding 12 to the
A
andB
values of thewholeNotes
object, the bug should be fixed.