Re: Further scheme help, please

2016-05-30 Thread Andrew Bernard
Hi Simon,

It’s just the unquote-splicing operator in lilypondish.

https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Expression-Syntax.html#index-quasiquote-2199

Andrew


On 31 May 2016 at 2:37:33 AM, Simon Albrecht wrote:


On 30.05.2016 16:18, David Kastrup wrote:
> $@(make-list n #{ \lyricmode { _ } #})

David, could you give a hint as to what the @ does here, or where it’s
documented? Obviously it’s not the use which is documented with Guile
1.8
(<
http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Using-Guile-Modules.html#index-g_t_0040_0040-2357>).
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread Simon Albrecht

On 30.05.2016 18:41, David Kastrup wrote:

On 30.05.2016 16:18, David Kastrup wrote:

$@(make-list n #{ \lyricmode { _ } #})


David, could you give a hint as to what the @ does here, or where it’s
documented? Obviously it’s not the use which is documented with Guile
1.8
().

Try LilyPond.




Thanks,
Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread David Kastrup
Simon Albrecht  writes:

> On 30.05.2016 17:23, Phil Holmes wrote:
>> I obviously need to do more potato peeling.
>
> Words of wisdom :-)
>
>
> On 30.05.2016 16:18, David Kastrup wrote:
>> $@(make-list n #{ \lyricmode { _ } #})
>
> David, could you give a hint as to what the @ does here, or where it’s
> documented? Obviously it’s not the use which is documented with Guile
> 1.8
> ().

Try LilyPond.



   A further convenience can be the ‘list splicing’ operators ‘$@’ and
‘#@’ for inserting the elements of a list in the surrounding context.
Using those, the last part of the example could have been written as

 …
 { #@newLa }

   Here, every element of the list stored in ‘newLa’ is taken in
sequence and inserted into the list, as if we had written

 { #(first newLa) #(second newLa) }


-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread Simon Albrecht

On 30.05.2016 17:23, Phil Holmes wrote:

I obviously need to do more potato peeling.


Words of wisdom :-)


On 30.05.2016 16:18, David Kastrup wrote:

$@(make-list n #{ \lyricmode { _ } #})


David, could you give a hint as to what the @ does here, or where it’s 
documented? Obviously it’s not the use which is documented with Guile 
1.8 
().


Best,
Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread Phil Holmes
- Original Message - 
From: "David Kastrup" <d...@gnu.org>

To: "Phil Holmes" <m...@philholmes.net>
Cc: <lilypond-user@gnu.org>
Sent: Monday, May 30, 2016 4:19 PM
Subject: Re: Further scheme help, please



"Phil Holmes" <m...@philholmes.net> writes:


Thanks David.  This is what I have:

LyRep =
#(define-music-function (n) (number?)
 #{
   \once \override Lyrics.LyricText.Y-extent = #'(-10 . 10) % stops
collisions with stems
   \set Lyrics.lyricMelismaAlignment = #CENTER % keeps the symbol centred
   \markup { \raise #1 % shifts it up
 { \draw-circle #0.1 #0.1 ##t % draw the first circle
 \raise #1 { \draw-line #'( 0 . -2 ) } % draw first line
 \raise #1 { \draw-line #'( 0 . -2 ) } % draw second line
 \draw-circle #0.1 #0.1 ##t } % draw final circle
   }
   $@(make-list n #{ \lyricmode { _ } #})
   \unset lyricMelismaAlignment
 #})

When I run it, I get the output I want, but with the following error
in the log file:

Definitions.ly:111:5: error: markup outside of text script or \lyricmode

   \markup { \raise #1 % shifts it up

LyricTest.ly:27:21: error: error in #{ ... #}

   \LyRep #4

Any idea why?


Oops.  I overlooked the \markup being lyrics already.  So you probably
need to put a \lyricmode { ... } around it as well.

--
David Kastrup



Thanks again.  As it turns out I'd just finished one verse and had gone off 
to cook dinner.  As I started on the spuds I wondered whether putting 
lyricmode around the markup would work (I had tried other things).  Got back 
to the PC and your suggestion was above.  I put that in and the error 
disappears.  I obviously need to do more potato peeling.


--
Phil Holmes 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread David Kastrup
"Phil Holmes"  writes:

> Thanks David.  This is what I have:
>
> LyRep =
> #(define-music-function (n) (number?)
>  #{
>\once \override Lyrics.LyricText.Y-extent = #'(-10 . 10) % stops
> collisions with stems
>\set Lyrics.lyricMelismaAlignment = #CENTER % keeps the symbol centred
>\markup { \raise #1 % shifts it up
>  { \draw-circle #0.1 #0.1 ##t % draw the first circle
>  \raise #1 { \draw-line #'( 0 . -2 ) } % draw first line
>  \raise #1 { \draw-line #'( 0 . -2 ) } % draw second line
>  \draw-circle #0.1 #0.1 ##t } % draw final circle
>}
>$@(make-list n #{ \lyricmode { _ } #})
>\unset lyricMelismaAlignment
>  #})
>
> When I run it, I get the output I want, but with the following error
> in the log file:
>
> Definitions.ly:111:5: error: markup outside of text script or \lyricmode
>
>\markup { \raise #1 % shifts it up
>
> LyricTest.ly:27:21: error: error in #{ ... #}
>
>\LyRep #4
>
> Any idea why?

Oops.  I overlooked the \markup being lyrics already.  So you probably
need to put a \lyricmode { ... } around it as well.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread Phil Holmes
- Original Message - 
From: "David Kastrup" <d...@gnu.org>

To: "Phil Holmes" <m...@philholmes.net>
Cc: <lilypond-user@gnu.org>
Sent: Monday, May 30, 2016 3:18 PM
Subject: Re: Further scheme help, please



Phil Holmes <m...@philholmes.net> writes:

Assuming 2.19.not-too-old:

LyRep =
#(define-music-function (n) (number?)
  #{ all of the above up to the underlines
 $@(make-list n #{ \lyricmode { _ } #})
 \unset lyricMelismaAlignment
  #})

For 2.18, you'll need the typical parser location rap before n.

--
David Kastrup



Thanks David.  This is what I have:

LyRep =
#(define-music-function (n) (number?)
 #{
   \once \override Lyrics.LyricText.Y-extent = #'(-10 . 10) % stops 
collisions with stems

   \set Lyrics.lyricMelismaAlignment = #CENTER % keeps the symbol centred
   \markup { \raise #1 % shifts it up
 { \draw-circle #0.1 #0.1 ##t % draw the first circle
 \raise #1 { \draw-line #'( 0 . -2 ) } % draw first line
 \raise #1 { \draw-line #'( 0 . -2 ) } % draw second line
 \draw-circle #0.1 #0.1 ##t } % draw final circle
   }
   $@(make-list n #{ \lyricmode { _ } #})
   \unset lyricMelismaAlignment
 #})

When I run it, I get the output I want, but with the following error in the 
log file:


Definitions.ly:111:5: error: markup outside of text script or \lyricmode

   \markup { \raise #1 % shifts it up

LyricTest.ly:27:21: error: error in #{ ... #}

   \LyRep #4

Any idea why?

--
Phil Holmes 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Further scheme help, please

2016-05-30 Thread David Kastrup
Phil Holmes  writes:

> I have some boiler-plate markup that I use in 16C music to show the lyric 
> repeat sign they use: a small circle, 2 lines and another circle.  This is 
> what I use, split into separate lines and commented:
>
> \once \override Lyrics.LyricText.Y-extent = #'(-10 . 10) % stops 
> collisions with stems
> \set lyricMelismaAlignment = #CENTER % keeps the symbol centred
> \markup { \raise #1 % shifts it up
> { \draw-circle #0.1 #0.1 ##t % draw the first circle
> \raise #1 { \draw-line #'( 0 . -2 ) } % draw first line
> \raise #1 { \draw-line #'( 0 . -2 ) } % draw second line
> \draw-circle #0.1 #0.1 ##t } } % draw final circle
> _ _ _ _ _  % one underscore for each note in the lyric repeat 
> \unset lyricMelismaAlignment % reset alignment
>
> I was hoping to replace this with a function to make the copying and 
> pasting less of a problem.  Ideally, I would have something like:
>
> lyr = \lyricmode { Word \LyRep #5 next word }
>
> And the LyRep command would use the commands above to draw the repeat sign 
> and add 5 skips.  Problem is, I can't currently get close to making this 
> work.  I can draw the symbol with a define-markup-command, but don't know 
> how to deal with the skips.
>
> Help appreciated.

Assuming 2.19.not-too-old:

LyRep =
#(define-music-function (n) (number?)
   #{ all of the above up to the underlines
  $@(make-list n #{ \lyricmode { _ } #})
  \unset lyricMelismaAlignment
   #})

For 2.18, you'll need the typical parser location rap before n.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Further scheme help, please

2016-05-30 Thread Phil Holmes
I have some boiler-plate markup that I use in 16C music to show the lyric 
repeat sign they use: a small circle, 2 lines and another circle.  This is 
what I use, split into separate lines and commented:

\once \override Lyrics.LyricText.Y-extent = #'(-10 . 10) % stops 
collisions with stems
\set lyricMelismaAlignment = #CENTER % keeps the symbol centred
\markup { \raise #1 % shifts it up
{ \draw-circle #0.1 #0.1 ##t % draw the first circle
\raise #1 { \draw-line #'( 0 . -2 ) } % draw first line
\raise #1 { \draw-line #'( 0 . -2 ) } % draw second line
\draw-circle #0.1 #0.1 ##t } } % draw final circle
_ _ _ _ _  % one underscore for each note in the lyric repeat 
\unset lyricMelismaAlignment % reset alignment

I was hoping to replace this with a function to make the copying and 
pasting less of a problem.  Ideally, I would have something like:

lyr = \lyricmode { Word \LyRep #5 next word }

And the LyRep command would use the commands above to draw the repeat sign 
and add 5 skips.  Problem is, I can't currently get close to making this 
work.  I can draw the symbol with a define-markup-command, but don't know 
how to deal with the skips.

Help appreciated.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user