lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheme void function problems


From: David Nalesnik
Subject: Re: Scheme void function problems
Date: Wed, 25 Mar 2015 15:11:58 -0500



On Wed, Mar 25, 2015 at 2:31 PM, David Nalesnik <address@hidden> wrote:


On Wed, Mar 25, 2015 at 2:27 PM, David Nalesnik <address@hidden> wrote:
Hi Simon,


The problem with the last invocation is this.  LilyPond considers whether the first argument you give it--"deutsch"--is a symbol.  It isn't, so it uses 'general.  Then, it looks further on for a suitable value for 'language', not for 'channel'. 

Sorry, that last should read "...a suitable value for 'language', beyond 'deutsch'."


How about this?  A bit contrived maybe...(A better solution eagerly awaited!)

%%%%
\version "2.19.16"

#(define output-language '())

language =
#(define-music-function (parser location channel language)
   (string-or-symbol? scheme?)
   (_i "Define languages for input (i.e. set note names for @var{language}),
output (i.e. display tagline and table of contents in @var{language}), or both.")
   (let* ((return (if (ly:music? language) language #{ #}))
          (language (if (string? language) language channel))
          (channel (if (string? channel) 'general channel)))
   
     (if (not (eq? channel 'output))
         (note-names-language parser language))

     (if (not (eq? channel 'input))
         (set! output-language (string->symbol language)))
     return
     ))

\language general "deutsch"
%\language "deutsch"
#(newline)
{
  c
}

%%%

David


reply via email to

[Prev in Thread] Current Thread [Next in Thread]