Re: Creating markup macros (functions actually)

2004-11-27 Thread Nicolas Sceaux
Han-Wen Nienhuys <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: >> Yes, and a list is not the same thing as a function. The fact that a >> markup expression is a list is actually an implementation detail that >> you should not bother about. > > (would it be a good idea to box markup expre

Re: Creating markup macros

2004-11-27 Thread Nicolas Sceaux
Han-Wen Nienhuys <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: >> Paul Scott <[EMAIL PROTECTED]> writes: >> >> > #(def-markup-command (restOne layout props) >> > (interpret-markup layout props >> >(markup #:number #1))) >> >> As soon as you are inside a Scheme expression, you don

Re: Creating markup macros

2004-11-27 Thread Han-Wen Nienhuys
[EMAIL PROTECTED] writes: > >\score{ \rOne } > > > > > Thank you very much. Now can you give me a hint as to a good way to > combine those two definitions so a the second definition of rOne isn't > necessary? This is because I want to make rOne eventually generate the > correct one measure

Re: Creating markup macros (functions actually)

2004-11-27 Thread Han-Wen Nienhuys
[EMAIL PROTECTED] writes: > Yes, and a list is not the same thing as a function. The fact that a > markup expression is a list is actually an implementation detail that > you should not bother about. (would it be a good idea to box markup expressions inside a smob ?) > > Parsing... > > Backtrace:

Re: Creating markup macros

2004-11-27 Thread Han-Wen Nienhuys
[EMAIL PROTECTED] writes: > Paul Scott <[EMAIL PROTECTED]> writes: > > > #(def-markup-command (restOne layout props) > > (interpret-markup layout props > >(markup #:number #1))) > > As soon as you are inside a Scheme expression, you don't have to use > `#' before expressions; the \number ma

Re: Creating markup macros (functions actually)

2004-11-27 Thread Paul Scott
Nicolas Sceaux wrote: hm, sorry. (define-module (lily)) (use-modules (ice-9 format) (ice-9 optargs) (srfi srfi-1)) ... Works great! Thanks, Paul ___ lilypond-user mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/lis

Re: Creating markup macros (functions actually)

2004-11-27 Thread Nicolas Sceaux
Paul Scott <[EMAIL PROTECTED]> writes: > Nicolas Sceaux wrote: > >>Create that music-display.scm file, in the same directory as >>displayscheme.ly, with the code from >> http://lists.gnu.org/archive/html/lilypond-devel/2004-11/msg00029.html >> > In my best attempt to extract the code from that ema

Re: Creating markup macros (functions actually)

2004-11-27 Thread Paul Scott
Nicolas Sceaux wrote: Create that music-display.scm file, in the same directory as displayscheme.ly, with the code from http://lists.gnu.org/archive/html/lilypond-devel/2004-11/msg00029.html In my best attempt to extract the code from that email I get: GNU LilyPond 2.4.2 Processing `displaysche

Re: Creating markup macros (functions actually)

2004-11-27 Thread Paul Scott
Nicolas Sceaux wrote: <>Paul Scott <[EMAIL PROTECTED]> writes: That I don't yet. Another look at new-markup-scm tells me a markup is a list? Yes, and a list is not the same thing as a function. Understood. The fact that a markup expression is a list is actually an implementation detail that

Re: Creating markup macros (functions actually)

2004-11-27 Thread Nicolas Sceaux
Paul Scott <[EMAIL PROTECTED]> writes: >>(lambda ...) evaluates to a function, >> > That I understand. > >> where you want a markup. >> > That I don't yet. Another look at new-markup-scm tells me a markup is > a list? Yes, and a list is not the same thing as a function. The fact that a markup ex

Re: Creating markup macros (functions actually)

2004-11-27 Thread Paul Scott
Paul Scott wrote: I get: [EMAIL PROTECTED]:~/music/test$ lilypond-snapshot displayscheme.ly GNU LilyPond 2.4.2 Processing `displayscheme.ly' Parsing... Backtrace: In unknown file: ?: 0* [primitive-load "music-display.scm"] : In procedure open-file in expression (primitive-load name): : No such f

Re: Creating markup macros (functions actually)

2004-11-27 Thread Paul Scott
Nicolas Sceaux wrote: Paul Scott <[EMAIL PROTECTED]> writes: Does this make any sense? #(def-markup-command (testOne layout props) () (interpret-markup layout props (markup #:number (lambda (x) (ly:music-property x 'numerator) No. (lambda ...) evaluates to a function, That I under

Re: Creating markup macros (functions actually)

2004-11-27 Thread Nicolas Sceaux
Paul Scott <[EMAIL PROTECTED]> writes: > Does this make any sense? > > #(def-markup-command (testOne layout props) () > (interpret-markup layout props >(markup #:number > (lambda (x) (ly:music-property x 'numerator) No. (lambda ...) evaluates to a function, where you want a markup.

Re: Creating markup macros (functions actually)

2004-11-27 Thread Paul Scott
Nicolas Sceaux wrote: Paul Scott <[EMAIL PROTECTED]> writes: Ok, that looks pretty simple but I'm not quite sure yet how to combine my two definitions so I won't have to type '\markup' each time. (see below). Even so I would like to understand the scheme code. I have been searching through the

Re: Creating markup macros (functions actually)

2004-11-27 Thread Nicolas Sceaux
Paul Scott <[EMAIL PROTECTED]> writes: > Ok, that looks pretty simple but I'm not quite sure yet how to combine > my two definitions so I won't have to type '\markup' each time. (see > below). > > Even so I would like to understand the scheme code. I have been > searching through the scm directo

Re: Creating markup macros

2004-11-27 Thread Paul Scott
Nicolas Sceaux wrote: Paul Scott <[EMAIL PROTECTED]> writes: #(def-markup-command (restOne layout props) () (interpret-markup layout props (markup #:number "1"))) rOne = { R1^\markup \restOne } \score{ \rOne } Thank you very much. Now can you give me a hint as to a good way to combine

Re: Creating markup macros

2004-11-27 Thread Nicolas Sceaux
Paul Scott <[EMAIL PROTECTED]> writes: >>#(def-markup-command (restOne layout props) () >> (interpret-markup layout props (markup #:number "1"))) >> >>rOne = { R1^\markup \restOne } >> >>\score{ \rOne } >> >> > Thank you very much. Now can you give me a hint as to a good way to > combine those

Re: Creating markup macros

2004-11-26 Thread Paul Scott
Nicolas Sceaux wrote: Paul Scott <[EMAIL PROTECTED]> writes: #(def-markup-command (restOne layout props) (interpret-markup layout props (markup #:number #1))) As soon as you are inside a Scheme expression, you don't have to use `#' before expressions; the \number markup command takes a m

Re: Creating markup macros

2004-11-26 Thread Nicolas Sceaux
Paul Scott <[EMAIL PROTECTED]> writes: > #(def-markup-command (restOne layout props) > (interpret-markup layout props >(markup #:number #1))) As soon as you are inside a Scheme expression, you don't have to use `#' before expressions; the \number markup command takes a markup as an argument

Creating markup macros

2004-11-26 Thread Paul Scott
I'm trying to learn to create markup (and other) macros. This is my current code to simply produce \markup{ \number 1 }. I want it eventually to use numerator and denominator to work for the current meter. Can someone give me some hints as to what this simple version is missing or documentat