Repository navigation
fix(lang): a bar's text takes in its slashes, its tie and its commands - #115
Merged
Merged
Conversation
A chord that fills its bar (`G ////`, `Dm_8 ~` at a bar's end) opens the next bar as it is read, so the slashes, tie or command written after it were counted as the next bar's text, or dropped at the line's end. An edit of the bar then wrote over the chord alone and left the rest: `G ////` became `Gmaj7_1 ////`, a bar too many, and the write was refused. Such a token, putting nothing in the bar it opened on, is now the bar's before it. Dev vault: notes entered and written back 1,956 -> 2,164, chords 2,064 -> 2,194; refusals 533 -> 325.
fts-forge Bot
added a commit
that referenced
this pull request
Nov 18, 2026
Palette cells apply to the selected chord. Stacked on #115 (bar spans). ## What a cell does A cell click runs `KEYFLOW_PALETTE_APPLY {token}`, the action ⌘K and MCP run too, on the chord symbol selected on the chart. It is one edit and one undo step. - **Chord qualities** (maj7, m7, 7, m7♭5, dim7, aug, sus4, 7sus, add9, 6, 9, m9): set the chord's quality and keep its root, bass and marks. `'F#m7/A` + maj7 → `'F#maj7/A`. - **Accent and staccato:** go on the chord, or off when they are on (`>G`, `.G`). - **Push and push 16:** refused, with the reason in the status line. A push moves the chord ahead of its beat (into the bar before when it is on a downbeat). A bar's chord line doesn't place that offset yet, so the write-back check refused it. - **Every other cell** says it isn't placed yet and gives its token to type: sections, keys, time signatures, tempi, repeats, dynamics, text, marcato, fermata, stop, tie. - **On a replayed bar:** the edit goes to the bar it plays, as retyping does. ## A bar's own style kept An edited bar used to be written with values, so `G ////` became `Gmaj7_1`, one whole-note slash where the author had four. A bar written in beat slashes, with no values, is now written in slashes again when its chords are whole beats (`Gmaj7 ////`, `D // G //`). It falls back to values when that doesn't read back the same. The vault's edit counts are unchanged by this; only how a bar is written changes. ## Checked in the app Isolated Architect at `9d1f2f48`, *Drive To LA*: I selected the G at bar 19 and clicked `maj7`. It engraved as G△7, and the file line went from `G ////` to `Gmaj7_1`. That was before the slash-style commit; with it, the line is written `Gmaj7 ////`, which the tests check but I didn't recheck in the app. Before #115 the same click was refused (a bar too many). ## Tests - **New:** `a_palette_cell_sets_the_selected_chord_s_quality_or_marks_it` (a quality, the accent and staccato on and off, a push refused with why, a downbeat chord accented, nothing selected) and `every_cell_applies_or_says_why_not`. In `chords`: `with_quality` and `with_mark`. - **Changed:** expectations for bars first written in slashes: `C / Gsus4 ///` rather than `C_4 Gsus4_2.`, and `D // G //` rather than `D_2 G_2`. - **`just ci`:** 2,610 passed, 51 skipped. ## Not done Lasso and multi-chord selections apply to the chord last clicked, not to every chord in the lasso. The cells that place things in a bar or a section (keys, meters, tempi, sections, repeats, dynamics, cues) are the next piece.
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.
A bar's text in the source now takes in what goes with its chord: its slashes (
G ////), a tie at its end (Dm_8 ~), a command (\fermata).The bug
A chord that fills its bar opens the next bar as it is read. So the slashes, tie or command written after it were counted as the next bar's text, or dropped at the end of a line. An edit of the bar then wrote over the chord alone and left the rest behind:
G ////with a new quality becameGmaj7_1 ////. That is a bar too many, so the write was refused ("Section Pre(Chorus) has 9 parsed measures but header specifies 8").The fix
A slash group, a
~or a\commandthat adds nothing to the bar it opened on, and comes right after a token that ended a bar exactly, belongs to the bar before (bar_spans).Dev vault (
edit_vault, 2,700 bars)The biggest gains are in charts written a bar per line in slashes: She's American 79 → 122 notes, Hey! 53 → 88, Drive To LA 56 → 83.
Tests
a_bar_s_text_takes_in_its_slashes_and_its_tie, coveringG ////,G //// C ////,G_1 ~andD_1 \fermata.E /// G#m /(its trailing slash is now its own) instead ofE /// G#m. Both read back the same, and the write is checked.G / / / / C / / / /) still shares its text with the next bar. Such a run is still edited by writing it out bar by bar.just ci: passes on the stack's top (2,610 passed, 51 skipped).