Repository navigation
Fix: fretboard grid derives string count from getStringCount(), not hardcoded 6 - #13
Merged
Merged
Conversation
Struck chords used to fade out ~300ms after onset, and individual member notes with shorter sustains would drop out before the rest of the shape, leaving an incomplete-looking diagram. Chords are now held together for a fixed 0.9s minimum, closing #2 and #3. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016cfE1wg6F2VT6eqJEp4LBz
CodeRabbit review finding on #12: the outer chord-visibility gate used a flat `c.t >= t - CHORD_HOLD_S` check, so a chord onset more than 0.9s in the past was excluded entirely before the inner per-member loop ever got a chance to see that one of its members had a longer sus and should still be lit. E.g. a chord at t=0 with a sus:2 member was gone by t=1.5 despite the member still sustaining. Now computes the chord's actual end (max of CHORD_HOLD_S and every member's sustain) and gates on that instead, so a long-sustain member stays lit for its real duration while short members still get the 0.9s minimum hold. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016cfE1wg6F2VT6eqJEp4LBz
The overlay hardcoded a 6-string grid (FB_STRINGS = 6) and mapped chart note string indices straight onto it. On a 4-string bass chart this put highlighted notes two rows off from where they're actually played (and the e/B/G/D/A/E labels don't apply to a bass); 7/8-string GP imports had the inverse problem, with note string indices falling outside the fixed 6-row array entirely. draw() now derives stringCount from highway.getStringCount() each frame (falling back to 6 for a host too old to expose it) and uses it for all grid geometry, string colors (extended to 8 entries), and note-position mapping. String names are shown for the tunings this plugin can name confidently (6-string guitar, 4-string bass); other counts fall back to numeric labels rather than guessing a wrong note name. Closes got-feedBack#19 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016cfE1wg6F2VT6eqJEp4LBz
|
LGTM! The dynamic string count detection, string name formatting, and chord hold sustain calculations are well implemented and backed by comprehensive unit tests. 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
…dos-uj3tmu # Conflicts: # CHANGELOG.md # plugin.json
|
LGTM! The dynamic string count implementation cleanly resolves string index misalignment across different chart types (bass, standard guitar, extended-range) with robust fallbacks and solid test coverage. 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
FB_STRINGS = 6was hardcoded, and chart note string indices were mapped straight onto that fixed 6-row grid. On a 4-string bass arrangement this put highlighted notes two rows off from where they're actually played (and thee/B/G/D/A/Elabels don't apply to a bass at all); 7/8-string GP imports had the inverse problem — note string indices fell outside the fixed 6-row array entirely.draw()now derivesstringCountfromhighway.getStringCount()each frame (the same APIkeys_highway_3dand other consumers already document/use per the host'sCLAUDE.md), falling back to 6 for a host too old to expose it, and uses it for all grid geometry, string colors (extendedFB_STRING_COLORS/FB_STRING_BRIGHTto 8 entries for extended-range charts), and note-position mapping.String names are only shown for tunings this plugin can name with confidence — standard 6-string guitar and 4-string bass. Other string counts (5-string bass, 7/8-string guitar, alternate tunings) fall back to numeric labels rather than guessing a wrong note name.
Closes got-feedBack#19
Type of Change
Testing
_fbStringCount,_fbStringNames) covering: reading a valid count, falling back to 6 whengetStringCountis missing/returns something non-positive-integer, and real vs. numeric-fallback name tables.draw()-level tests confirming it actually callsgetStringCount()on the bound highway, and that it doesn't throw when the highway lacks the method (older host).node tests/screen.test.js— 26/26 pass (was 18 before this change).Repository Relevance
got-feedBack/feedBack-plugin-fretboard, which the original issue references as the canonical repo; also filing a comment onget-flashbacks/feedBack#60, which vendors a copy of this plugin and tracks the same bug, once this merges).Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_016cfE1wg6F2VT6eqJEp4LBz
Generated by Claude Code