-
Notifications
You must be signed in to change notification settings - Fork 890
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
Fix: Corrected MIDI pitch note addition bug #4216
Conversation
@walterbender @pikurasa Pls review it |
js/widgets/musickeyboard.js
Outdated
@@ -1917,7 +1917,8 @@ function MusicKeyboard(activity) { | |||
this._createAddRowPieSubmenu = function () { | |||
docById("wheelDivptm").style.display = ""; | |||
// docById("wheelDivptm").style.zIndex = "300"; | |||
const pitchLabels = ["do", "re", "mi", "fa", "sol", "la", "ti"]; | |||
const pitchLabels = [ "do", "do♯", "re", "re♯", "mi", "fa", "fa♯", "sol", "sol♯", "la", "la♯", "ti", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove spaces before "do" and put the ] on this line.
js/widgets/musickeyboard.js
Outdated
@@ -2115,6 +2119,11 @@ function MusicKeyboard(activity) { | |||
this.displayLayout = this.displayLayout.concat(sortedHertzList); | |||
this._createKeyboard(); | |||
this._createTable(); | |||
const n= this.layout.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add space before =
js/widgets/musickeyboard.js
Outdated
@@ -2115,6 +2119,11 @@ function MusicKeyboard(activity) { | |||
this.displayLayout = this.displayLayout.concat(sortedHertzList); | |||
this._createKeyboard(); | |||
this._createTable(); | |||
const n= this.layout.length; | |||
const key = this.layout[n-1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add spaces around -
@walterbender I have made the required changes. Please review |
Description
This fix resolves an issue where newly added 'pitch' notes in the Music Keyboard Widget did not work with MIDI playback until the keyboard was restarted. While notes through virtual keyboard were clickable, they failed to play with MIDI initially.
Changes Made
1.Replaced the simpler pitchLabels array with a detailed version including sharps
2.Updated the logic to ensure new pitches don’t duplicate existing ones in the layout.
3.Ensured getElement mappings are updated immediately for new notes:
Testing
Verified that new pitches are functional immediately via MIDI without requiring a widget restart.
Untitled.video.-.Made.with.Clipchamp.mp4
Related Issue
Fixes #4149 - Bug in MIDI