Re: Markup functions and punctuation in lyrics

2021-11-06 Thread Fr. Samuel Springuel
I’ve done some work to clean up my code and also modified the interface to be fairly intuitive and non-intrusive. Hopefully I’ll have some time this week to integrate this into my project, but if anyone sees anything that could be improved, I’d love to hear about it. ✝✝

Re: Markup functions and punctuation in lyrics

2021-11-04 Thread Fr. Samuel Springuel
On Nov 2, 2021, at 11:26 PM, Aaron Hill wrote: > > Okay, would text replacement be viable as opposed to writing a bunch of > individual functions? That does sound nice. There would need to be some helper functions to handle the formatting issue that Jean pointed out, but I can get that mostly

Re: Markup functions and punctuation in lyrics

2021-11-03 Thread Jean Abou Samra
Le 03/11/2021 à 04:26, Aaron Hill a écrit : Okay, would text replacement be viable as opposed to writing a bunch of individual functions? feminine = #'(("man/woman" . "woman")    ("his/her" . "her")    ("he/she" . "she")) \markup \replace \feminine {   The man/woman, tightly clutching

Re: Markup functions and punctuation in lyrics

2021-11-02 Thread Aaron Hill
On 2021-11-02 2:56 pm, R. Padraic Springuel wrote: On Nov 2, 2021, at 1:00 PM, Aaron Hill wrote: Not sure if this was already suggested, but could you use something like this to concatenate arbitrary markup? I think that what you’re suggesting is in the spirit of what David was suggesting,

Re: Markup functions and punctuation in lyrics

2021-11-02 Thread R. Padraic Springuel
On Nov 2, 2021, at 1:00 PM, Aaron Hill wrote: > > Not sure if this was already suggested, but could you use something like this > to concatenate arbitrary markup? I think that what you’re suggesting is in the spirit of what David was suggesting, but I’m trying to reduce the input overhead at t

Re: Markup functions and punctuation in lyrics

2021-11-02 Thread Jean Abou Samra
Le 02/11/2021 à 16:23, R. Padraic Springuel a écrit : On Oct 31, 2021, at 6:02 PM, David Kastrup wrote: If the ugliness of juxtaposition is ok, you may use things like \,\man for concatenating stuff, too. What about event functions? Can a command which does the concatenation be written as

Re: Markup functions and punctuation in lyrics

2021-11-02 Thread Aaron Hill
On 2021-11-02 8:23 am, R. Padraic Springuel wrote: On Oct 31, 2021, at 6:02 PM, David Kastrup wrote: If the ugliness of juxtaposition is ok, you may use things like \,\man for concatenating stuff, too. Not sure if this was already suggested, but could you use something like this to concate

Re: Markup functions and punctuation in lyrics

2021-11-02 Thread R. Padraic Springuel
> On Oct 31, 2021, at 6:02 PM, David Kastrup wrote: > > If the ugliness of juxtaposition is ok, you may use things like > > \,\man > > for concatenating stuff, too. What about event functions? Can a command which does the concatenation be written as an event function so that the juxtaposit

Re: Markup functions and punctuation in lyrics

2021-10-31 Thread David Kastrup
"R. Padraic Springuel" writes: >> On Oct 18, 2021, at 5:57 PM, David Kastrup wrote: >> >> I'd lean towards defining \man like in the question and a function \maN >> that takes the following markup and concatenates it. That's viciously >> unclever but sometimes not having to worry whether the c

Re: Markup functions and punctuation in lyrics

2021-10-31 Thread R. Padraic Springuel
> On Oct 18, 2021, at 5:57 PM, David Kastrup wrote: > > I'd lean towards defining \man like in the question and a function \maN > that takes the following markup and concatenates it. That's viciously > unclever but sometimes not having to worry whether the computer gets > everything right is its

Re: Markup functions and punctuation in lyrics

2021-10-18 Thread David Kastrup
Jean Abou Samra writes: > Le 18/10/2021 à 21:22, R. Padraic Springuel a écrit : >> I’m using some functions to allow me to select words in the lyrics >> of some hymns in a systematic way so that the same hymn can be used >> referring to one or more persons (and in some cases, either a man or >> a

Re: Markup functions and punctuation in lyrics

2021-10-18 Thread Jean Abou Samra
Le 18/10/2021 à 21:22, R. Padraic Springuel a écrit : I’m using some functions to allow me to select words in the lyrics of some hymns in a systematic way so that the same hymn can be used referring to one or more persons (and in some cases, either a man or a woman). These functions work just

Markup functions and punctuation in lyrics

2021-10-18 Thread R. Padraic Springuel
I’m using some functions to allow me to select words in the lyrics of some hymns in a systematic way so that the same hymn can be used referring to one or more persons (and in some cases, either a man or a woman). These functions work just fine when they appear in the lyrics by themselves, but

Re: Making markup functions parametric

2020-07-04 Thread David Kastrup
Lukas-Fabian Moser writes: >>> Of course I can do >>> >>> circlefunc = \markup\circle\etc >>> \markup \test \circlefunc "whatever" >> You can? Have you tried? \circlefunc here is quite equivalent to >> \circle . > > Hm, I think I do not understand. With > > test = > #(define-scheme-function (en

Re: Making markup functions parametric

2020-07-04 Thread Lukas-Fabian Moser
Of course I can do circlefunc = \markup\circle\etc \markup \test \circlefunc "whatever" You can? Have you tried? \circlefunc here is quite equivalent to \circle . Hm, I think I do not understand. With test = #(define-scheme-function (enclosure content) (markup-function? markup?) (list

Re: Making markup functions parametric

2020-07-04 Thread David Kastrup
Lukas-Fabian Moser writes: > Hi David, > >> test = >> #(define-scheme-function (enclosure content) >>(markup-function? markup?) >>(list enclosure #{ \markup \box #content #})) >> >> \markup \test \markup \circle \with-color #red \etc "whatever" > > Amazing, wonderfully elegant. > > Is the

Re: Making markup functions parametric

2020-07-04 Thread Lukas-Fabian Moser
Hi David, test = #(define-scheme-function (enclosure content) (markup-function? markup?) (list enclosure #{ \markup \box #content #})) \markup \test \markup \circle \with-color #red \etc "whatever" Amazing, wonderfully elegant. Is there a way to avoid the second "\markup" and "\etc" in

Re: Making markup functions parametric

2020-07-04 Thread David Kastrup
Urs Liska writes: > In the following markup command definition > > #(define-markup-command (test layout props enclosure content) > (scheme? markup?) >(interpret-markup layout props (markup #:circle content))) > > I would like to make the #:circle parametric, i.e. I want to pass > something

Re: Making markup functions parametric

2020-07-04 Thread Urs Liska
Hi Lukas, Am Samstag, den 04.07.2020, 10:22 +0200 schrieb Lukas-Fabian Moser: > Hi Urs, > > > I have tried various things, but I don't seem to understand how > > that > > primitive-eval actually works here. Your solution does only work > > when > > the input is a simple markup (string), not when

Re: Making markup functions parametric

2020-07-04 Thread Lukas-Fabian Moser
Hi Urs, I have tried various things, but I don't seem to understand how that primitive-eval actually works here. Your solution does only work when the input is a simple markup (string), not when it is wrapped in other markup commands. It seems to work quite robustly if you draw the given conte

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Am Samstag, den 04.07.2020, 05:28 +0200 schrieb Urs Liska: > > Am 3. Juli 2020 23:33:42 MESZ schrieb Lukas-Fabian Moser > : > > > #(define (get-scheme-markup-function func) > > >(string->symbol > > > (string-append "make-" > > >(symbol->string func) > > >

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Am 3. Juli 2020 23:33:42 MESZ schrieb Lukas-Fabian Moser : > >> #(define (get-scheme-markup-function func) >>    (string->symbol >>     (string-append "make-" >>    (symbol->string func) >>    "-markup"))) > >... which should be replaced by > >#(define (get-scheme

Re: Making markup functions parametric

2020-07-03 Thread Lukas-Fabian Moser
#(define (get-scheme-markup-function func)    (string->symbol     (string-append "make-"    (symbol->string func)    "-markup"))) ... which should be replaced by #(define (get-scheme-markup-function func)    (symbol-append 'make- func '-markup)) Sorry, I had

Re: Making markup functions parametric

2020-07-03 Thread Lukas-Fabian Moser
(interpret-markup layout props (markup ((assq-ref funcs func) content) \markup \dyna #'circle "C:" \markup \dyna #'box "C:" You don't even need to hardcode the make-xxx-markup functions: \version "2.20" #(define (get-scheme-marku

Re: Making markup functions parametric

2020-07-03 Thread Aaron Hill
On 2020-07-03 1:07 pm, Urs Liska wrote: But I'd rather do something like (markup (assq-ref enclosures enclosure) "CC") markup is a macro, and macros appear to have unique rules of evaluation. The following approach defers the macro expansion: \version "2.20.0" #(define-markup-command

Re: Making markup functions parametric

2020-07-03 Thread Ralf Mattes
Am Freitag, 03. Juli 2020 22:07 CEST, Urs Liska schrieb: > > Syntacilally? That would be a scheme keyword. > > So that would be difficult to inject from a variable/argument, isn't > it? No, why? You can of course store a keyword in a variable and/or pass it as an argument. > I can of course

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Hi Robin, Am Freitag, den 03.07.2020, 22:11 +0200 schrieb Robin Bannister: > Urs Liska wrote: > > > Unfortunately I don't really have an idea what "#:circle" actually > > *is*, so I have no clue about getting where I need to. > > I think it's a sort of macro thingy, trying to be easy to be used.

Re: Making markup functions parametric

2020-07-03 Thread Robin Bannister
Urs Liska wrote: Unfortunately I don't really have an idea what "#:circle" actually *is*, so I have no clue about getting where I need to. I think it's a sort of macro thingy, trying to be easy to be used. Look at 'Known issues and warnings' at the bottom of https://lilypond.org/doc/v2.20/D

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Am Freitag, den 03.07.2020, 21:58 +0200 schrieb Ralf Mattes: > > Am Freitag, 03. Juli 2020 21:52 CEST, Urs Liska < > li...@openlilylib.org> schrieb: > > > Unfortunately I don't really have an idea what "#:circle" actually > > *is*, so I have no clue about getting where I need to. > > Syntacil

Re: Making markup functions parametric

2020-07-03 Thread Ralf Mattes
Am Freitag, 03. Juli 2020 21:52 CEST, Urs Liska schrieb: > Unfortunately I don't really have an idea what "#:circle" actually > *is*, so I have no clue about getting where I need to. Syntacilally? That would be a scheme keyword. Cheers, RalfD > BestUrs > > -- Ralf Mattes Hochschule für M

Making markup functions parametric

2020-07-03 Thread Urs Liska
In the following markup command definition #(define-markup-command (test layout props enclosure content) (scheme? markup?) (interpret-markup layout props (markup #:circle content))) I would like to make the #:circle parametric, i.e. I want to pass something into the function (e.g. as the 'en

Re: markup functions

2017-02-18 Thread Marc Mouries
this works: #(define-markup-command (instruct layout props text) (markup?) (interpret-markup layout props #{ \markup \italic \magnify #0.7 #text #})) mkTenor = \markup { \instruct "tenor"} \relative c' { d1-\mkTenor } =Marc On Sat, Feb 18, 2017 at 9:52 AM, Rob Torop w

Re: markup functions

2017-02-18 Thread David Kastrup
Rob Torop writes: > I have a bunch of repeated things like this > >d f \mark \markup \italic \magnify #0.7 "(tenor & trp.)" r16 > > where I put a little instruction over the melody > > I'd like to have a little function to call instead of \mark \markup \italic > \magnify #0.7 "blah",

markup functions

2017-02-18 Thread Rob Torop
I have a bunch of repeated things like this d f \mark \markup \italic \magnify #0.7 "(tenor & trp.)" r16 where I put a little instruction over the melody I'd like to have a little function to call instead of \mark \markup \italic \magnify #0.7 "blah", with the "blah" as a parameter.

Re: Feeling stupid about markup functions

2014-08-27 Thread Jan-Peter Voigt
quot; > > myFunction = > #(define-scheme-function (parser location text) (markup?) >#{ > \markup \italic \with-color #(x11-color "blue") #text >#}) > > pizz = \myFunction "pizz" > > { > c'1 > c'-\myFunction "foo

Re: Feeling stupid about markup functions

2014-08-27 Thread Paul Morris
nction "pizz" { c'1 c'-\myFunction "foo" c'-\pizz } -- View this message in context: http://lilypond.1069038.n5.nabble.com/Feeling-stupid-about-markup-functions-tp165849p165852.html Sent from the User mailing list archive at Nabble.com. __

Feeling stupid about markup functions

2014-08-27 Thread Urs Liska
Hi, I've been feeling stupid about this but now I finally have to ask for it ... I can define a markup function \playing so that \version "2.19.11" #(define-markup-command (playing layout props text) (markup?) "Print an technical performance indication (like sordini or instrument change."

Re: Access font-name in markup functions

2012-04-26 Thread James
Hello, On 26 April 2012 21:11, Urs Liska wrote: > Hello Jan-Peter, > > thank you for this information. > This is exactly what I needed! > > Can I find this in the docs? To get a better understanding ... It's mentioned here at least http://lilypond.org/doc/v2.15/Documentation/changes/index.html

Re: Access font-name in markup functions

2012-04-26 Thread Urs Liska
Hello Jan-Peter, thank you for this information. This is exactly what I needed! Can I find this in the docs? To get a better understanding ... Best Urs Am 25.04.2012 10:37, schrieb Jan-Peter Voigt: Hello Urs, if you are using the current devel version, you can wrap any markup with #{ #} --

Re: Access font-name in markup functions

2012-04-25 Thread Jan-Peter Voigt
Hello Urs, if you are using the current devel version, you can wrap any markup with #{ #} --snip-- \version "2.15.37" #(define-markup-command (nfont layout props arg)(markup?) (interpret-markup layout props #{ \markup { \override #'(font-name . "DejaVu Sans") $arg } #})) \markup { \

Access font-name in markup functions

2012-04-25 Thread Urs Liska
Hello community, I didn't find this in the manual: How can I translate \markup { \override #'(font-name . "XY") Test } in a markup function? I only found how to translate e.g. \markup \italic Test etc. to #:italic. Best Urs ___ lilypond-user mailing

The markup functions don't work with changed fonts

2006-12-27 Thread Frédéric Chiasson
Hello, Using : LilyPond 2.11.4, Mac OS X 10.4.8 I think I have found a bug. When using changed fonts with the function make-pango-font-tree, the functions \italic and \bold don't work anymore. What do you think? Frédéric The input code : \version "2.11.4" \paper{ #(define fonts (make-pan