Re: How to input a time signature in \markup?

2009-04-14 Thread Dmytro O. Redchuk
You need to define-markup-command,
not define-music-function.

 #(define-markup-command (timesig layout props numerator denominator)
   (number? number?)
   (interpret-markup layout props
                     (markup
[...]


 \markup \timesig #3 #4

 Regards,
 Neil

-- 
Dmytro O. Redchuk


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


Re: How to input a time signature in \markup?

2009-04-14 Thread Dmytro O. Redchuk
2009/4/14 Wei-Wei Guo wwgu...@gmail.com:
 I want to define a new command \timesig instead of a new \markup, because I
 need to use it in \markup with other texts, such as

   \markup { \timesig #3 #4 blur blur }
You can include markups in markups.

I did such a commands int this way,
not sure if there is more convenient as for me, newbie :-)

Hope, someone of experienced will help.


 Best wishes,
 Wei-Wei

-- 
Dmytro O. Redchuk


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


Re: How to input a time signature in \markup?

2009-04-14 Thread Dmytro O. Redchuk
2009/4/14 Dmytro O. Redchuk brownian@gmail.com:
 2009/4/14 Wei-Wei Guo wwgu...@gmail.com:
 I want to define a new command \timesig instead of a new \markup, because I
 need to use it in \markup with other texts, such as

   \markup { \timesig #3 #4 blur blur }
 You can include markups in markups.

I mean you usually do exactly this. I guess everything below
are markup-in-markup inclusion:

\markup { \italic Foo }
\markup { \right-column { { \bold moo } {bar} } }
% etc-etc..

-- 
Dmytro O. Redchuk


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


Re: How to input a time signature in \markup?

2009-04-14 Thread Wei-Wei Guo

I tried the following expr with the new command defined by 
'define-markup-command'

\markup { \timesig #3 #4 }
\markup { \markup \timesig #3 #4 }

I don't know why.


Wei-Wei


Dmytro O. Redchuk 写道:

2009/4/14 Dmytro O. Redchuk brownian@gmail.com:

2009/4/14 Wei-Wei Guo wwgu...@gmail.com:

I want to define a new command \timesig instead of a new \markup, because I
need to use it in \markup with other texts, such as

  \markup { \timesig #3 #4 blur blur }

You can include markups in markups.


I mean you usually do exactly this. I guess everything below
are markup-in-markup inclusion:

\markup { \italic Foo }
\markup { \right-column { { \bold moo } {bar} } }
% etc-etc..




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


Re: How to input a time signature in \markup?

2009-04-14 Thread Dmytro O. Redchuk
2009/4/14 Wei-Wei Guo wwgu...@gmail.com:
 I tried the following expr with the new command defined by
 'define-markup-command'

 \markup { \timesig #3 #4 }
 \markup { \markup \timesig #3 #4 }

 I don't know why.

Try to define markup command as Neil suggested

 #(define-markup-command (timesig layout props numerator denominator)
   (number? number?)
   (interpret-markup layout props
[...]

and everything should work as:
c4 -\markup { \timesig #3 #4 }

But this should be not music, but markup function.

ps. If that won't work, send a complete snippet,
what you defined and what does not work.



 Wei-Wei

-- 
Dmytro O. Redchuk


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


Re: How to input a time signature in \markup?

2009-04-14 Thread Wei-Wei Guo

Sorry for wasting your time. It works now. I didn't notice in my test
file the command is

\markup { \timesig #3 #4}

instead of

\markup { \timesig #3 #4 }

Why is a white space so important?

Wei-Wei


Dmytro O. Redchuk 写道:

2009/4/14 Wei-Wei Guo wwgu...@gmail.com:

I tried the following expr with the new command defined by
'define-markup-command'

\markup { \timesig #3 #4 }
\markup { \markup \timesig #3 #4 }

I don't know why.


Try to define markup command as Neil suggested


#(define-markup-command (timesig layout props numerator denominator)
  (number? number?)
  (interpret-markup layout props

[...]

and everything should work as:
c4 -\markup { \timesig #3 #4 }

But this should be not music, but markup function.

ps. If that won't work, send a complete snippet,
what you defined and what does not work.



Wei-Wei





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


Re: How to input a time signature in \markup?

2009-04-14 Thread Simon Bailey

hi,

On 14 Apr 2009, at 18:15, Wei-Wei Guo wrote:

Sorry for wasting your time. It works now. I didn't notice in my test
file the command is

   \markup { \timesig #3 #4}

instead of

   \markup { \timesig #3 #4 }

Why is a white space so important?



i assume that the whitespace is required to prevent the '}' from being  
passed in as part of the 2nd parameter for \timesig.


regards,
sb
--
Simon Bailey
Oompa Loompa of Science
+43 699 190 631 25



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


Re: How to input a time signature in \markup?

2009-04-14 Thread Wei-Wei Guo

Hi Simon,

Thanks!


Best wishes,
Wei-Wei


Simon Bailey 写道:

hi,

On 14 Apr 2009, at 18:15, Wei-Wei Guo wrote:

Sorry for wasting your time. It works now. I didn't notice in my test
file the command is

   \markup { \timesig #3 #4}

instead of

   \markup { \timesig #3 #4 }

Why is a white space so important?



i assume that the whitespace is required to prevent the '}' from being 
passed in as part of the 2nd parameter for \timesig.


regards,
sb
--
Simon Bailey
Oompa Loompa of Science
+43 699 190 631 25





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


How to input a time signature in \markup?

2009-04-13 Thread Wei-Wei Guo

Dear all,

I want to present time signatures in my reading notes. I tried

  \markup { \time 2/4 }

It seems \time cannot be used in this way. I got a dirty way

  \markup { \center-column { {\musicglyph #2} {\musicglyph #4} } }

which can show a time signature, but the vertical space between the two numbers
are too large. Is there any more elegant way?


Best wishes,
Wei-Wei


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


Re: How to input a time signature in \markup?

2009-04-13 Thread Dmytro O. Redchuk
2009/4/13 Wei-Wei Guo wwgu...@gmail.com:
  \markup { \center-column { {\musicglyph #2} {\musicglyph #4} } }

This (just stacking two markups):
\relative c'' { c4 -\markup {\number 4}  -\markup{\number 2} c c c }
shows numbers closer to each other in my case.

No sure this is a good way.

-- 
Dmytro O. Redchuk


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


Re: How to input a time signature in \markup?

2009-04-13 Thread Kieren MacMillan

Hi Wei-Wei,


I want to present time signatures in my reading notes. I tried
  \markup { \time 2/4 }
It seems \time cannot be used in this way. I got a dirty way
  \markup { \center-column { {\musicglyph #2} {\musicglyph #4} } }
which can show a time signature, but the vertical space between the  
two numbers are too large.


\markup \override #'(baseline-skip . 1) { \center-column  
{ \musicglyph #two \musicglyph #four } }



Is there any more elegant way?


I don't think so... but Lilypond is always surprising me, so who  
knows?  =)


Best wishes,
Kieren.


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


Re: How to input a time signature in \markup?

2009-04-13 Thread Simon Bailey


On Apr 13, 2009, at 3:17 PM, Wei-Wei Guo wrote:
Combining your solutions, the following way is the better, but still  
to long...


 \markup{ \override #'(baseline-skip . 1) {\center-column {\number 2  
\number 4}}}



define this as a variable, then you only have to type it once:

ttf = \markup{ \override #'(baseline-skip . 1) {\center-column  
{\number 2 \number 4}}}


\relative {
a b c^\ttf d e f g_\ttf a
}

regards,
sb
--
Simon Bailey
Oompa Loompa of Science
+43 699 190 631 25



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


Re: How to input a time signature in \markup?

2009-04-13 Thread Neil Puttock
2009/4/13 Simon Bailey bina...@gmail.com:

 On Apr 13, 2009, at 3:17 PM, Wei-Wei Guo wrote:

 Combining your solutions, the following way is the better, but still to
 long...

  \markup{ \override #'(baseline-skip . 1) {\center-column {\number 2
 \number 4}}}


 define this as a variable, then you only have to type it once:

If you need to produce several different time signature markups, you
could create a new markup command:

#(define-markup-command (timesig layout props numerator denominator)
   (number? number?)
   (interpret-markup layout props
 (markup
  #:override '(baseline-skip . 0)
  #:number
  (make-center-column-markup
   (map number-string (list numerator denominator))

\markup \timesig #3 #4

Regards,
Neil


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