Bantar Builder: banjo → tār/setār fret calculator web app - #1
Draft
lanethefox wants to merge 5 commits into
Draft
Conversation
Browser tool to convert fretless 4/5-string banjos into Americanized tar/setar. Self-contained static app (no dependencies, no build step). Features: - Instrument parameter form (scale length, neck taper, materials, bridge/nut, string count and tuning presets mapping banjo strings to Persian roles: sefid/zard/bam/vakhan/zang). - To-scale SVG fret diagram with koron/sori neutral frets, solfege + Western + Persian-script labels, and wrap pips. - All 12 dastgah/avaz modes with skeleton-scale highlighting and optional auto-add of the frets a mode needs. - Integrated chromatic tuner (Web Audio autocorrelation) with on-neck marker and slide-to-tune adjustment hints. - Per-fret cut & wrap chart for tied Aquila Nylgut (cut length = ellipse perimeter x wraps + knot allowance), gauge suggestions, CSV export and printable shop sheet. - Generated, parameter-aware assembly order and tying directions. Math: generalized rule of 18 for fret positions; Ramanujan ellipse perimeter for tie lengths. Interval cents and modes editable in js/data.js. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHHNhMX5jRXoNRmTtsMnD1
New "Number of metal frets already on the banjo" input enables a hybrid build: keep the banjo's existing metal frets (exact 12-TET) and only tie Nylgut frets for the Persian neutral tones (koron/sori) that fall between them. - calc.js: existingMetalFrets param; pitches landing on a metal position are flagged 'metal' (no tie, no Nylgut) vs 'tie'. Adds metalFretList() and coincidesWithMetal(); totalNylgut() now reports tie/metal counts. - fretboard.js: draws existing metal frets as silver reference bars; in-scale metal positions get a marker instead of a tied bar. - app.js: new input wired through; fret table gains a Type column (metal ✓ / tie); summary and CSV updated; assembly guide has a dedicated hybrid procedure (metal frets as the reference grid, tie only the neutrals between them). - index.html/styles.css: input, Type column, legend swatch, tag styles. Fretless mode (0 metal frets) is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHHNhMX5jRXoNRmTtsMnD1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHHNhMX5jRXoNRmTtsMnD1
Units: new top-bar selector switches the whole tool between mm and inches. All length inputs and output columns convert in place; values are kept internally in mm. Nylgut gauges stay in mm (how Aquila sells them). Assembly-guide measurements and the Nylgut total follow the unit. Fret-removal plan (answers "which frets do I pull to get setar spacing on an already-fretted banjo"): classifyMetalFrets() tags each existing metal fret keep (its pitch is in the chosen Persian layout) or remove (it isn't). A new plan box lists remove/keep/add counts and fret numbers, and removed frets render as red dashed bars with an ✕ on the diagram. The octave/tonic (pitch-class do) is always kept. Documents that neutral koron/sori tones can only be added as ties, never produced by removal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHHNhMX5jRXoNRmTtsMnD1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BHHNhMX5jRXoNRmTtsMnD1
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.
What this is
A self-contained browser tool for converting a fretless banjo (4- or 5-string) into an Americanized tār / setār, focused on the hardest part of that build: laying out and tying the gut frets. No dependencies, no build step — open
index.htmlorpython3 -m http.server.Features
Instrument parameters — scale length, neck taper (nut/join width and thickness, since tied frets wrap the whole neck), materials (neck/head/bridge/nut), and Nylgut knot allowance. Banjo strings map onto Persian roles (sefid / zard / bam / vākhān / zang) via tuning presets, including "Americanized" presets pitched for Western jams.
To-scale fret diagram (SVG) — every tied fret at its true distance from the nut, color-coded by type (diatonic / koron / sori / chromatic), labelled in solfège + Western + Persian script. Wrap pips on the bass edge show how many times the gut goes around the neck.
All 12 dastgāh / āvāz — Māhur, Shur, Homāyun, Segāh, Chahārgāh, Navā, Rāst-Panjgāh + the five āvāz. Selecting a mode highlights the frets it needs and can auto-add them to the fret set.
Integrated chromatic tuner — Web Audio autocorrelation pitch detection; shows Hz, nearest note, cents off, and a plain-language adjustment. A marker rides the fret diagram at the heard pitch so you can slide each tied fret to pitch.
Fret cut & wrap chart — per fret: distance, spacing, neck cross-section, wrap count, exact Nylgut cut length, and a suggested gauge from your tenor stock. Total length, CSV export, printable shop sheet.
Generated assembly guide — parameter-aware order (reference frets first), knot direction, slide-to-tune method, fill-in order, overnight re-tune.
Math
d = L·(1 − 2^(−cents/1200))(verified: octave lands at exactly L/2).Accuracy / scope
Uses a deliberate "Americanized" compromise: a 12-TET skeleton plus the principal Persian neutral tones (koron/sori) at sensible neutral-interval cents. The highlighted dastgāh scales are skeleton scales ("frets you need to play in this mode"), not a full account of the modal system. All interval cents and modes are editable in
js/data.js, and individual frets/wraps are adjustable in the UI.Testing
node --check.🤖 Generated with Claude Code
Generated by Claude Code