Re: Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?

2023-08-07 Thread Lukas-Fabian Moser
Hi David, arpeggiateChord = # (define-music-function (chord) (ly:music?) Just a warning: inventing unconventional formattings like this (putting # on a different line as the opening paren) carries the danger of keeping convert-ly (and syntax highlighters and syntax-sensitive editors) from

Re: Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?

2023-08-05 Thread Valentin Petzel
Hi all, > The problem has two parts: 1) Generate a sensible voicing for a given > chord; 2) create the arpeggio. (Maybe you intended to do 1) manually > anyway?) some time ago I wrote a function for deriving chord voicings from fretboards for some SE question:

Re: Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?

2023-08-05 Thread David Kastrup
Lukas-Fabian Moser writes: > Hi Kevin, > >> But right now, >> there's nothing other than constructing it by hand each time, for >> every chord. I think something would be better than nothing. > The problem has two parts: 1) Generate a sensible voicing for a given > chord; 2) create the arpeggio.

Re: Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?

2023-08-05 Thread Lukas-Fabian Moser
Hi Kevin, But right now, there's nothing other than constructing it by hand each time, for every chord. I think something would be better than nothing. The problem has two parts: 1) Generate a sensible voicing for a given chord; 2) create the arpeggio. (Maybe you intended to do 1) manually

Re: Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?

2023-08-04 Thread Knute Snortum
Sounds kinda like something that articulate.ly might be trained to do with arpeggios. On Fri, Aug 4, 2023, 5:04 PM Kevin Cole wrote: > I know there's been previous endless discussion, but... > > While I'm sure it won't satisfy EVERYONE, I think it will be better > than nothing to have some

Is there a Scheme macro(?) to use fretboards to generate a generic guitar strum?

2023-08-04 Thread Kevin Cole
I know there's been previous endless discussion, but... While I'm sure it won't satisfy EVERYONE, I think it will be better than nothing to have some option for MIDI output to simulate a strum pattern. I don't know any Scheme, and I don't play a chorded instrument, so it's beyond me, but the

Re: How to define a macro that expands to a percussion "pitch"?

2023-01-28 Thread David Kastrup
Jean Abou Samra writes: >> Le 28 janv. 2023 à 08:01, Darren Ng a écrit : >> >> [subject] How to define a macro that expands to a percussion "pitch"? > > > It may be worth noting that LilyPond does not have macros, only > variables and regular

Re: How to define a macro that expands to a percussion "pitch"?

2023-01-28 Thread Jean Abou Samra
> Le 28 janv. 2023 à 08:01, Darren Ng a écrit : > > [subject] How to define a macro that expands to a percussion "pitch"? It may be worth noting that LilyPond does not have macros, only variables and regular functions. Call me pedantic, but I think it is helpful not t

Re: How to define a macro that expands to a percussion "pitch"?

2023-01-28 Thread Lukas-Fabian Moser
Hi Pierre-Luc, Am 28.01.23 um 14:02 schrieb Pierre-Luc Gauthier: m = \drummode { hh } Unfortunately not: This turns m into "music" including a duration. Hence, \m 8 will be interpreted as "first \m" (with its own pitch), then another one of duration 8. Compare: \version "2.24.0" m =

Re: How to define a macro that expands to a percussion "pitch"?

2023-01-28 Thread Pierre-Luc Gauthier
m = \drummode { hh } Le sam. 28 janv. 2023, à 02 h 01, Darren Ng a écrit : > > [subject] How to define a macro that expands to a percussion "pitch"? > > input is > > m = hh > \drummode { \m 8 \m r4 \m } > > expected output should be equivalent t

How to define a macro that expands to a percussion "pitch"?

2023-01-27 Thread Darren Ng
[subject] How to define a macro that expands to a percussion "pitch"? input is m = hh \drummode { \m 8 \m r4 \m } expected output should be equivalent to \drummode { hh8 hh8 r4 hh4 } actual output (console) percussion.ly:*:*: warning: Ignoring non-music

Re: How to make a macro of articulation marks?

2021-07-30 Thread Aaron Hill
On 2021-07-30 5:52 pm, H. S. Teoh wrote: I tried: midiEmph = \tag #'midi -\> a-.\midiEmph b-.\midiEmph c-.\midiEmph d-.\midiEmph but the accent appears to just get dropped silently. What am I doing wrong? Did you mean to use decrescendo (\>) or a long accent (>) within

How to make a macro of articulation marks?

2021-07-30 Thread H. S. Teoh
rinted score with \removeWithTag, but intact in the MIDI score. Obviously, this is a pain to type; is there a simple way to factor the repeated tags into a macro, so that I can e.g. type instead: a-.\midiEmph b-.\midiEmph c-.\midiEmph d-.\midiEmph ? I tried: midiEmph =

Re: macro for \once\override

2020-08-29 Thread Aaron Hill
On 2020-08-29 10:38 am, David Kastrup wrote: Aaron Hill writes: Is this pushing things too far? Well, essentially a similar problem. How do you figure out the difference between setting something to a context mod, and making a smart alist modification? I do not believe there are any

Re: macro for \once\override

2020-08-29 Thread David Kastrup
Aaron Hill writes: > On 2020-08-29 6:44 am, David Kastrup wrote: >> Hm. \with instead of = would even fit into the parser. But that >> leaves >> tweaks in the lurch. > > Not sure I am following. Are you indicating that something like... > > > \once \override LaissezVibrerTie.details >

Re: macro for \once\override

2020-08-29 Thread Aaron Hill
On 2020-08-29 6:44 am, David Kastrup wrote: Hm. \with instead of = would even fit into the parser. But that leaves tweaks in the lurch. Not sure I am following. Are you indicating that something like... \once \override LaissezVibrerTie.details \with { ratio = #0.5 height-limit

Re: macro for \once\override

2020-08-29 Thread Werner LEMBERG
> \propertyTweak finger-code #'below-string > FretBoard.fret-diagram-details > > is completely indistinguishable from > > \propertyTweak fret-diagram-details.finger-code #'below-string > FretBoard > > So any commands stacked before this last \propertyTweak command have > no way of knowing

Re: macro for \once\override

2020-08-29 Thread Aaron Hill
On 2020-08-29 6:37 am, David Kastrup wrote: Aaron Hill writes: On 2020-08-29 5:23 am, David Kastrup wrote: Wols Lists writes: On 29/08/20 05:45, Werner LEMBERG wrote: \once \override FretBoard.size = #'1.0 \once \override FretBoard.fret-diagram-details.barre-type = #'straight

Re: macro for \once\override

2020-08-29 Thread David Kastrup
Aaron Hill writes: > No need to rewrite anything. We can use \with to assist with this > pattern: > > > overrideII = > #(define-music-function > (prop mods) > (key-list? ly:context-mod?) > (define (assign? mod) (eq? 'assign (car mod))) > (define (proc mod) > (let ((subprop

Re: macro for \once\override

2020-08-29 Thread David Kastrup
Aaron Hill writes: > On 2020-08-29 5:23 am, David Kastrup wrote: >> Wols Lists writes: >> >>> On 29/08/20 05:45, Werner LEMBERG wrote: \once \override FretBoard.size = #'1.0 \once \override FretBoard.fret-diagram-details.barre-type = #'straight \once

Re: macro for \once\override

2020-08-29 Thread Aaron Hill
On 2020-08-29 5:23 am, David Kastrup wrote: Wols Lists writes: On 29/08/20 05:45, Werner LEMBERG wrote: \once \override FretBoard.size = #'1.0 \once \override FretBoard.fret-diagram-details.barre-type = #'straight \once \override FretBoard.fret-diagram-details.dot-color =

Re: macro for \once\override

2020-08-29 Thread Aaron Hill
On 2020-08-28 9:45 pm, Werner LEMBERG wrote: No. I'm against it. Introducing abbreviations into examples is a slippery slope and sets a bad precedent. In my scores I use \t for \tuplet, but I would never inflict that on any public example, even to save space. Wrapped lines are not a visual

Re: macro for \once\override

2020-08-29 Thread Aaron Hill
On 2020-08-29 3:19 am, Wols Lists wrote: On 29/08/20 05:45, Werner LEMBERG wrote: \once \override FretBoard.size = #'1.0 \once \override FretBoard.fret-diagram-details.barre-type = #'straight \once \override FretBoard.fret-diagram-details.dot-color = #'black \once

Re: macro for \once\override

2020-08-29 Thread David Kastrup
Wols Lists writes: > On 29/08/20 05:45, Werner LEMBERG wrote: >> \once \override FretBoard.size = #'1.0 >> \once \override FretBoard.fret-diagram-details.barre-type = #'straight >> \once \override FretBoard.fret-diagram-details.dot-color = #'black >> \once \override

Re: macro for \once\override

2020-08-29 Thread David Kastrup
Werner LEMBERG writes: >>> BTW, would it be possible to enhance `\propertyTweak` to write >>> >>> \propertyTweak fret-diagram-details.dot-color #'white >>> FretBoard >>> >>> as >>> >>> \propertyTweak dot-color #'white >>> FretBoard.fret-diagram-details

Re: macro for \once\override

2020-08-29 Thread Werner LEMBERG
>> BTW, would it be possible to enhance `\propertyTweak` to write >> >> \propertyTweak fret-diagram-details.dot-color #'white >> FretBoard >> >> as >> >> \propertyTweak dot-color #'white >> FretBoard.fret-diagram-details ? > > Have you even tried? Only

Re: macro for \once\override

2020-08-29 Thread Wols Lists
On 29/08/20 05:45, Werner LEMBERG wrote: > \once \override FretBoard.size = #'1.0 > \once \override FretBoard.fret-diagram-details.barre-type = #'straight > \once \override FretBoard.fret-diagram-details.dot-color = #'black > \once \override

Re: macro for \once\override

2020-08-29 Thread David Kastrup
Werner LEMBERG writes: >> Maybe >> >> \void \displayLilyMusic >> \once >> \propertyTweak color #red >> \propertyTweak font-size #3 >> \propertyTweak direction #UP Voice.Slur >> >> helps? > > It does, thanks a lot! I didn't have this function on my radar, and > it isn't documented in the NR at

Re: macro for \once\override

2020-08-28 Thread Werner LEMBERG
> Maybe > > \void \displayLilyMusic > \once > \propertyTweak color #red > \propertyTweak font-size #3 > \propertyTweak direction #UP Voice.Slur > > helps? It does, thanks a lot! I didn't have this function on my radar, and it isn't documented in the NR at all. Attached a version using

Re: macro for \once\override

2020-08-28 Thread Werner LEMBERG
> No. I'm against it. Introducing abbreviations into examples is a > slippery slope and sets a bad precedent. In my scores I use \t for > \tuplet, but I would never inflict that on any public example, even > to save space. Wrapped lines are not a visual or semantic issue to > me at least.

Re: macro for \once\override

2020-08-28 Thread antlists
On 28/08/2020 20:42, Werner LEMBERG wrote: Well, we have to make a compromise. The PDF document has a small line width, and you can't scroll horizontally... Theoretically, the snippet could be printed with a smaller font size, but this doesn't look very pretty IMHO. I consider the `\oo`

Re: macro for \once\override

2020-08-28 Thread Andrew Bernard
No. I'm against it. Introducing abbreviations into examples is a slippery slope and sets a bad precedent. In my scores I use \t for \tuplet, but I would never inflict that on any public example, even to save space. Wrapped lines are not a visual or semantic issue to me at least. Please don't

Re: macro for \once\override

2020-08-28 Thread David Kastrup
Werner LEMBERG writes: >>> Well, we have to make a compromise. The PDF document has a small >>> line width, and you can't scroll horizontally... >> >> Then you just have to wrap the line. > > I'm Mr. Wrap-Line, as can be seen by many of my commits. If I think > that wrapping is suboptimal and

Re: macro for \once\override

2020-08-28 Thread Werner LEMBERG
>> Well, we have to make a compromise. The PDF document has a small >> line width, and you can't scroll horizontally... > > Then you just have to wrap the line. I'm Mr. Wrap-Line, as can be seen by many of my commits. If I think that wrapping is suboptimal and reduces legibility I hope you

Re: macro for \once\override

2020-08-28 Thread Werner LEMBERG
>> Well, we have to make a compromise. The PDF document has a small line >> width, and you can't scroll horizontally... >> >> Theoretically, the snippet could be printed with a smaller font size, >> but this doesn't look very pretty IMHO. I consider the `\oo` >> shorthand both innocuous and

Re: macro for \once\override

2020-08-28 Thread David Kastrup
Werner LEMBERG writes: >>> However, saying >>> >>> \oo VeryLong.Grob.PropertyToBeChanged = foo >>> >>> for this (and only this) snippet is just fine. >> >> I don't think that it makes sense for snippets to introduce >> convenience shorthands unless the snippet in itself tries is about >>

Re: macro for \once\override

2020-08-28 Thread Carl Sorensen
On Fri, Aug 28, 2020 at 8:52 AM Werner LEMBERG wrote: > >> However, saying > >> > >> \oo VeryLong.Grob.PropertyToBeChanged = foo > >> > >> for this (and only this) snippet is just fine. > > > > I don't think that it makes sense for snippets to introduce > > convenience shorthands unless the

Re: macro for \once\override

2020-08-28 Thread Werner LEMBERG
>> However, saying >> >> \oo VeryLong.Grob.PropertyToBeChanged = foo >> >> for this (and only this) snippet is just fine. > > I don't think that it makes sense for snippets to introduce > convenience shorthands unless the snippet in itself tries is about > showcasing the shorthand. It detracts

Re: macro for \once\override

2020-08-28 Thread David Kastrup
Werner LEMBERG writes: >>> Because right now LSR is still using this version. >> >> Then that means we have to use that oo code in the NR? I am not sure >> I follow. I'd rather not please. > > Right now I'm checking the NR for bad typography in the PDF version, > which usually means overlong

Re: macro for \once\override

2020-08-28 Thread David Kastrup
Werner LEMBERG writes: >> oo = #(define-music-function (parser location prop value) >>(symbol-list? scheme?) >> #{ \once \override #prop = #value #}) >> >> should likely work fine in 2.18. > > Thanks! Aaron provided this version > > oo = #(define-music-function (parser

Re: macro for \once\override

2020-08-28 Thread Werner LEMBERG
>> Because right now LSR is still using this version. > > Then that means we have to use that oo code in the NR? I am not sure > I follow. I'd rather not please. Right now I'm checking the NR for bad typography in the PDF version, which usually means overlong lines. A lot of snippets are

Re: macro for \once\override

2020-08-28 Thread Andrew Bernard
Then that means we have to use that oo code in the NR? I am not sure I follow. I'd rather not please. Andrew On 28/08/2020 1:48 pm, Werner LEMBERG wrote: I side step the whole thing by having dynamic expanable macros in the text editor. But this gives overlong lines, which I want to avoid

Re: macro for \once\override

2020-08-27 Thread Werner LEMBERG
> oo = #(define-music-function (parser location prop value) >(symbol-list? scheme?) > #{ \once \override #prop = #value #}) > > should likely work fine in 2.18. Thanks! Aaron provided this version oo = #(define-music-function (parser location prop value) (list?

Re: macro for \once\override

2020-08-27 Thread Werner LEMBERG
> I side step the whole thing by having dynamic expanable macros in > the text editor. But this gives overlong lines, which I want to avoid for snippets taken from the LSR and being part of the NR. > And why use 2.18? Because right now LSR is still using this version. Werner

Re: macro for \once\override

2020-08-27 Thread Andrew Bernard
I side step the whole thing by having dynamic expanable macros in the text editor. And why use 2.18? Andrew On 28/08/2020 6:10 am, Werner LEMBERG wrote: Folks, I wonder whether there is a possibility to have a working equivalent to oo = \once\override so that I can say \oo

Re: macro for \once\override

2020-08-27 Thread David Kastrup
Werner LEMBERG writes: >>> I wonder whether there is a possibility to have a working equivalent >>> to >>> >>> oo = \once\override >>> >>> so that I can say >>> >>> \oo foo.bar = #'baz . >> >> The best you can aim for is >> >> \oo foo.bar #'baz > > This would be just fine. The thing is

Re: macro for \once\override

2020-08-27 Thread Werner LEMBERG
> Like this, I would imagine: > > > \version "2.18.2" > > oo = > #(define-music-function > (parser location grob-path value) > (list? scheme?) > #{ \once \override $grob-path = #value #}) Great, thanks! Werner

Re: macro for \once\override

2020-08-27 Thread Aaron Hill
On 2020-08-27 1:27 pm, David Kastrup wrote: Werner LEMBERG writes: Folks, I wonder whether there is a possibility to have a working equivalent to oo = \once\override so that I can say \oo foo.bar = #'baz . It should work with LilyPond 2.18, BTW. A quick search in the internet

Re: macro for \once\override

2020-08-27 Thread Werner LEMBERG
>> I wonder whether there is a possibility to have a working equivalent >> to >> >> oo = \once\override >> >> so that I can say >> >> \oo foo.bar = #'baz . > > The best you can aim for is > > \oo foo.bar #'baz This would be just fine. The thing is to replace `\once\override` with

Re: macro for \once\override

2020-08-27 Thread David Kastrup
Werner LEMBERG writes: > Folks, > > > I wonder whether there is a possibility to have a working equivalent > to > > oo = \once\override > > so that I can say > > \oo foo.bar = #'baz . > > It should work with LilyPond 2.18, BTW. > > A quick search in the internet didn't bring something

macro for \once\override

2020-08-27 Thread Werner LEMBERG
Folks, I wonder whether there is a possibility to have a working equivalent to oo = \once\override so that I can say \oo foo.bar = #'baz . It should work with LilyPond 2.18, BTW. A quick search in the internet didn't bring something relevant. Help would be much appreciated.

Re: Re: Macro with pitches as parameters

2019-11-14 Thread Mats Bengtsson
On 2019-11-14 12:46, Aaron Hill wrote: On 2019-11-14 1:02 am, David Menéndez Hurtado wrote: >> I am transcribing a piece that is filled with the rhythmic motif "8. 16 8" at different pitches. Being a LaTeX user, I want to write a macro like \myrithm{c a g}. I found t

Re: Macro with

2019-11-14 Thread David Kastrup
David Menéndez Hurtado writes: > On Thu, 14 Nov 2019 at 12:47, Aaron Hill wrote: > >> Secondly, there's a quirk in variable substitution syntax. You need to >> use the $var form, so the parser will see the ly:pitch? and ly:duration? >> tokens as indicating a single note. >> > > Ah, right. I

Applying a rhythmic pattern (was Re: Macro with)

2019-11-14 Thread Aaron Hill
I was inspired by David's post, as I have also encountered patterns in durations that I wish were less redundant to input. The snippet Malte linked to is rather complex, although I suspect it is significantly more air-tight at handling edge cases. Here is a simpler (i.e. "one-pager") music

Re: Macro with

2019-11-14 Thread Urs Liska
uot;8. 16 > 8" at different pitches. Being a LaTeX user, I want to write a macro > like \myrithm{c a g}. Maybe http://lsr.di.unimi.it/LSR/Item?id=465 or That seems to only allow the same note in the pattern. http://lsr.di.unimi.it/LSR/Item?id=654 is the right thing for you?

Re: Macro with

2019-11-14 Thread David Menéndez Hurtado
On Thu, 14 Nov 2019 at 12:47, Aaron Hill wrote: > Secondly, there's a quirk in variable substitution syntax. You need to > use the $var form, so the parser will see the ly:pitch? and ly:duration? > tokens as indicating a single note. > Ah, right. I understand now the manual means with "normal

Re: Macro with

2019-11-14 Thread Aaron Hill
On 2019-11-14 1:02 am, David Menéndez Hurtado wrote: This is what I managed to put together, but doesn't quite work. Anyone can suggest how to fix it? \version "2.19.83" \language "english" myrithm = #(define-music-function (parser location first second third) (first second third)

Re: Macro with

2019-11-14 Thread David Menéndez Hurtado
On Thu, 14 Nov 2019 at 10:05, Malte Meyn wrote: > Am 14.11.19 um 10:02 schrieb David Menéndez Hurtado: > > I am transcribing a piece that is filled with the rhythmic motif "8. 16 > > 8" at different pitches. Being a LaTeX user, I want to write a macro > > like

Re: Macro with

2019-11-14 Thread Malte Meyn
Am 14.11.19 um 10:02 schrieb David Menéndez Hurtado: I am transcribing a piece that is filled with the rhythmic motif "8. 16 8" at different pitches. Being a LaTeX user, I want to write a macro like \myrithm{c a g}. Maybe http://lsr.di.unimi.it/LSR/Item?id=465 or http://lsr.d

Macro with

2019-11-14 Thread David Menéndez Hurtado
I am transcribing a piece that is filled with the rhythmic motif "8. 16 8" at different pitches. Being a LaTeX user, I want to write a macro like \myrithm{c a g}. I found the documentation for Scheme functions, and how to edit whole music sections, but nothing on how to insert a fi

Re: Create a macro for doubling the note in an arpeggio pattern

2019-02-25 Thread elmeri
e the first note of > the 6-note group of 16th notes is doubled as a dotted 4th note. Having a > macro/function to turn e.g. the pattern "f16 c a f c f,” into “<< { f4. } \\ > { f16 c a f c f, } >>”, or even more preferably “<< { f4. } \\ { f16([ c a f > c

Re: Create a macro for doubling the note in an arpeggio pattern

2019-02-22 Thread Lukas-Fabian Moser
I’m working on a score that has a lot of arpeggios where the first note of the 6-note group of 16th notes is doubled as a dotted 4th note. Having a macro/function to turn e.g. the pattern "f16 c a f c f,” into “<< { f4. } \\ { f16 c a f c f, } >>”, or even more pr

Create a macro for doubling the note in an arpeggio pattern

2019-02-22 Thread elmeri
Hi, I’m working on a score that has a lot of arpeggios where the first note of the 6-note group of 16th notes is doubled as a dotted 4th note. Having a macro/function to turn e.g. the pattern "f16 c a f c f,” into “<< { f4. } \\ { f16 c a f c f, } >>”, or even more pr

Re: Scratching my head around define-macro and variable evaluation

2018-03-28 Thread Stefano Troncaro
. Simplified example: > \version "2.19.80" > #(define-macro (custom-let alist . body) >`(let ,(map (lambda(pair) (list (car pair) (cdr pair))) alist) > . ,body)) > > #(custom-let ((my-key . "my-val") (another-key . "another-val")) >(

Re: Scratching my head around define-macro and variable evaluation

2018-03-28 Thread David Kastrup
Stefano Troncaro <stefanotronc...@gmail.com> writes: > Hi everyone! > > I have a question about the following example: > >> \version "2.19.80" >> #(define-macro (why-the-difference obj) >>(display (format "~a , " obj)) >>`(dis

Scratching my head around define-macro and variable evaluation

2018-03-28 Thread Stefano Troncaro
Hi everyone! I have a question about the following example: > \version "2.19.80" > #(define-macro (why-the-difference obj) >(display (format "~a , " obj)) >`(display (format "~a\n" ,obj))) > > #(why-the-difference (list 1 2 3))% =>

Re: macro variable doesn't behave same as original?

2017-11-14 Thread David Kastrup
Patrick Smith writes: > I can wait for 2.21.0. > > I'll continuing coding with the assumption that the macrovariable will > indeed be a one-for-one, text in-place, copy of the original. > > On Tue, Nov 14, 2017 at 7:44 AM, David Kastrup wrote: > >> Caagr98

Re: macro variable doesn't behave same as original?

2017-11-14 Thread Patrick Smith
I can wait for 2.21.0. I'll continuing coding with the assumption that the macrovariable will indeed be a one-for-one, text in-place, copy of the original. On Tue, Nov 14, 2017 at 7:44 AM, David Kastrup wrote: > Caagr98 writes: > > >> On 11/14/17 13:21,

Re: macro variable doesn't behave same as original?

2017-11-14 Thread David Kastrup
Caagr98 writes: >> On 11/14/17 13:21, Patrick Smith wrote: >>> This works: >>> >>> \version "2.18.2" >>> \relative c' { >>>   \time 2/4 >>>   c4 c( d) d( e) e( f) f( g) g( a) a( b) b( c) c( b) b( a) a( g) g( >>> f) f( e) e( d) d( c2)~ c2 \fermata  \bar "|." >>>   layout{} >>>

Re: macro variable doesn't behave same as original?

2017-11-14 Thread Caagr98
In the first version, you're applying the \fermata post-event to the c2, which is perfectly valid. In the second one, you're applying it to the {...}, which doesn't make sense. I'm afraid I don't know any good solution, though. On 11/14/17 13:21, Patrick Smith wrote: > This works: > > \version

macro variable doesn't behave same as original?

2017-11-14 Thread Patrick Smith
This works: \version "2.18.2" \relative c' { \time 2/4 c4 c( d) d( e) e( f) f( g) g( a) a( b) b( c) c( b) b( a) a( g) g( f) f( e) e( d) d( c2)~ c2 \fermata \bar "|." layout{} } This doesn't work: \version "2.18.2" macrovariable = {c4 c( d) d( e) e( f) f( g) g( a) a( b) b( c) c( b) b( a)

Re: Curve in a macro?

2017-09-16 Thread David Kastrup
M Sun <chris.cors...@gmail.com> writes: > Hi list, > > If I have a note and a curve like this: > > b8-\tweak control-points #'((0.5 . 4) (1 . 6) (2 . 6) (2.5 . 4)) ( <> ) > > How can I make the curve into a macro, so that I can write "b8 \curve"

Re: Curve in a macro?

2017-09-16 Thread Kieren MacMillan
Hi, > I'm quite puzzled by the > fact that the closing cannot be in the macro… I'm sure it can be — for example (but not recommended): \version "2.19.65" curve = #(define-music-function (parser location curved) (ly:music?) #{ \once \override Slur.control-points =

Re: Curve in a macro?

2017-09-15 Thread M Sun
Hi Kieren, Thanks for the reply. It works. One thing about this implementation is I'll need to remember to close the slur, while logically the closing should also be part of the macro. I'm quite puzzled by the fact that the closing cannot be in the macro… But anyway, if this is a limitation

Re: Curve in a macro?

2017-09-15 Thread Kieren MacMillan
Hi, > If I have a note and a curve like this: > b8-\tweak control-points #'((0.5 . 4) (1 . 6) (2 . 6) (2.5 . 4)) ( <> ) > How can I make the curve into a macro, so that I can write "b8 \curve" > or "\curve b8"? \version "2.19.65" curve = -\tweak

Curve in a macro?

2017-09-15 Thread M Sun
Hi list, If I have a note and a curve like this: b8-\tweak control-points #'((0.5 . 4) (1 . 6) (2 . 6) (2.5 . 4)) ( <> ) How can I make the curve into a macro, so that I can write "b8 \curve" or "\curve b8"? -- Fear is the path to the dark side. Fear lead

Re: elementary macro problem

2017-07-21 Thread David Griffel
Thank you, David and Simon, I see there's no straightforward solution, so I'll stick with the standard syntax. best wishes, David G On Fri, Jul 21, 2017 at 6:54 PM, Simon Albrecht wrote: > On 21.07.2017 16:22, David Griffel wrote: > >> I just want a short abbreviation

Re: elementary macro problem

2017-07-21 Thread David Kastrup
caag...@gmail.com writes: >> On 07/21/2017 04:36 PM, David Kastrup wrote: >>> Basically, to give \repeat the kind of pliability that music functions >>> enjoy, one would need to come up with different syntax/semantics for >>> alternatives. > > How about \repeat volta 2 { c1 d1 e1 \alternative

Re: elementary macro problem

2017-07-21 Thread Simon Albrecht
On 21.07.2017 16:22, David Griffel wrote: I just want a short abbreviation of \repeat unfold I can understand that wish, but if I may give some advice from experience: even if it’s partially possible, it’s generally better to not abbreviate and stay with standard syntax. It’s easier to

Re: elementary macro problem

2017-07-21 Thread caagr98
How about \repeat volta 2 { c1 d1 e1 \alternative {{d1} {f1}} }? IMO, that makes more sense both syntactically and semantically - the way I see it, that example is four measures repeated, with the last measure being different. With the current syntax, it's three measures repeated, and... wtf

Re: elementary macro problem

2017-07-21 Thread David Kastrup
David Griffel writes: > I'm a fairly inexpert lilypond user. I've used simple macros before, but > this one fails: > > thrice = \repeat unfold 3 Because there isn't a complete music expression following. > it produces an error message: error: unknown escaped string:

Re: elementary macro problem

2017-07-21 Thread caagr98
If you're using 2.19, you might be able to use `thrice = \repeat unfold 3 \etc`. Otherwise, you'll have to use the explicit version. On 07/21/2017 04:22 PM, David Griffel wrote: I'm a fairly inexpert lilypond user. I've used simple macros before, but this one fails: thrice = \repeat unfold 3

elementary macro problem

2017-07-21 Thread David Griffel
I'm a fairly inexpert lilypond user. I've used simple macros before, but this one fails: thrice = \repeat unfold 3 it produces an error message: error: unknown escaped string: `\thrice' Minimal example: thrice = \repeat unfold 3 {\thrice {a b } } The same thing happens if I drop

Re: function/macro for "on the fly" dynamics+text

2017-03-05 Thread Kieren MacMillan
Hi Malte (et al.), > Do you know the \dynamic function from openlilylib? I didn’t! Thanks (to all) for the reference — and to Janek for the function. It looks like it does much of the work I want done. There are some improvements I’ll have to make — and return to OLL, of course — primarily the

Re: function/macro for "on the fly" dynamics+text

2017-03-04 Thread Malte Meyn
Am 04.03.2017 um 22:59 schrieb Kieren MacMillan: > Many scores use dynamics like “pp sub.” or “f dolce” etc. In order to build > such a grob as a DynamicText, I use the following: > […] > 1. I have to define a macro for every single combination in every score. For > ppSub and

Re: function/macro for "on the fly" dynamics+text

2017-03-04 Thread Noeck
Hi Kieren, do you know this? https://github.com/openlilylib/snippets/tree/master/input-shorthands/easy-custom-dynamics I liked the idea of this function very much ever since I heard of it by Janek. As I did not use it much, though. Does it address some of your issues? Probably not all. I guess

function/macro for "on the fly" dynamics+text

2017-03-04 Thread Kieren MacMillan
(markup #:concat ( dynamic #:hspace 1 #:normal-text #:italic string ppSub = -\tweak self-alignment-X #-0.75 #(make-dynamic-extra "pp" "sub.") { c''4\ppSub d'' e'' f'’ } This has several problems: 1. I have to define a macro for eve

Re: Putting a \layout block in a Scheme macro

2017-01-27 Thread Timothy Lanfear
On 27/01/17 19:20, Jérôme Plût wrote: Thanks for the answer, but: your code produces a failed assertion in the lilypond binary: lilypond: /home/gub/NewGub/gub/target/linux-x86/src/lilypond-git.sv.gnu.org--lilypond.git-release-unstable/lily/book.cc:258: void Book::process_score(SCM,

Re: Putting a \layout block in a Scheme macro

2017-01-27 Thread Jérôme Plût
> \version "2.19.54" > > BlankStaff = > #(define-void-function (count) (integer?) > (let* ((blankstaff #{ \score { { s1 \break } } #} ) > (layout #{ \layout { \context { \Staff \remove "Bar_engraver" } > } #} ) > (bookpart (ly:make-book-part (make-list count

Re: Putting a \layout block in a Scheme macro

2017-01-22 Thread Timothy Lanfear
On 22/01/17 20:12, Thomas Morley wrote: P.S. The actual topic of this thread, \layout in scheme, is not answered. Though, I doubt you still need it. If I'm wrong, please shout and I'll have a second thought If you do feel the need to process layouts in Scheme, this may point you in the right

Re: Putting a \layout block in a Scheme macro

2017-01-22 Thread Thomas Morley
2017-01-22 19:30 GMT+01:00 Jérôme Plût <plut.jer...@gmail.com>: > > I want to make a Scheme macro \BlankStaff that outputs a single white > staff. (Optionnally, \BlankStaff #3 would output three of them, etc. > In particular, using “\include "blank-staff.ly"” is a non-s

Putting a \layout block in a Scheme macro

2017-01-22 Thread Jérôme Plût
I want to make a Scheme macro \BlankStaff that outputs a single white staff. (Optionnally, \BlankStaff #3 would output three of them, etc. In particular, using “\include "blank-staff.ly"” is a non-solution). A snippet does the white staff: http://lilypond.org/doc/v2.19/Documentatio

Macro or abbreviation

2015-08-09 Thread Andrew Bernard
not a matter of changing the accidental style in use, dodecaphonic. I need to turn off selected accidentals in the dodecaphonic style when I join notes using a custom grace note slur function I have, that does not behave the same way as ‘proper’ slurs do.] Is there a way to make this into a macro

Re: Macro or abbreviation

2015-08-09 Thread Thomas Morley
way as ‘proper’ slurs do.] Is there a way to make this into a macro, or abbreviate it in some way? I am not referring to making a keystroke macro in Frescobaldi, but a language level shorter form, for convenience. I hope this question does not trigger a torrent of comments saying this is a Bad

Re: Macro or abbreviation

2015-08-09 Thread Jacques Menu
, that does not behave the same way as ‘proper’ slurs do.] Is there a way to make this into a macro, or abbreviate it in some way? I am not referring to making a keystroke macro in Frescobaldi, but a language level shorter form, for convenience. I hope this question does not trigger a torrent

Re: Macro or abbreviation

2015-08-09 Thread Andrew Bernard
Dear Thomas, This is absolutely precisely what I have been looking for. So it was not entirely a stupid question of mine after all! Many sincere thanks to David Kastrup for his continuing supreme efforts in lilypond development. Andrew On 9 August 2015 at 19:20:24, Thomas Morley

Re: Macro or abbreviation

2015-08-09 Thread David Kastrup
Andrew Bernard andrew.bern...@gmail.com writes: Hello Ponderers, It seems the topic of macros and abbreviations in lilypond source comes up from time to time and engenders all sorts of complex debate, so I am slightly wary of asking this question. I need to say: \tweak Accidental.stencil

Temporary change to macro definition

2015-08-04 Thread Jérôme Plût
In the attached file, I made a macro \count such that a^\count a^\count a^\count is understood as a^1 a^2 a^3... I also wrote a macro \repeatWithCount such that \repeatWithCount 3 { a^\acount } also evaluates to a^1 a^2 a^3. However, (for aesthetic reasons!) I would prefer to use \count in both

Re: \relative versus \absolute (was Re: Macro/multiply notes)

2014-07-25 Thread David Nalesnik
On Sat, Jun 14, 2014 at 1:43 PM, Knute Snortum ksnor...@gmail.com wrote: I am still a novice at using LilyPond (maybe a sophomore) but I'd like to make one case for relative notes. I'm typesetting a piece where there are a lot of octave scale runs between both hands. It's very nice to be

Re: \relative versus \absolute (was Re: Macro/multiply notes)

2014-07-25 Thread David Kastrup
when I want to procrastinate tackling a difficult spot but still want to keep working. Well, there is always \resetRelativeOctave, and after getting the octaves wrong, at most one note needs changing to get back into synch anyway. While the make-relative macro can help a lot, designing music

  1   2   3   >