lilypond-user-fr
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fonction : insérer un bloc Score dans un markup


From: Remy CLAVERIE
Subject: Re: Fonction : insérer un bloc Score dans un markup
Date: Sun, 6 Sep 2020 11:15:58 +0200 (CEST)

Bonjour Jean-Abou,

 

encore merci pour ta proposition, mais elle ne foncitonne pas chez moi (2.18.2). Voici mon code :

 

\version "2.18.2"
\include "italiano.ly"

#(define-markup-command (insertMusic layout props theMusic) (ly:music?)
   "insert a mini score inside a markup "
   (interpret-markup layout props
     #{
       \markup
       \score {
         \new Staff \with {
           \remove Time_signature_engraver
           fontSize = -4
           \override StaffSymbol . staff-space = #(magstep -4)
           \override StaffSymbol . thickness = #(magstep -4)
         }
         \relative do {
           #theMusic
         }
         \layout {
           indent = 0\cm
           ragged-last = ##t
         }
       }
     #}))


\markup \insertMusic {
  \clef treble
  \relative do { do3 re mi fa sol la si do}
}

 

Une idée ?

Merci pour tout,

 

Bonne journée,

 

Rémy

 

 

 

> Message du 06/09/20 10:10
> De : "Jean Abou Samra" <jean@abou-samra.fr>
> A : "Remy CLAVERIE" <remy.claverie@orange.fr>, "Mialing list Lilypond" <lilypond-user-fr@gnu.org>
> Copie à :
> Objet : Re: Fonction : insérer un bloc Score dans un markup
>
> Le 06/09/2020 à 08:48, Remy CLAVERIE a écrit :
>
> > Bonjour à tous,
> >
> > Régulièrement pour des notes éditoriales, j'utilise des extraits de
> > musiques que s'insère dans un markup. Je me suis servi de la solution
> > décrite ici :
> > https://lists.gnu.org/archive/html/lilypond-user/2013-12/msg01239.html
> >
> > Par exemple :
> >
> > \score {
> >         \new Staff \with {
> >           \remove "Time_signature_engraver"
> >           fontSize = #-4
> >           \override StaffSymbol #'staff-space = #(magstep -4)
> >           \override StaffSymbol #'thickness = #(magstep -4)
> >         }
> >         \relative do {
> >           \time 2/1
> >           \clef "G_8"
> >           \bar"|"
> >           mi2. fad4 sold la si mi,
> >         }
> >         \layout {
> >           indent = 0\cm
> >           ragged-last = ##t
> >         }
> >       }
> >
> > Afin de minimiser le code, j'aimerai définir une comande ou une
> > fonction. Je pensais utiliser quelque chose comme :
> >
> > #(define-markup-command (insertMusic layout props theMusic) (markup?)
> >    "mini score inside a markup "
> >    (interpret-markup layout props
> >      #{
> >        \markup
> >        \score {
> >          \new Staff \with {
> >            \remove "Time_signature_engraver"
> >            fontSize = #-4
> >            \override StaffSymbol #'staff-space = #(magstep -4)
> >            \override StaffSymbol #'thickness = #(magstep -4)
> >          }
> >          \relative do {
> >            #theMusic
> >          }
> >          \layout {
> >            indent = 0\cm
> >            ragged-last = ##t
> >          }
> >        }
> >      #}))
> >
> > Cela ne marche pas. Certainement car il faut un objet 'music' et non
> > 'markup' pour theMusic.
> >
> > Mais je ne sais pas comment faire, et je n'ai pas trouvé dans les
> > mailing-lists.
> >
> > L'un de vous pourrait-il me dire si c'est possible et me donner un lien ?
> >
> > Merci de votre aide,
> >
> > Bon dimacnhe,
> >
> > Rémy
> >
> Bonjour,
>
> En effet, l'argument à insertMusic doit être déclaré comme satisfaisant
> le prédicat ly:music?, et non pas markup?. Vous trouverez une liste des
> prédicats de type définis par LilyPond ici :
>
> https://lilypond.org/doc/v2.20/Documentation/notation/predefined-type-predicates.html
>
> Le code devient donc (vous noterez au passage la nouvelle syntaxe des
> \override) :
>
> \version "2.21.6"
> \language français
>
> #(define-markup-command (insertMusic layout props theMusic) (ly:music?)
>    "mini score inside a markup "
>    (interpret-markup layout props
>      #{
>        \markup
>        \score {
>          \new Staff \with {
>            \remove Time_signature_engraver
>            fontSize = -4
>            \override StaffSymbol.staff-space = #(magstep -4)
>            \override StaffSymbol.thickness = #(magstep -4)
>          }
>          \relative do {
>            #theMusic
>          }
>          \layout {
>            indent = 0\cm
>            ragged-last = ##t
>          }
>        }
>      #}))
>
> \markup \insertMusic { ré'1 }
>
> Cordialement,
> Jean Abou Samra
>
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]