Re: can the leading \markup command be eliminated in a new markup command?
Hi David, > Don't be too fast. I've created > […] > So you can replace the definition > > cue = > #(define-event-function (text) (markup?) > #{ ^\markup \bold #text #}) > > with > > cue = ^\markup \bold \etc YES! I tried that first (before my original post), and it didn’t work. Thank you so much for making it work. > It's a small amount of syntactic sugar but might come in handy. I have a very sweet tooth. =) Thanks! Kieren. Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Kieren MacMillan writes: > Hi David, > >> You either define an event function or a markup command. […] >> One is the markup, the other is a text script post event. Markups can >> be used in a variety of circumstances (as text scripts, as lyrics, as >> part of other markup, as tempo strings, as mark texts and so on). Text >> scripts can be used as text scripts. > > Since all I usually want/need in such situations are text scripts — > never to be [re]used in any other circumstances — I will go forward > under the impression that event functions suit my need just fine, and > adjust my function library accordingly. Don't be too fast. I've created Current branch: issue5291 Tracker issue: 5291 (https://sourceforge.net/p/testlilyissues/issues/5291/) Rietveld issue: 336670043 (https://codereview.appspot.com/336670043) Issue description: Allow event functions from partial functions or partial markups This gives event functions such as ^\tweak font-size 2^\markup \huge \etc Also contains commits: Allow event functions from partial markup commands This allows event functions such as ^\markup \huge #red \etc Add Syntax::create_script This generates post-events from generic Scheme expressions. So you can replace the definition %%% SNIPPET BEGINS \version "2.19.80" cue = #(define-event-function (text) (markup?) #{ ^\markup \bold #text #}) { c''\cue "This is the cue." } %%% SNIPPET ENDS with %%% SNIPPET BEGINS \version "2.21.0" cue = ^\markup \bold \etc { c''\cue "This is the cue." } %%% SNIPPET ENDS It's a small amount of syntactic sugar but might come in handy. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Hi David, > You either define an event function or a markup command. […] > One is the markup, the other is a text script post event. Markups can > be used in a variety of circumstances (as text scripts, as lyrics, as > part of other markup, as tempo strings, as mark texts and so on). Text > scripts can be used as text scripts. Since all I usually want/need in such situations are text scripts — never to be [re]used in any other circumstances — I will go forward under the impression that event functions suit my need just fine, and adjust my function library accordingly. Thanks again! Kieren. Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Kieren MacMillan writes: > Hi David, > >>> Is there any technical reason not to make *every* markup function work >>> like this? >> >> There are markup commands and event functions and they are in different >> name spaces. > > Sorry for pushing for more clarity/understanding, but: is it [in terms > of behaviour] that the event-function version of the function simply > provides a "wrapper" for the markup-function version (thus saving the > \markup, but doing nothing else), What? You either define an event function or a markup command. They aren't related. If you are feeling fancy, you can define a markup command and use it in the definition of an event function of the same name. But that's entirely up to the user. > or does either version have additional pros and/or cons (e.g., > more/less expensive, more/less prone to problems, etc.). One is the markup, the other is a text script post event. Markups can be used in a variety of circumstances (as text scripts, as lyrics, as part of other markup, as tempo strings, as mark texts and so on). Text scripts can be used as text scripts. >> We don't prescripe how people are going to use markups. > > That's probably a good thing! =) > > But since \cue is both clearer (more immediately obvious) and cleaner > (less typing) than \markup \cue, I'm trying to determine if there’s > any downside to modifying my entire library with > define-markup-function --> define-event-function (besides the > search-and-replace migration effort on legacy scores, obviously). It depends on whether you want a markup or some post event that is implemented using a text script. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Hi David, >> Is there any technical reason not to make *every* markup function work >> like this? > > There are markup commands and event functions and they are in different > name spaces. Sorry for pushing for more clarity/understanding, but: is it [in terms of behaviour] that the event-function version of the function simply provides a "wrapper" for the markup-function version (thus saving the \markup, but doing nothing else), or does either version have additional pros and/or cons (e.g., more/less expensive, more/less prone to problems, etc.). > We don't prescripe how people are going to use markups. That's probably a good thing! =) But since \cue is both clearer (more immediately obvious) and cleaner (less typing) than \markup \cue, I'm trying to determine if there’s any downside to modifying my entire library with define-markup-function --> define-event-function (besides the search-and-replace migration effort on legacy scores, obviously). Thanks again! Kieren. Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Kieren MacMillan writes: > Hi David, > >> %%% SNIPPET BEGINS >> \version "2.19.80" >> >> cue = >> #(define-event-function (text) (markup?) >> #{ ^\markup \bold #text #}) >> >> { c''\cue "This is the cue." } >> %%% SNIPPET ENDS >> >> If you don't want to bake the direction in, use - instead of ^ . > > Thanks for that! > > Is there any technical reason not to make *every* markup function work > like this? There are markup commands and event functions and they are in different name spaces. > It seems like a no-brainer to save the keystrokes every time… but it > may not be "blessed" for some reason I don’t know. We don't prescripe how people are going to use markups. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Hi David, > %%% SNIPPET BEGINS > \version "2.19.80" > > cue = > #(define-event-function (text) (markup?) > #{ ^\markup \bold #text #}) > > { c''\cue "This is the cue." } > %%% SNIPPET ENDS > > If you don't want to bake the direction in, use - instead of ^ . Thanks for that! Is there any technical reason not to make *every* markup function work like this? It seems like a no-brainer to save the keystrokes every time… but it may not be "blessed" for some reason I don’t know. Thanks, Kieren. Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: can the leading \markup command be eliminated in a new markup command?
Kieren MacMillan writes: > Hi all, > > Sorry if this is a silly question… but can this function be modified such > that the user can use > > { c''^\cue #"This is the cue." } > > instead of > > { c''^\markup \cue #"This is the cue." } > %%% SNIPPET BEGINS \version "2.19.80" cue = #(define-event-function (text) (markup?) #{ ^\markup \bold #text #}) { c''\cue "This is the cue." } %%% SNIPPET ENDS If you don't want to bake the direction in, use - instead of ^ . -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
can the leading \markup command be eliminated in a new markup command?
Hi all, Sorry if this is a silly question… but can this function be modified such that the user can use { c''^\cue #"This is the cue." } instead of { c''^\markup \cue #"This is the cue." } ?? Thanks, Kieren. %%% SNIPPET BEGINS \version "2.19.80" #(define-markup-command (cue layout props text) (markup?) (interpret-markup layout props (markup #:bold text))) { c''^\markup \cue #"This is the cue." } %%% SNIPPET ENDS Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user