Skip to content

Comments

fix: implement gradual lag correction to prevent note rushing (#3882)#5095

Merged
walterbender merged 1 commit intosugarlabs:masterfrom
7se7en72025:fix/no-clock-block-timing-3882
Jan 28, 2026
Merged

fix: implement gradual lag correction to prevent note rushing (#3882)#5095
walterbender merged 1 commit intosugarlabs:masterfrom
7se7en72025:fix/no-clock-block-timing-3882

Conversation

@7se7en72025
Copy link
Contributor

Fixes #3882

Limits lag correction to 25% of each note's duration instead of catching up all at once. This prevents notes from being rushed while still synchronizing with the master clock over time.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

✅ All Jest tests passed! This PR is ready to merge.

@walterbender walterbender merged commit 66db267 into sugarlabs:master Jan 28, 2026
5 checks passed
7se7en72025 added a commit to 7se7en72025/musicblocks that referenced this pull request Feb 2, 2026
…abs#3882) (sugarlabs#5095)

Add tests for getPitchInfo and pitch calc

Update musicutils tests: normalize object literal keys (use unquoted numeric keys and property names) and change notePitches index to a numeric key. Replace a TODO with comprehensive unit tests for getPitchInfo (alphabet, alphabet/letter class, solfege fixed/movable, pitch class, scalar class, scale degree, nth degree, staff y, pitch in hertz, pitch-to-color/shade, and invalid input) and add tests for _calculate_pitch_number (standard note parsing and relative pitch comparison). These tests increase coverage for pitch-related utilities.

Improve frequency handling and code formatting

Introduce a newFrequency variable and use parseFloat once, replacing exact equality checks with a tolerant comparison (Math.abs(... - value) < 0.001) to avoid floating-point equality bugs when finding/inserting stairs. Clean up arithmetic/parentheses in width calculation and unify use of newFrequency when pushing/splicing stairs. Also apply small formatting and style tweaks: reformat long chained assignments (decoration bitmap scales), normalize toTitleCase declaration/brace style, and compress widgetWindow.addButton onclick lambdas for readability. These changes are intended to improve correctness around frequency comparisons and overall code consistency.
walterbender pushed a commit that referenced this pull request Feb 3, 2026
…er (#5468)

* fix: implement gradual lag correction to prevent note rushing (#3882) (#5095)

Add tests for getPitchInfo and pitch calc

Update musicutils tests: normalize object literal keys (use unquoted numeric keys and property names) and change notePitches index to a numeric key. Replace a TODO with comprehensive unit tests for getPitchInfo (alphabet, alphabet/letter class, solfege fixed/movable, pitch class, scalar class, scale degree, nth degree, staff y, pitch in hertz, pitch-to-color/shade, and invalid input) and add tests for _calculate_pitch_number (standard note parsing and relative pitch comparison). These tests increase coverage for pitch-related utilities.

Improve frequency handling and code formatting

Introduce a newFrequency variable and use parseFloat once, replacing exact equality checks with a tolerant comparison (Math.abs(... - value) < 0.001) to avoid floating-point equality bugs when finding/inserting stairs. Clean up arithmetic/parentheses in width calculation and unify use of newFrequency when pushing/splicing stairs. Also apply small formatting and style tweaks: reformat long chained assignments (decoration bitmap scales), normalize toTitleCase declaration/brace style, and compress widgetWindow.addButton onclick lambdas for readability. These changes are intended to improve correctness around frequency comparisons and overall code consistency.

* Update pitchstaircase.js
vanshika2720 pushed a commit to vanshika2720/musicblocks that referenced this pull request Feb 11, 2026
…er (sugarlabs#5468)

* fix: implement gradual lag correction to prevent note rushing (sugarlabs#3882) (sugarlabs#5095)

Add tests for getPitchInfo and pitch calc

Update musicutils tests: normalize object literal keys (use unquoted numeric keys and property names) and change notePitches index to a numeric key. Replace a TODO with comprehensive unit tests for getPitchInfo (alphabet, alphabet/letter class, solfege fixed/movable, pitch class, scalar class, scale degree, nth degree, staff y, pitch in hertz, pitch-to-color/shade, and invalid input) and add tests for _calculate_pitch_number (standard note parsing and relative pitch comparison). These tests increase coverage for pitch-related utilities.

Improve frequency handling and code formatting

Introduce a newFrequency variable and use parseFloat once, replacing exact equality checks with a tolerant comparison (Math.abs(... - value) < 0.001) to avoid floating-point equality bugs when finding/inserting stairs. Clean up arithmetic/parentheses in width calculation and unify use of newFrequency when pushing/splicing stairs. Also apply small formatting and style tweaks: reformat long chained assignments (decoration bitmap scales), normalize toTitleCase declaration/brace style, and compress widgetWindow.addButton onclick lambdas for readability. These changes are intended to improve correctness around frequency comparisons and overall code consistency.

* Update pitchstaircase.js
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.

Fixing issue that requires 'No Clock' block

2 participants