Compound time

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

Compound time

Gilles Sadowski
Hello.

About the "compound time" trick proposed in
  http://lilypond.org/doc/v2.6/input/test/lily-1299846131.ly

#(define (compound-time grob one two num)
  (interpret-markup
   (ly:grob-layout grob)
   '(((baseline-skip . 2)
      (word-space . 2)
      (font-family . number)))
   (markup
    #:line ( #:column (one num) #:lower 1 "+" #:column (two num)))))


1. Shouldn't the trick be extended to

   #(define (compound-time grob one two three four)
     [etc.]

   to make it possible to have a signature of e.g.: 3/8+2/4 ?

2. When reducing the "Staff" size, the time signature object defined
   with the above hack doesn't follow the change, resulting in the
   number symbols being too big.
   How to modify the code to include a size setting?

3. Will these compound signatures become part of the "user" syntax?
   [Which will ultimately solve the above problem.]


Thanks.
Gilles


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

Re: Compound time

Gilles Sadowski

Sorry, I forgot (again):
[Please refer to the attached image.]

4. The space on the right side of the plus seems too wide.

5. The first note seems too close to the time signature.


Gilles

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

compound.png (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Compound time

Gilles Sadowski


> [Please refer to the attached image.]
>
> 4. The space on the right side of the plus seems too wide.
>
> 5. The first note seems too close to the time signature.
>

Lacking any response (-confirmed/existing/solved in newer version/not- bug),
I extended the "hack" for compound time:

#(define (compound-time grob one two three four)
  (interpret-markup
   (ly:grob-layout grob)
   '(((baseline-skip . 2)
      (word-space . 2)
      (font-family . number)))
   (markup
    #:line
    (#:column (one two)
    #:lower 1 "+"
    #:hspace -2.4 #:column (three four)
    " "))))

which makes it even uglier (see the negative "hspace" and the added
blank space), and still it will only work for default font size.


Gilles


_______________________________________________
bug-lilypond mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: Compound time

Han-Wen Nienhuys
Gilles wrote:

>
>>[Please refer to the attached image.]
>>
>>4. The space on the right side of the plus seems too wide.
>>
>>5. The first note seems too close to the time signature.
>>
>
>
> Lacking any response (-confirmed/existing/solved in newer version/not- bug),
> I extended the "hack" for compound time:
>
> #(define (compound-time grob one two three four)
>   (interpret-markup
>    (ly:grob-layout grob)
>    '(((baseline-skip . 2)
>       (word-space . 2)
>       (font-family . number)))
>    (markup
>     #:line
>     (#:column (one two)
>     #:lower 1 "+"
>     #:hspace -2.4 #:column (three four)
>     " "))))
>
> which makes it even uglier (see the negative "hspace" and the added
> blank space), and still it will only work for default font size.
>  

You need to use the defaults for the text font,
try calling

    ly:grob-alist-chain


with the 'text-font-defaults from the layout returned by (ly:grob-layout
grob)

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
bug-lilypond mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: Compound time

Gilles Sadowski

> >
> >#(define (compound-time grob one two three four)
> >  (interpret-markup
> >   (ly:grob-layout grob)
> >   '(((baseline-skip . 2)
> >      (word-space . 2)
> >      (font-family . number)))
> >   (markup
> >    #:line
> >    (#:column (one two)
> >    #:lower 1 "+"
> >    #:hspace -2.4 #:column (three four)
> >    " "))))
> >
> >which makes it even uglier (see the negative "hspace" and the added
> >blank space), and still it will only work for default font size.
> >  
>
> You need to use the defaults for the text font,
> try calling
>
>    ly:grob-alist-chain
>
>
> with the 'text-font-defaults from the layout returned by (ly:grob-layout
> grob)
>

I don't understand much of it (and that's probably the main problem!), but
this is what I tried, with a rather pitiful result:

#(define (compound-time-2 grob one two three four)
  (let* ((layout (ly:grob-layout grob))
         (text (interpret-markup
                layout
                (ly:grob-alist-chain grob (ly:output-def-lookup layout 'text-font-defaults))
                (markup
                 #:line
                 (#:column (one two)
                  #:lower 1 "+"
                  #:hspace -2.4 #:column (three four)
                  " ")))))
   text))
 

What are the missing parts?

Thanks,
Gilles


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