lilypond-user
[Top][All Lists]
Advanced

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

Re: Strange Scheme problem


From: Menu Jacques
Subject: Re: Strange Scheme problem
Date: Wed, 18 Nov 2015 13:07:16 +0100

Hello Andrew,

Many thanks, here is the final version I’ll use after your proposal, with more 
readable identifers:

A nice day!

JM


%%%%%%%%%%%%%%


\version "2.19.30"

#(define (fileName)
   (let* ((args (program-arguments))
          (args-len (length args)))
     (list-ref args (- args-len 1))))
#(define fileSize                 (object->string (stat:size (stat 
(fileName)))))
#(define lilypondVersion          (object->string (lilypond-version)))
#(define currentDateAndTime       (strftime "%d/%m/%Y" (localtime 
(current-time))))
#(define currentTime              (strftime "%H:%M:%S" (localtime 
(current-time))))
#(define modificationTime         (stat:mtime (stat (fileName))))
#(define modificationTimeAsString (strftime "%d/%m/%Y - %H:%M:%S" (localtime 
modificationTime)))


\paper {
  paper-width = 21.0\cm
  paper-height = 29.72\cm
  top-margin = 1.0\cm
  bottom-margin = 1.0\cm
  left-margin = 1.49\cm
  right-margin = 1.49\cm
  indent = 0\cm
  %  page-count = 3

  oddFooterMarkup = \markup {
    \teeny
    \column {
      \fill-line {
        #(string-append
          "Music edited with Frescobaldi and engraved by LilyPond " 
(lilypond-version))
      }
      \fill-line {
        "http://www.frescobaldi.org - http://www.lilypond.org";
      }
      \fill-line { \italic { \modificationTimeAsString }}
    }
  }
}


Cello =  \relative f {
  \compressFullBarRests

  \clef "bass" \key f \major \time 4/4
  \tempo "Allegro"
  f8 [ f8 f8 f8 ] f8 [ f8
  f8 f8 ] | % 2
  \bar "|."
}


% The score definition
\score {
  <<
    \new Staff <<
      \context Staff <<
        \context Voice = "\Cello" { \Cello }
      >>
    >>
  >>

  \layout {}

  % To create MIDI output, uncomment the following line:
  %  \midi {}
}

%%%%%%%%%%%%%%

> Le 18 nov. 2015 à 12:10, Andrew Bernard <address@hidden> a écrit :
> 
> 
> Hello Jacques,
> 
> A slightly more idiomatic Scheme-like way to get the current file name being 
> processed might be something like this:
> 
> #(define (file-name)
>       (let* ((args (program-arguments))
>       (args-len (length args)))
>       (list-ref args (- args-len 1))))
> 
> 
> This follows on from David’s comment, and uses list operations rather than 
> string functions, which seems more natural to me. This could be written more 
> compactly, but it gets the idea over I hope.
> 
> Andrew
> 
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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