James,

Thanks for the quick reply.

> First of all, hello. Welcome. I encourage everyone to read the Learning
> Manual once completely through before doing anything. 

I've gone through the manual already. But I've not found an answer to my
problem.

> To your question, you've included the fret diagram in the Notes
> variable. Everything in the Notes variable will be included when it is
> compiled. Essentially, your score is this:
> 
> \score {
> <<
>    \new Staff {
>       d ^ \markup \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;" g b
>    }
> 
>    \new TabStaff {
>       d ^ \markup \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;" g b
>    }
>  >>
> }

Agreed. I understand that (I'm computer scientist:).

> If you look at it like this, you can see that you've duplicated the fret
> diagram.
> 
> The easiest solution is so put your fret diagrams in a different
> variable, and include that variable only where you want it. i.e.,
> 
> Diagrams = { s4 ^ \markup \fret-diagram-terse #"x;x;o;2-2;3-3;1-1 }
> 
> \score { <<\new Staff \Notes \new Staff <<\Diagrams \Notes >> >> }

Right, but the piece I'm writing is large and I just have few fret
diagrams to include. So it seemed easier to me to insert the fret
diagrams inside the note flow.

I was wondering if a macro wont be usable here. I've seen something like
this generated by tuxguitar:

<<
TrackAVoiceAMusic = #(define-music-function (parser location inTab)
(boolean?)
#{
   \tempo 4=120
   \clef #(if $inTab "tab" "treble_8")
>>

When TrackAVoiceAMusic is inserted into a Staff the clef is set to treble_8:

   TrackAVoiceAMusic ##f

and when inside a tab it is set to tab:

   TrackAVoiceAMusic ##t

Is something like this usable to insert or not a markup?

Thanks,
Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B



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

Reply via email to