Multiple exercises on a single line

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multiple exercises on a single line

Gianmaria Lari
I would like to write short exercises of one measure consecutively on the same line. Something similar to what I attached. How I can do it?

Thank you, g.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Capture.PNG (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple exercises on a single line

Malte Meyn-3


Am 07.06.2017 um 08:31 schrieb Gianmaria Lari:
> I would like to write short exercises of one measure consecutively on the
> same line. Something similar to what I attached. How I can do it?

How about this? You can put \scores in \markups and use things like
\column, \fill-line, \table. The indent changes the spacing between
instrument name (= exercise number) and staff. Everything else should be
self-explaining.

\version "2.19.56"

\paper {
   indent = 0.8\cm
}

\markup \fill-line {
   \score {
     \relative {
       \set Staff.instrumentName = "1."
       \clef bass
       \time 3/4
       c,4 e g
     }
   }
   \score {
     \relative {
       \set Staff.instrumentName = "2."
       \clef bass
       \numericTimeSignature
       c,4 e e c
     }
   }
   \score {
     \relative {
       \set Staff.instrumentName = "3."
       \clef bass
       \numericTimeSignature
       c,8_3 d_2 e--_3 f_4 g_2 f_4 e--_3 d_2
     }
   }
}

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple exercises on a single line

David Kastrup
In reply to this post by Gianmaria Lari
Gianmaria Lari <[hidden email]> writes:

> I would like to write short exercises of one measure consecutively on the
> same line. Something similar to what I attached. How I can do it?

You could try something along the following lines:


exercises =
#(define-scheme-function (cm seq)
  (ly:context-mod? ly:music?)
  (let ((elts (ly:music-property seq 'elements)))
   #{ \markuplist \wordwrap-lines {
   #@(map (lambda (m n)
           #{
             \markup \score {
               \new Staff \with {
                 #cm
                 instrumentName = #(format "~d." n)
                 \override InstrumentName.self-alignment-X = #RIGHT
               }
               { #m }
               \layout {
                     indent = 24\pt
               } } #})
     elts (iota (length elts) 1)) } #}))

\exercises \with { \clef bass
                   \override TimeSignature.style = #'numbered }
{
  { \time 3/4 c,4 e, g, }
  { \time 4/4 c,4 e, e, c, }
  { \time 4/4 c,8-3 d,-2 e,-3-- f,-4 g,-2 f,-4 e,-3-- d,-2 }
}



--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple exercises on a single line

Jacques Menu Muzhic
Now that’s great, thanks David!

JM

> Le 7 juin 2017 à 09:15, David Kastrup <[hidden email]> a écrit :
>
> Gianmaria Lari <[hidden email]> writes:
>
>> I would like to write short exercises of one measure consecutively on the
>> same line. Something similar to what I attached. How I can do it?
>
> You could try something along the following lines:
>
> exercises =
> #(define-scheme-function (cm seq)
>  (ly:context-mod? ly:music?)
>  (let ((elts (ly:music-property seq 'elements)))
>   #{ \markuplist \wordwrap-lines {
>   #@(map (lambda (m n)
>   #{
>     \markup \score {
>       \new Staff \with {
>         #cm
>         instrumentName = #(format "~d." n)
>         \override InstrumentName.self-alignment-X = #RIGHT
>       }
>       { #m }
>       \layout {
>     indent = 24\pt
>       } } #})
>     elts (iota (length elts) 1)) } #}))
>
> \exercises \with { \clef bass
>   \override TimeSignature.style = #'numbered }
> {
>  { \time 3/4 c,4 e, g, }
>  { \time 4/4 c,4 e, e, c, }
>  { \time 4/4 c,8-3 d,-2 e,-3-- f,-4 g,-2 f,-4 e,-3-- d,-2 }
> }
>
>
> --
> David Kastrup
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple exercises on a single line

Gianmaria Lari
In reply to this post by David Kastrup
Thanks David and Malte

they both work perfectly for me!

I'm sure they will be useful also to other.

g.

On 7 June 2017 at 09:15, David Kastrup <[hidden email]> wrote:
Gianmaria Lari <[hidden email]> writes:

> I would like to write short exercises of one measure consecutively on the
> same line. Something similar to what I attached. How I can do it?

You could try something along the following lines:




--
David Kastrup



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Loading...