lilypond-devel
[Top][All Lists]
Advanced

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

Re: Calculate spacing in lilypond


From: www . bigcab
Subject: Re: Calculate spacing in lilypond
Date: Tue, 20 Jul 2010 14:06:25 +0200
User-agent: Internet Messaging Program (IMP) 3.2.8

Selon David Kastrup <address@hidden>:

> cab <address@hidden> writes:
>
> > I have been using lilypond for 2 years now in a project called
> > "psautiers" (psalm in french) to create database of music : you can
> > see examples at my website www.psautiers.org. Yet I used the scripts
> > musicxml2ly and lilypond to create a jpeg from a musicxml file. Now
> > that everything works fine, I would like to implement a way of
> > changing colors in a few notes (for example to color the first notes
> > of my score, or to color the predominant note in a melody), but to do
> > this I have two solutions :
> >
> > -reexecuting lilypond and musicxml2ly to color a few notes which is very
> costy
> > in time and in CPU because I use a system command.
> > -or finding how you implemented the spacing in lilypond and directly
> coloring
> > the corresponding notes in the jpeg file.
>
> You can't work with JPEG files in that manner without impacting file
> size and/or quality.
>
> > I tried to look at the source using apt-get source lilypond and I then
> > went to the lily directory. However I did not find what I searched
> > for.
> >
> > Is the algorithm difficult to grasp? You may provide me a better way
> > to underline of color a few notes.
>
> You can't expect to mimic the spacing without doing the actual
> typesetting.
>
> Perhaps try running with
>
> -dbackend=scm
>
> and see whether you can find the necessary info in the dump.
>
> --
> David Kastrup
>
>
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-devel
>

Ok I tried it in an easy example (just one note)
but I don't understant the functions
combine-stencil and translate-stencil
what are their arguments (i don't know scheme programming yet)
I have just found some lines in scm/stencil.scm

(define (interpret expr)
      (let*
          ((head (if (pair? expr)
                     (car expr)
                     #f)))

        (cond
         ((eq? head 'grob-cause) (escape (cdr expr)))
         ((eq? head 'color) (interpret (caddr expr)))
         ((eq? head 'rotate-stencil) (interpret (caddr expr)))
         ((eq? head 'translate-stencil) (interpret (caddr expr)))
         ((eq? head 'combine-stencil)
          (for-each (lambda (e) (interpret e))  (cdr expr)))
         (else
          (collect (fold-false-pairs (strip-floats expr))))

         )))

are the argument of translate-stencil in pixel, if it is the case then why are
there some float numbers?

I am really sorry for asking dumb questions,but I am lost.
Thanks for your help


Dang Nguyen Bac






reply via email to

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