Re: ly:pitch and string

2014-10-12 Thread Paul Morris
Simon Albrecht-2 wrote > Thanks for your help in improving the helper functions; however, > ‘inverting’ string-append and cond seems to be based on a > misunderstanding. It needs to be Ah, I see now... I was "missing the forest for the trees." Cheers, -Paul -- View this message in context:

Re: ly:pitch and string

2014-10-12 Thread Simon Albrecht
Hello Paul, Thanks for your help in improving the helper functions; however, ‘inverting’ string-append and cond seems to be based on a misunderstanding. It needs to be %% \version "2.19.12" \language "deutsch" pitch-to-key-string-german = #(define-scheme-function (parser locat

Re: ly:pitch and string

2014-10-11 Thread Paul Morris
Simon Albrecht-2 wrote > well, now I did try and make a function for german note names, which > discerns major and minor also. Actually it works – the transposition is > applied correctly and there are no unexpected messages – but at testing > there seemed to be a memory problem: from some point

Re: ly:pitch and string

2014-10-11 Thread Simon Albrecht
Hello David, thanks, that’s exactly the kind of brief and elegant solution I was hoping for. Yours, Simon Am 11.10.2014 um 16:52 schrieb David Kastrup: Simon Albrecht writes: Hello, consider the following setup: %% \version "2.19.12" newTonic = d newTonicString = "d" \book

Re: ly:pitch and string

2014-10-11 Thread David Kastrup
Simon Albrecht writes: > Hello, > > consider the following setup: > %% > \version "2.19.12" > > newTonic = d > > newTonicString = "d" > > \bookOutputSuffix #(string-append "in-" newTonicString) > > \score { \transpose c \newTonic { c' } } > > %% > > For easy handling of di

Re: ly:pitch and string

2014-10-10 Thread Simon Albrecht
Hello again, well, now I did try and make a function for german note names, which discerns major and minor also. Actually it works – the transposition is applied correctly and there are no unexpected messages – but at testing there seemed to be a memory problem: from some point onwards, the n

Re: ly:pitch and string

2014-10-10 Thread Simon Albrecht
Hello Paul, thanks a lot! I thought along the same lines also, but (1) my less elegant coding and (2) the complications brought along by German notenames would’ve made it too tedious. Am 10.10.2014 um 23:44 schrieb Paul Morris: Just for fun, another version, more compact, probably more crypt

Re: ly:pitch and string

2014-10-10 Thread Paul Morris
Just for fun, another version, more compact, probably more cryptic: %% \version "2.19.12" pitch-to-string = #(define-scheme-function (parser location p) (ly:pitch?) (string-append (list-ref '("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename p)) (list-ref '("-Double-Fl

Re: ly:pitch and string

2014-10-10 Thread Paul Morris
Simon Albrecht-2 wrote > I’d like to avoid having to synchronise newTonic and newTonicString > manually, but I’ve been unable to find a convenient way to convert one > into the other. Can anybody help? Hi Simon, This does the job. I might contribute it to the LSR. Cheers, -Paul %%

ly:pitch and string

2014-10-10 Thread Simon Albrecht
Hello, consider the following setup: %% \version "2.19.12" newTonic = d newTonicString = "d" \bookOutputSuffix #(string-append "in-" newTonicString) \score { \transpose c \newTonic { c' } } %% For easy handling of different transpositions the ‘destination pitch’ is