Re: \score block as variable/function

2011-03-18 Thread -Eluze


Xavier Scheuer wrote:
 
 
 But actually I'd prefer to use the  \score  block in a command that
 would take only the notes as argument.  ;p
 Your solution does not work for a  \score  block within a music function.
   \markup {
 \column {
   \scoreTwo d'1
 }
   }
 
 Ideas?
 Many thanks!
 
i have attached an example with score + layout definitions which you can
imbed later in markups or scores:

http://old.nabble.com/file/p31180922/test2.ly test2.ly 

hope this is what you looked for
Eluze
-- 
View this message in context: 
http://old.nabble.com/%5Cscore-block-as-variable-function-tp31147554p31180922.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


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


Re: \score block as variable/function

2011-03-18 Thread Xavier Scheuer
On 18 March 2011 14:00, -Eluze elu...@gmail.com wrote:

 i have attached an example with score + layout definitions which you can
 imbed later in markups or scores:

 http://old.nabble.com/file/p31180922/test2.ly test2.ly

 hope this is what you looked for

My goal is actually _not_ to have to write several
  \score {
% ...
\layout {}
  }

stuffs, but instead to define a _function_ (music-function?) that would
be shorter to write and that would take only the notes as argument.

Instead of having to write

  scoreOne = \markup \score {
c'1
\layout {}
  }
  scoreTwo = \markup \score {
d'1
\layout {}
  }

  \markup \fill-line {
\scoreOne  \scoreTwo
  }

I'd like to use a music function in order to be able to write

  % writeScore  is the music function I want but I was not able to define

  one = \writeScore { c'1 }
  two = \writeScore { d'1 }

  \markup \fill-line {
\one \two
  }


Cordialement,
Xavier

-- 
Xavier Scheuer x.sche...@gmail.com

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


Re: \score block as variable/function

2011-03-18 Thread -Eluze


Xavier Scheuer wrote:
 
 
 I'd like to use a music function in order to be able to write
 
   % writeScore  is the music function I want but I was not able to define
 
   one = \writeScore { c'1 }
   two = \writeScore { d'1 }
 
   \markup \fill-line {
 \one \two
   }
 
 

then you should try this (contributed by Nicolas Sceaux 
http://old.nabble.com/%5Cscore-inside-define-markup-command-ts22153506.html
http://old.nabble.com/%5Cscore-inside-define-markup-command-ts22153506.html 
)
which seems nearly what you're looking for!

\version 2.13.54 
#(define-markup-command (testmusic layout props music) (ly:music?) 
  (let ((score (ly:make-score music)) 
(score-layout (ly:output-def-clone $defaultlayout))) 
   ;; possibly, change some settings in the \layout block 
   (ly:output-def-set-variable! score-layout 'indent 0) 
   ;; add the \layout block to the score 
   (ly:score-add-output-def! score score-layout) 
   (interpret-markup layout props (markup #:vcenter #:score score
music = {a' b' c'' d''}
one = \markup { \testmusic ##{ \music #} }
two = \markup { \testmusic ##{ \music #} }
three = \markup { \testmusic ##{ \music #} }
\markup \fill-line { 
  \one 
  \two 
  \three
}

cheers
Eluze
-- 
View this message in context: 
http://old.nabble.com/%5Cscore-block-as-variable-function-tp31147554p31181636.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


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


Re: \score block as variable/function

2011-03-17 Thread Xavier Scheuer
On 15 March 2011 00:01, Neil Puttock n.putt...@gmail.com wrote:

 You want a markup identifier, so all you need to do is put \markup
 before \score:

  scoreOne = \markup \score {
   c'1
   \layout {}  % required!
  }

  \markup {
   \column {
 \scoreOne
   }
  }


Thanks Neil!
This works great.

But actually I'd prefer to use the  \score  block in a command that
would take only the notes as argument.  ;p
Your solution does not work for a  \score  block within a music function.

  %% does not work
  scoreTwo = #(define-music-function (parser location foo)
(ly:music?)
#{
  \markup \score {
$foo
\layout {}
  }
#}
  )

  \markup {
\column {
  \scoreTwo d'1
}
  }


Ideas?
Many thanks!

Cheers,
Xavier

-- 
Xavier Scheuer x.sche...@gmail.com

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


\score block as variable/function

2011-03-14 Thread Xavier Scheuer
Hi,

I use  \score  blocks inside  \markup in constructions like this one:

\markup {
  \fill-line {
\score {
  c'1
  \layout {}  % required!
}
\score {
  d'1
  \layout {}
}
  }
}

but it is heavy.

I would like to define the  \score  blocks as variables or as music
functions.  Unfortunately it seems impossible.

I tried

  scoreOne = \score {
c'1
\layout {}  % required!
  }

  \markup {
\column {
  \scoreOne
}
  }

which gives Error : syntax error, unexpected SCORE_IDENTIFIER.

I tried also

  scoreTwo = #(define-music-function (parser location foo)
 (ly:music?)
#{
  \score {
$foo
\layout {}
  }
#}
  )

  \markup {
\column {
  \scoreTwo d'1
}
  }

but it fails also : Error : syntax error, unexpected MUSIC_FUNCTION.

Any idea would be welcome!
Thanks in advance.

Cheers,
Xavier

-- 
Xavier Scheuer x.sche...@gmail.com

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


Re: \score block as variable/function

2011-03-14 Thread Neil Puttock
On 14 March 2011 19:11, Xavier Scheuer x.sche...@gmail.com wrote:

 I would like to define the  \score  blocks as variables or as music
 functions.  Unfortunately it seems impossible.

 I tried

  scoreOne = \score {
    c'1
    \layout {}  % required!
  }

  \markup {
    \column {
      \scoreOne
    }
  }

 which gives Error : syntax error, unexpected SCORE_IDENTIFIER.

 I tried also

  scoreTwo = #(define-music-function (parser location foo)
                                     (ly:music?)
    #{
      \score {
        $foo
        \layout {}
      }
    #}
  )

  \markup {
    \column {
      \scoreTwo d'1
    }
  }

 but it fails also : Error : syntax error, unexpected MUSIC_FUNCTION.

 Any idea would be welcome!

You want a markup identifier, so all you need to do is put \markup
before \score:

 scoreOne = \markup \score {
   c'1
   \layout {}  % required!
 }

 \markup {
   \column {
 \scoreOne
   }
 }

Cheers,
Neil

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