Re: Align scores in markup

2015-08-14 Thread Michael Gerdau
> the custom function helps for readability and reuse of score snippets.

Hmmlet's see.

Your preferred version:

%%
\version "2.19.24"
%=
% WRITE SCORE
%
%=
#(define-markup-command (writeScore 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 #:score score) )
 ))


musicA = { c' d' e' }
musicB = { c d e }

\markup {
  "this should be aligned" \writeScore #musicA
 "with this " \writeScore #musicB
}
%%


My preferred version:

%%
\version "2.19.24"
\paper { indent = 0 }

musicA = { c' d' e' }
musicB = { c d e }

\markup {
  "this should be aligned" \score { \musicA } 
 "with this " \score { \musicB } 
}
%%

I don't see any benefit in terms of readability in the version with the
custom function. Reuse of score snippets is identical. No gain either.

I'm not able to attribute being more concise to either version.

The whole argument is somewhat nitpicking though. If you prefer your
custom function that's fine.

Kind regards,
Michael
-- 
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver

signature.asc
Description: This is a digitally signed message part.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Align scores in markup

2015-08-14 Thread Simon Albrecht

Am 14.08.2015 um 14:58 schrieb MarcM:

the custom function helps for readability and reuse of score snippets.

\markup {
   "this"  \score {  { c' d' e' } \layout { indent=0 } }
  "should be aligned with this " \score {  { c d e }
\layout { indent=0 } }
}

%% This is more concise and readable

even more concise and without a headache:


musicA = { c'd'e'}
musicB = { c d e }
\markup { "this" \writeMusic ##{ \musicA #}

\writeMusic \musicA
% or
\writeMusic #musicA

No need to switch back and forth between Scheme and LilyPond mode.

Yours, Simon

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


Re: Align scores in markup

2015-08-14 Thread MarcM
the custom function helps for readability and reuse of score snippets.

\markup { 
  "this"  \score {  { c' d' e' } \layout { indent=0 } } 
 "should be aligned with this " \score {  { c'''' d'''' e'''' }
\layout { indent=0 } } 
} 

%% This is more concise and readable

musicA = { c'd'e'} 
musicB = { c'''' d'''' e'''' } 
\markup { "this" \writeMusic ##{ \musicA #} "should be aligned with this "
\writeMusic ##{ \musicB #}}




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Align-scores-in-markup-tp179568p179600.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Align scores in markup

2015-08-14 Thread Michael Gerdau
> this allows to have multiple small score snippets aligned.

As Harm asked:
What is the advantage of the custom function ?

On my system the following code produces the same visual result:

\version "2.19.24"

\markup {
  "this should be aligned" \score {  { c' d' e' } \layout { indent=0 } } 
 "with this " \score {  { c d e } \layout { indent=0 } } 
}

Kind regards,
Michael
-- 
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver

signature.asc
Description: This is a digitally signed message part.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Align scores in markup

2015-08-13 Thread MarcM
thanks.

this allows to have multiple small score snippets aligned.




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Align-scores-in-markup-tp179568p179571.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Align scores in markup

2015-08-13 Thread Thomas Morley
2015-08-14 3:32 GMT+02:00 Thomas Morley :
> 2015-08-14 3:13 GMT+02:00 MarcM :
>> I am using a custom markup command that allows inserting scores into markups.
>> It works great except when one score uses high notes the scores are not
>> aligned.
>>
>> 
>>
>> %=
>> % WRITE SCORE
>> %
>> %=
>> #(define-markup-command (writeScore 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)
>
> delete #:vcenter
>
>>  (interpret-markup layout props (markup #:vcenter #:score score) )
>>  ))
>>
>>
>>
>> \markup {
>>   "this should be aligned" \writeScore ##{  c' d' e' #}
>>  "with this " \writeScore ##{  c d e #}
>> }
>>
>
>

(hit wrong key)

> Though, I don't see an advantage not to use the default-markup-command:
\markup \score ...

Cheers,
  Harm

Please always post the version you use!!

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


Re: Align scores in markup

2015-08-13 Thread Thomas Morley
2015-08-14 3:13 GMT+02:00 MarcM :
> I am using a custom markup command that allows inserting scores into markups.
> It works great except when one score uses high notes the scores are not
> aligned.
>
> 
>
> %=
> % WRITE SCORE
> %
> %=
> #(define-markup-command (writeScore 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)

delete #:vcenter

>  (interpret-markup layout props (markup #:vcenter #:score score) )
>  ))
>
>
>
> \markup {
>   "this should be aligned" \writeScore ##{  c' d' e' #}
>  "with this " \writeScore ##{  c d e #}
> }
>



Though, I don't see an advantage not to use the default-markup-command:

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


Align scores in markup

2015-08-13 Thread MarcM
I am using a custom markup command that allows inserting scores into markups.
It works great except when one score uses high notes the scores are not
aligned.

<http://lilypond.1069038.n5.nabble.com/file/n179568/shouldBeAligned.png> 

%=
% WRITE SCORE
%
%=
#(define-markup-command (writeScore 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) )
 ))



\markup {
  "this should be aligned" \writeScore ##{  c' d' e' #} 
 "with this " \writeScore ##{  c'''' d'''' e'''' #} 
}





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Align-scores-in-markup-tp179568.html
Sent from the User mailing list archive at Nabble.com.

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