davidnalesnik / lilypond-roman-numeral-tool

LilyPond typesetter for Roman numeral harmonic analysis
MIT License
23 stars 7 forks source link

Note names with hyphens are not processed #1

Closed ghost closed 8 years ago

ghost commented 8 years ago
\version "2.18"

\include "roman_numeral_analysis_tool.ily"

{
  cis''1-\markup \keyIndication { c-sharp }
  cis''1-\markup \rN { c-sharp }
}

Is rendered as

note-names

I solved this issue by replacing line 142 with

   (let ((lowercased (string-regexp-substitute "-" "" (format #f "~(~a~)" str))))

(It's a dirty hack, I know.)

davidnalesnik commented 8 years ago

When I run the code as-is on a current development release, I get this:

image

I believe David Kastrup modified the note names in a recent patch. I forgot about this (as I use the Dutch names everywhere else). Sorry--I realize that the version statement is for stable; I assumed I wasn't relying on new functionality, but I assumed wrong.

Your line will raise an error on recent versions. I think the best course of action would be to add the unhyphenated names to the english-note-names variable. I'll get on that soon. Thanks for pointing it out.

Here's the list on my system (which reminds me that I need to filter out the quarter-tone accidentals):

(cff ctqf cf cqf c cqs cs ctqs css cx dff dtqf df dqf d dqs ds dtqs dss dx eff etqf ef eqf e eqs es etqs ess ex fff ftqf ff fqf f fqs fs ftqs fss fx gff gtqf gf gqf g gqs gs gtqs gss gx aff atqf af aqf a aqs as atqs ass ax bff btqf bf bqf b bqs bs btqs bss bx c-flatflat c-flat c-natural c-sharp c-sharpsharp d-flatflat d-flat d-natural d-sharp d-sharpsharp e-flatflat e-flat e-natural e-sharp e-sharpsharp f-flatflat f-flat f-natural f-sharp f-sharpsharp g-flatflat g-flat g-natural g-sharp g-sharpsharp a-flatflat a-flat a-natural a-sharp a-sharpsharp b-flatflat b-flat b-natural b-sharp b-sharpsharp)

David

ghost commented 8 years ago

Here's the output of #(display english-note-names) on my system:

(cflatflat cflat c csharp csharpsharp dflatflat dflat d dsharp dsharpsharp eflatflat eflat e esharp esharpsharp fflatflat fflat f fsharp fsharpsharp gflatflat gflat g gsharp gsharpsharp aflatflat aflat a asharp asharpsharp bflatflat bflat b bsharp bsharpsharp cff ctqf cf cqf c cqs cs ctqs css cx dff dtqf df dqf d dqs ds dtqs dss dx eff etqf ef eqf e eqs es etqs ess ex fff ftqf ff fqf f fqs fs ftqs fss fx gff gtqf gf gqf g gqs gs gtqs gss gx aff atqf af aqf a aqs as atqs ass ax bff btqf bf bqf b bqs bs btqs bss bx)
$ lilypond -v | head -n 1
GNU LilyPond 2.18.2
davidnalesnik commented 8 years ago

I realize now that this is actually just an issue of documentation. If you are using versions older than 2.19.16, you would use the unhyphenated form, csharp instead of c-sharp. (The code for \rN simply uses whatever note names are stored in a global variable in scm/define-note-names.scm,)

I've added a note to README.md making this clear.

Thank you for alerting me to this problem!