Re: tablature.ly

2009-04-30 Thread Marc Hohl

[snip]

I have reworked my tablature.ly according to all suggestions and 
improvements by Neil and Carl.


The modern tab clef seems to be scaling properly, I played a bit with 
some values for staff-space,
and it looks now as it should be (at least in my opinion). I have 
managed (with excessive help)
to get the staff-space and the line-count from the staff-symbol 
property, so there is no more

need for explicitly using the tuning as an argument for the clef functions.
(And again, I have gained some more insight  in scheme and lilypond, 
thank you both!)


As Neil proposed, it should be possible to code

\clef tab

for the current calligraphic clef, and to write

\clef moderntab

for the sans serif-style clef for compatibility's sake.

This issue is beyond my abilities, so I call desperately for help ;-)

If we add entries in parser-clef.scm to supported-clefs and
c0-pitch-alist (either directly or by consing the new entries within
the tablature file) for the modern tab,

("moderntab" . ("markup.moderntab" 0 0))

("markup.moderntab" . 0)
  
I tried to cons these values, and I succeded (or at least it seemed to 
me) for the

supported-clefs list, but not with the c0-pitch-alist
(see attached files and lilypond's error messages).
Is this list only locally defined, or am I missing something?

In my opinion, as tablature.ly is meant to be included by the user, not 
by default,
the changings in these lists should be done within tablature.ly, if this 
is possible.

we can override the Clef 'stencil to check 'glyph before calling the
default print-function.  If the string "markup.moderntab" is found,
then it's simple to return a stencil for the new tab markup.

  

How can I achieve this?

There's one potential pitfall: it's expected that each clef type has a
variant at a smaller size which is obtained by appending "_change" to
the glyph-name.  You'd probably want to disable this feature by
setting 'full-size-change = ##t.

Regards,
Neil

  


Thanks for your help!

Marc
 tablature.ly

 source file of the GNU LilyPond music typesetter

 (c) 2009 Marc Hohl 


% some publications use the triangled note head 
% for palm mute, so here we go:
palmMuteOn = { \set shapeNoteStyles = #(make-vector 7 do) }
palmMuteOff = { \unset shapeNoteStyles }
% for single notes (or groups of notes within { ...} :
palmMute =  #(define-music-function (parser location notes) (ly:music?)
  #{
 \palmMuteOn $notes \palmMuteOff
  #})

% x-tab-format uses a "x" instead of the fret number:
#(define (x-tab-format str context event)
(make-whiteout-markup
  (make-vcenter-markup
(markup #:musicglyph "noteheads.s2cross"

% dead notes are marked with a cross-shape note head,
% both in normal notation and in tablature:
deadNotesOn = {
   \override NoteHead #'style = #'cross
   \set tablatureFormat = #x-tab-format
}
deadNotesOff = {
   \unset tablatureFormat
   \revert NoteHead #'style
}
% for single notes or groups of notes within {...}:
deadNotes = #(define-music-function (parser location notes) (ly:music?)
   #{
  \deadNotesOn  $notes \deadNotesOff
   #})
%
%
% for testing purposes only
#(display "supported-clefs before:")
#(newline)
#(display supported-clefs)
#(newline)
#(display "c0-pitch-alist before:")
#(newline)
#(display c0-pitch-alist)
#(newline)
#(define-public supported-clefs (cons '("moderntab" . ("markup.moderntab" 0 0)) 
supported-clefs))
#(define c0-pitch-alist (cons '("markup.moderntab" . 0) c0-pitch-alist))
#(display "supported-clefs after:")
#(newline)
#(display supported-clefs)
#(newline)
#(display "c0-pitch-alist after:")
#(newline)
#(display c0-pitch-alist)
#(newline)
% define sans serif-style tab-Clefs as a markup:
#(define-markup-command (customTabClef layout props num-strings staff-space) 
(integer? number?)
(define (square x) (* x x))
(let* ((scale-factor (/ staff-space 1.5))
   (font-size (- (* num-strings 1.5 scale-factor) 7))
   (base-skip (* (square (+ (* num-strings 0.195) 0.4)) scale-factor)))
   ;;(display "font-size:")(display font-size)(newline)
   (interpret-markup layout props
 (markup #:vcenter #:bold
 #:override (cons 'font-family 'sans)
 #:fontsize font-size
 #:override (cons 'baseline-skip base-skip)
 #:left-align
 #:center-column ("T" "A" "B")

% Wrappers for the different clefs
% the argument is the string-tuning, which is automatically set.
sansSerifTabClef = #(define-music-function (parser location) ()
   #{
  \override TabStaff.Clef #'stencil = $(lambda (grob)
  (let* ((staff-symbol (ly:grob-object grob 'staff-symbol))
 (line-count   (ly:grob-property staff-symbol 'line-count))
 (staff-space  (ly:grob-property staff-symbol 'staff-space)))
 (grob-interpret-markup grob (make-customTabClef-markup line-count 
staff-space
  \override TabStaff.Clef #'full-size-change = ##t 

Tie and accidental

2009-04-30 Thread Thomas Scharkowski
Hi,

the first two (commented out) overrides give the expected result.
"\override Staff.Accidental #'stencil = ##f" pushes the tie away from 
the staff, see the attached png.
Am I missing something or is it a bug?

Thanks
Thomas

--
\version "2.13.0"
\relative c' {  
cis1~
cis~
\repeat unfold 20 {
%\override Accidental #'break-visibility = #all-invisible
%\override Staff.Accidental #'transparent = ##t
\override Staff.Accidental #'stencil = ##f
cis~
}
}
--
Der folgende Teil dieser Nachricht enthält einen Anhang im
sogenannten Internet MIME Nachrichtenformat.
Wenn Sie Pegasus Mail oder ein beliebiges anderes MIME-kompatibles
Email-System verwenden, sollte Sie den Anhang mit Ihrem Email-System
speichern oder anzeigen können. Anderenfalls fragen Sie Ihren Administrator.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

    Datei Information/File information ---
 Datei/File:  tie-accidental.png
 Datum/Date:  30 Apr 2009, 9:43
 Größe/Size:  12973 bytes.
 Typ/Type:Unbekannt


tie-accidental.png
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


note head collisions

2009-04-30 Thread Gerard McConnell
Hello,
Why am I getting overlapping note heads in this example, and what
is the solution?
Thanks for any help,
Gerard

\score {
   \new Staff {
  \time 4/4
  \relative c' {
  <<
  \new Voice { \voiceOne b'4 \times 2/3 {c8 b c} d2 ~ d4 d8 c g4 c }
  \new Voice { \voiceTwo s2 s4 e ~ e1 }
  \new Voice { < g,, d' >1 < c g' > }
  >>
  }
   }
}___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: note head collisions

2009-04-30 Thread Francisco Vila
2009/4/30 Gerard McConnell :
> Hello,
> Why am I getting overlapping note heads in this example, and what
> is the solution?
> Thanks for any help,
> Gerard
>
> \score {
>    \new Staff {
>   \time 4/4
>   \relative c' {
>   <<
>   \new Voice { \voiceOne b'4 \times 2/3 {c8 b c} d2 ~ d4 d8 c g4 c }
>   \new Voice { \voiceTwo s2 s4 e ~ e1 }
>   \new Voice { < g,, d' >1 < c g' > }
>   >>
>   }
>    }
> }

In this version I've changed the order of expressions to make them to
be voices 1,2 and 3 with no need to explicitly invoking new voice
commands.

\score {
   \new Staff {
  \time 4/4
  \relative c' {
  <<
 {  s2 s4 e' ~ e1 } \\
 {  < g,, d' >1  < c g' > } \\
 {  b'4 \times 2/3 {c8 b c} d2 _~ d4 d8 c g4 c }

  >>
  }
   }
}

I think the overlapping you obtained came from different noteheads on
the same column, a warning that was ignored.

That would be equivalent to have

  \new Voice ="3" { \voiceThree b'4 \times 2/3 {c8 b c} d2 ~ d4 d8 c g4 c }
  \new Voice ="1" { \voiceOne s2 s4 e ~ e1 }
  \new Voice ="2" { \voiceTwo < g,, d' >1 < c g' > }

but the tie in voice 3 still has to be tweaked.

Read about "The double backslash construct" in NR 1.5.2
-- 
Francisco Vila. Badajoz (Spain)
www.paconet.org


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


Re: New fonts for chords

2009-04-30 Thread Bertalan Fodor (LilyPondTool)



I'm not sure who has the decision authority to change the default chord name
font to roman, but if lots of users made that request on lilypond-user, I
would guess that it would happen.
  

IIRC it was intentionally set sans back in 2003.

Bert



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


Re: tablature.ly

2009-04-30 Thread Carl D. Sorensen



On 4/30/09 1:36 AM, "Marc Hohl"  wrote:

> [snip]
> 
> I have reworked my tablature.ly according to all suggestions and
> improvements by Neil and Carl.
> 
> The modern tab clef seems to be scaling properly, I played a bit with
> some values for staff-space,
> and it looks now as it should be (at least in my opinion). I have
> managed (with excessive help)
> to get the staff-space and the line-count from the staff-symbol
> property, so there is no more
> need for explicitly using the tuning as an argument for the clef functions.
> (And again, I have gained some more insight  in scheme and lilypond,
> thank you both!)
> 
> As Neil proposed, it should be possible to code
> 
> \clef tab
> 
> for the current calligraphic clef, and to write
> 
> \clef moderntab
> 
> for the sans serif-style clef for compatibility's sake.
> 
> This issue is beyond my abilities, so I call desperately for help ;-)
>> If we add entries in parser-clef.scm to supported-clefs and
>> c0-pitch-alist (either directly or by consing the new entries within
>> the tablature file) for the modern tab,
>> 
>> ("moderntab" . ("markup.moderntab" 0 0))
>> 
>> ("markup.moderntab" . 0)
>>  
> I tried to cons these values, and I succeded (or at least it seemed to
> me) for the
> supported-clefs list, but not with the c0-pitch-alist
> (see attached files and lilypond's error messages).
> Is this list only locally defined, or am I missing something?

You are correct.  c0-pitch-alist is not public.  So it's currently not
possible to cons a value in with the tablature.ly file.

Your choices at this point are to
a) change the scm/parser-clef.scm file to (define-public c0-pitch-alist 
and keep the additions to the clef list in tablature.ly

b) hardcode the changes to supported-clefs and c0-pitch-alist in
scm/parser-clef.scm

c) add a scheme function (define-public (add-new-clef clef-name) )
to scm/parser-clef.scm.  This function would cons the new clef values onto
both lists.  And because the function is defined in scm/parser-clef.scm, it
will have access to c0-pitch-alist.  Then you would revise tablature.ly to
call add-new-clef to take care of things.

My recommendation is that you pursue option c.  The disadvantage of pursuing
option c is that it won't be available to others until a new release of
LilyPond is issued.

However, the existing tablature.ly file that you posted to the list works
for 2.12, so that will meet the needs of those users.  And you will have
made the changes to scm/parser-clef.scm on your system, so you'll have it
available for your use.  And you can post a patch that those who are
interested can use to make changes to their own version of
scm/parser-clef.scm.

All in all, I'd say go ahead with the new function in scm/parser-clef.scm
and modify tablature.ly to work with the new function.


> 
> In my opinion, as tablature.ly is meant to be included by the user, not
> by default,
> the changings in these lists should be done within tablature.ly, if this
> is possible.

You can also think about splitting tablature.ly into tablature-init.ly which
will be always be run, and tablature.ly which will only be run if the user
includes it.  That's the way predefined-fretboards works.

>> we can override the Clef 'stencil to check 'glyph before calling the
>> default print-function.  If the string "markup.moderntab" is found,
>> then it's simple to return a stencil for the new tab markup.
>> 
>>  
> How can I achieve this?

Define a new Scheme function to be used as the Clef 'stencil property

(define (newClefPrint grob) )

It should check for the 'glyph property of the grob, and if it's
markup.moderntab, it will call the new tab markup function.  Otherwise, it
will call (ly:clef::print grob).


Hope this helps,

Carl



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


Re: tablature.ly

2009-04-30 Thread Neil Puttock
2009/4/30 Carl D. Sorensen :
>
> On 4/30/09 1:36 AM, "Marc Hohl"  wrote:
>
>> I tried to cons these values, and I succeded (or at least it seemed to
>> me) for the
>> supported-clefs list, but not with the c0-pitch-alist
>> (see attached files and lilypond's error messages).
>> Is this list only locally defined, or am I missing something?
>
> You are correct.  c0-pitch-alist is not public.  So it's currently not
> possible to cons a value in with the tablature.ly file.

Oops. :)

Sorry Marc, I didn't notice that.  I ran a quick test by amending
parser-clef.scm, so I hadn't actually tried consing values.

> My recommendation is that you pursue option c.  The disadvantage of pursuing
> option c is that it won't be available to others until a new release of
> LilyPond is issued.

I agree, that seems the best option for the moment.

At a later date, we might consider moving the clef callbacks in
clef.cc to scheme completely, so you'd be able to incorporate the
conditional code for modern tabs directly into the clef::print
callback.

> Define a new Scheme function to be used as the Clef 'stencil property
>
> (define (newClefPrint grob) )

I suggest something like `clef::print-modern-tab-if-set' to follow
LilyPond coding style.

> It should check for the 'glyph property of the grob, and if it's
> markup.moderntab, it will call the new tab markup function.  Otherwise, it
> will call (ly:clef::print grob).

Two further points:

Just to be on the safe side, when retrieving 'staff-space, a default
value should be given, since it's not normally set:

(ly:grob-property grob 'staff-space 1)

As I mentioned previously, unless you want to code a smaller clef for
changes, you'll want to set 'full-size-change = ##t.  This will shut
up any complaints about missing a glyph for "markup.moderntab_change".
 You can set it within the new stencil callback using
ly:grob-set-property!:

(ly:grob-set-property! grob 'full-size-change #t)

Regards,
Neil


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


Re: Error in tweak parameter doesn't generate error message

2009-04-30 Thread Neil Puttock
2009/4/25 Werner LEMBERG :

> Great!  Please commit something along this.

Done.

I've changed it slightly so it matches the behaviour of \override,
setting the property even if there's no match.

Regards,
Neil


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


Head of merged half note getting filled

2009-04-30 Thread Nick Payne
I've got a score where the heads of half and dotted half notes that are
merged with eighth notes are being incorrectly filled in. I've minimised it
to the attached example. I've found that the problem is due to having three
voices. If I remove the treble voice from my example, then the merged note
in the middle and bass voices outputs correctly with an unfilled notehead.

Nick Payne
<>\version "2.12.2"

qBeam = {
	#(override-auto-beam-setting '(end 1 8 * *) 1 4 'Staff)
	#(override-auto-beam-setting '(end 1 8 * *) 2 4 'Staff)
}

rBeam = {
	#(revert-auto-beam-setting '(end 1 8 * *) 1 4 'Staff)
	#(revert-auto-beam-setting '(end 1 8 * *) 2 4 'Staff)
}

treble = \relative c {
	b''2 a4
}

middle = \relative c {
	\qBeam 
	\once \override Stem #'direction = #UP a8 g' e' c ~ c e
}

bass = \relative c {
	a2.
}

\score {
	\context Staff = guitar {
		\clef "treble_8"
		\key e \minor
		\time 3/4
		\mergeDifferentlyHeadedOn
		\mergeDifferentlyDottedOn
		<<
			\context Voice = "1" { \voiceOne \treble }
			\context Voice = "2" { \voiceTwo \middle }
			\context Voice = "4" { \voiceFour \bass }
		>>
	}
	\layout { }
}

\score {
	\context Staff = guitar {
		\clef "treble_8"
		\key e \minor
		\time 3/4
		\mergeDifferentlyHeadedOn
		\mergeDifferentlyDottedOn
		<<
%			\context Voice = "1" { \voiceOne \treble }
			\context Voice = "2" { \voiceTwo \middle }
			\context Voice = "4" { \voiceFour \bass }
		>>
	}
	\layout { }
}

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


"error: failed file..." with perfect output

2009-04-30 Thread Tom Cloyd
I'm not figuring this out, and could use a hint as to what to look for. 
My PDF output is perfect, but I get this console output:


t...@tomc-desktop:~/Music/Music_scores/Lilypond$ lilypond chorale01.ly
GNU LilyPond 2.12.2
Processing `chorale01.ly'
Parsing...
/usr/local/lilypond/usr/share/lilypond/current/ly/init.ly:29:0: error: 
syntax error, unexpected SCM_TOKEN


#(if (and (ly:get-option 'old-relative)
Interpreting music... [8][16][24]
Preprocessing graphical objects...
Interpreting music...
MIDI output to `chorale01.midi'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `chorale01.ps'...
Converting to `./chorale01.pdf'...
error: failed files: "chorale01.ly"
t...@tomc-desktop:~/Music/Music_scores/Lilypond$

What's an "SCM_TOKEN"? Or is that not relevant. This just showed up in 
my last few editing iterations, and I don't have any idea what might be 
causing it. I can offer up the code, but it's 213 lines.


Tom

--





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


"error: failed file..." with perfect output

2009-04-30 Thread Tom Cloyd

Drat. Just caught it, and rather by accident. All's well.

Sorry for the noise.

Tom

--






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


Re: Head of merged half note getting filled

2009-04-30 Thread Jonathan Kulp

Nick Payne wrote:

I've got a score where the heads of half and dotted half notes that are
merged with eighth notes are being incorrectly filled in. I've minimised it
to the attached example. I've found that the problem is due to having three
voices. If I remove the treble voice from my example, then the merged note
in the middle and bass voices outputs correctly with an unfilled notehead.

Nick Payne



Nick,

I'm not sure why it doesn't behave like you want, but you can force it 
to do so with this code before the offending note in the middle voice:


  \once \override NoteHead #'transparent = ##t

You can also use much simpler \stemUp, \stemDown, and \stemNeutral 
commands to control direction of stems.


HTH,

Jon
--
Jonathan Kulp
http://www.jonathankulp.com


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