Skip to content

Commit

Permalink
Fix slash chords display error
Browse files Browse the repository at this point in the history
  • Loading branch information
sitandr committed Jan 11, 2025
1 parent ef6de1a commit fac4b04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/preview/conchord/0.3.0/chords/sheet.typ
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// width of space in current font,
/// may be set to zero if you don't put
/// any spaces between chords and words -> length
width: -0.25em) = box(place(align, styling([#text <chord>])), height: 1em + height, width: width)
width: -0.25em) = box(place(align, box(styling([#text <chord>]), width: float("inf")*1pt)), height: 1em + height, width: width)

/// 1a. A replacement for overchord, displays chords inline in (double) square brackets
/// -> content
Expand Down
18 changes: 13 additions & 5 deletions packages/preview/conchord/0.3.0/chords/smart-chord.typ
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,19 @@
chord,
/// number of halftones to move tonality -> int
tonality) = {
let match = chord.match(_chord-root-regex).text
let base = _notes.position(e => e == match.at(0))
let delta = if match.len() == 1 {0} else {_pm.at(match.at(1))}
let new = calc.rem(base + delta + tonality, 12)
chord.replace(_chord-root-regex, _notes.at(new))
if chord.match(_chord-root-regex) == none {
panic("Not a chord", chord)
}

chord.replace(_chord-root-regex,
match => {
let match = match.text
let base = _notes.position(e => e == match.at(0))
let delta = if match.len() == 1 {0} else {_pm.at(match.at(1))}
let new = calc.rem(base + delta + tonality, 12)
_notes.at(new)
}
)
}

/// Gives the played notes by the tabstring -> array
Expand Down

0 comments on commit fac4b04

Please sign in to comment.