Positioning of text elements

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Positioning of text elements

TipTap
Hello all,

I open up this new thread as the string naming question
could be solved due to hints of Carl Sorensen.

Next questions:

1: How can I move the "instrumentName" markup
   from the example score below closer to the TAB?

2: I want all string names appear centered within
   their box. How do I achieve this?

General question:

3: Is it possible to position (non-note) elements freely
   with Lilypond? It would be nice to place or anchor
   custom text (or GROBs) anywhere.

Regards,
Frank

---<snip>---
\version "2.12.2"

% Koyabu left hand tuning: C G d a e h
#(define-public koyabuLH  '(35 28 21 14 7 0))

global= { \time 4/4 }

myNotes = { g16 e' c' b c e, c' e, g, e' c' b c e, c' e, }

<<

  \new TabStaff \with {
    instrumentName = \markup \magnify #0.6 \override #'(baseline-skip . 1) \column {
      \box \pad-to-box #'(0 . 1) #'(0 . 1) C
      \box \pad-to-box #'(0 . 1) #'(0 . 1) G
      \box \pad-to-box #'(0 . 1) #'(0 . 1) d
      \box \pad-to-box #'(0 . 1) #'(0 . 1) a
      \box \pad-to-box #'(0 . 1) #'(0 . 1) e
      \box \pad-to-box #'(0 . 1) #'(0 . 1) h
    }
  } {
    % koyabu left hand
    \global
    \set TabStaff.stringOneTopmost = ##f
    \set TabStaff.stringTunings =  #koyabuLH
    \set TabStaff.minimumFret = #5
    \stemUp
    \relative c''' { \myNotes}
  }
  \new Staff {
    % cello
    \global
    \clef bass
    \key g \major
    \relative c { \myNotes }
  }

>>
---<snip>---



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Positioning of text elements

Carl Sorensen
Frank,

This kind of question should probably be asked on lilypond-user.


On 2/11/10 1:45 PM, "Frank Stefani" <[hidden email]> wrote:

> Hello all,


>
> I open up this new thread as the string naming question
> could be solved due to hints of Carl Sorensen.
>
> Next questions:
>
> 1: How can I move the "instrumentName" markup
>    from the example score below closer to the TAB?

You will want to adjust the padding, or perhaps adjust the X-offset
properties of the InstrumentName grob.

See the Internals Reference for the properties that affect the setting.

>
> 2: I want all string names appear centered within
>    their box. How do I achieve this?

I think you can use \box {\center-column {"c"}}

>
> General question:
>
> 3: Is it possible to position (non-note) elements freely
>    with Lilypond? It would be nice to place or anchor
>    custom text (or GROBs) anywhere.

No, you can't.  And it wouldn't really be nice to do so, because that kind
of work needs to always be adjusted when you move something somewhere else.

If you really want to do that, you can use the svg backend and use inkscape
to do the positioning.


HTH,

Carl



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Positioning of text elements

Marc Hohl
Carl Sorensen schrieb:

> [...]
>>
>> 3: Is it possible to position (non-note) elements freely
>>    with Lilypond? It would be nice to place or anchor
>>    custom text (or GROBs) anywhere.
>>    
>
> No, you can't.  And it wouldn't really be nice to do so, because that kind
> of work needs to always be adjusted when you move something somewhere else.
>  
I object here. Does anyone knows the pstricks package in (La)TeX?
Here, you can define almost anything as a node which can be referenced
to later on. If you have two or more nodes on the same page, you can draw
arrows, brackets and almost anything available with postscript between them,
distance computations etc. are possible. And whenever you change something
in the content of the page, the coordinates of the nodes are
recalculated, so
you don't have to bother. And the presence of nodes doesn't influence the
material on the page, of course.
I did implement bends in MusiXTeX with pstricks, and it worked fine.

Such a feature would be great for lilypond, you could draw some arrows
pointing at special note heads, or even brackets over certain measures etc.
without misusing existing grob routines all the time. I don't know how to
implement this, but in general, I would not drop this idea too quickly.

> If you really want to do that, you can use the svg backend and use inkscape
> to do the positioning.
>  
Of course, but if there is a generic solution, it would surely improve
usability - and if you have a look at the lsr, there are lots of examples
where grob output routines are used for some trickery they weren't
created for.

Just my 2ct...

Marc



Loading...