lilypond-user
[Top][All Lists]
Advanced

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

Re: Specify output directory *in* the file


From: Thomas Morley
Subject: Re: Specify output directory *in* the file
Date: Tue, 18 Apr 2017 21:28:32 +0200

2017-04-18 20:34 GMT+02:00 Jeffery Shivers <address@hidden>:
> On Tue, Apr 18, 2017 at 12:57 PM, Patrick Hubers <address@hidden> wrote:
>>
>> I would love to use this solution, but it means that you also have to define
>> the actual name of the *file* in addition to the directory. Is there a way
>> to derive the filename from the title and use that? I found that using
>>
>>   \bookOutputName \concat { "/home/foo/" \fromproperty #'header:title }
>>
>> does not work...
>
> Couldn't one do this in scheme alone?
>
> I don't know how to retrieve bookOutputName after it is set, but maybe
> setting it independently like:
>
> #(define mytitle "mytitle")
>
> \book {
>   \header {
>     title = #mytitle
>   }
>   \bookOutputName #(string-append "sub/" mytitle)
>   \score {
>     c'4
>   }
> }
>
> But if there is a way to use fromproperty in scheme, I can't figure it out.
>
> --
>
> Jeffery Shivers
>  jefferyshivers.com
>  soundcloud.com/jefferyshivers



Not sure if it'll help, here some methods to retrieve values:

\header {
  title = "My first title"
  secondtitle = "My second title"
}

\bookOutputName "my-out"

#(format #t
  "\nBindings in the header-module:\n~y"
  (ly:module->alist $defaultheader))

#(format #t
  "\ntitle from header-module, if not found fallback is used: \"~a\"\n"
  (assoc-get 'title (ly:module->alist $defaultheader)
  "fall-back-value"))

#(format #t
  "\nsecondtitle from header-module, if not found fallback is used: \"~a\"\n"
  (assoc-get 'secondtitle (ly:module->alist $defaultheader)
  "second-fall-back-value"))

#(format #t
  "\nthirdtitle from header-module, if not found fallback is used: \"~a\"\n"
  (assoc-get 'thirdtitle (ly:module->alist $defaultheader)
  "third-fall-back-value"))

#(format #t
  "\nCurrent output-filename: \"~a\"\n"
  (paper-variable (ly:parser-lookup '$current-book) 'output-filename))

#(format #t
  "\nCurrent filename: \"~a.ly\"\n"
  (ly:parser-output-name))


HTH,
  Harm



reply via email to

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