Re: Staff/chords spacing.

2014-03-17 Thread Matthias Hüsken

On 15.03.2014 09:09, Pierre Perol-Schneider wrote:

Mini example please
~Pierre


Sorry, forgot to post one.

During shortening some code into a mini example, I was actually able to 
solve my problem. I'm posting it anyway because I'm not sure it's the 
most elegant or clever was of doing.


Short repetition of what I want to achieve:
* a StaffGroup consisting of two Staffs
* a ChordLine in between
* Fixed distances between the staffs
* the ChordLine centered in between.

I can't shake the feeling that my approach may be a bit too brute-force, 
but at least it works for me :) If someone has a better approach, I'd be 
interested in trying it.


Thanks,

Matthias

\version 2.18.0

startLine =
{
\overrideProperty Score.NonMusicalPaperColumn.line-break-system-details #'((alignment-distances . (8 6 6)))
\break
}

harmonies = \chordmode
{   
c1 a1:m
f1 c1
}

upper = \relative c''
{
\startLine
g4 g e g | g g e g |
\startLine
a f a a | g g e g }

lower = \relative c
{
\startLine
c4 e g c | c,4 e g c |
\startLine
f,4 a c f | c,4 e g c |
}

\new Score
\with
{
\override NonMusicalPaperColumn.line-break-permission = ##f
\override NonMusicalPaperColumn.page-break-permission = ##f
}
{
\new StaffGroup

\new Staff  = upper
{
\clef treble
\upper
}

\new ChordNames
{
\override VerticalAxisGroup.staff-affinity = ##f
\harmonies
}

\new Staff = lower
{
\clef bass
\lower
}

}

\layout
{
\context
{
\StaffGroup
\accepts ChordNames
}
\context
{
\Score
\remove Bar_number_engraver
}
}


\paper
{
set-paper-size = a4
systems-per-page = #6
ragged-bottom = ##t
ragged-right = ##f
}

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


Fwd: Re: Ragged right for contents but not staff?

2014-03-13 Thread Matthias Hüsken

Dear all,

I know this thread is ancient, but I am only now in the process of 
upgrading from Lilypond 2.12.2 to 2.18, and I used the attached function 
alignGrob quite heavily. Unfortunately, it does not work in 2.18 any 
more, and I do not know enough about the Lilypond internals (and about 
scheme) to fix it myself. Here is what happens if I try to compile the 
attached file from David:


~/test convert-ly alignGrob-update.ly  align.ly
convert-ly (GNU LilyPond) 2.18.0

convert-ly: Processing `alignGrob-update.ly'...
Applying conversion: 2.15.7, 2.15.9, 2.15.10, 2.15.16, 2.15.17, 2.15.18, 
2.15.19, 2.15.20, 2.15.25, 2.15.32, 2.15.39, 2.15.40, 2.15.42, 2.15.43, 
2.16.0, 2.17.0, 2.17.4, 2.17.5, 2.17.6, 2.17.11, 2.17.14, 2.17.15, 
2.17.18, 2.17.19, 2.17.20, 2.17.25, 2.17.27, 2.17.29, 2.17.97



~/test lilypond align.ly
GNU LilyPond 2.18.0
Processing `align.ly'
Parsing...
align.ly:51:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'KeySignature #0 #6
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:51:46: error: error in #{ ... #}
  \alignGrob #TextScript #'KeySignature #0
 #6
align.ly:53:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'Clef #1 #5.5
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:53:38: error: error in #{ ... #}
  \alignGrob #TextScript #'Clef #1
 #5.5
align.ly:58:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'BarLine #0 #-5.5
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:58:41: error: error in #{ ... #}
  \alignGrob #TextScript #'BarLine #0
#-5.5
align.ly:60:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'Hairpin #1 #1
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:60:41: error: error in #{ ... #}
  \alignGrob #TextScript #'Hairpin #1
#1
align.ly:62:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'Slur #0 #0
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:62:38: error: error in #{ ... #}
  \alignGrob #TextScript #'Slur #0
 #0
align.ly:64:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'StaffSymbol #0 #0
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:64:45: error: error in #{ ... #}
  \alignGrob #TextScript #'StaffSymbol #0
#0
align.ly:69:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'TimeSignature #-1 #-5
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:69:48: error: error in #{ ... #}
  \alignGrob #TextScript #'TimeSignature #-1
   #-5
align.ly:71:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'TimeSignature #1 #-5
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:71:47: error: error in #{ ... #}
  \alignGrob #TextScript #'TimeSignature #1
  #-5
align.ly:75:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'Stem #0 #-5.5
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:75:38: error: error in #{ ... #}
  \alignGrob #TextScript #'Stem #0
 #-5.5
align.ly:77:3: error: bad grob property path (TextScript)

  \alignGrob #TextScript #'Accidental #0 #0
align.ly:7:54: warning: Ignoring non-music expression
\overrideProperty  $grob-to-align #'extra-offset
 #(lambda (grob)
align.ly:77:44: error: error in #{ ... #}
  \alignGrob #TextScript #'Accidental #0
   #0
align.ly:82:3: error: bad grob property path (Stem)

  

Re: Ragged right for contents but not staff?

2014-03-13 Thread Matthias Hüsken

On 13.03.2014 15:14, Pierre Perol-Schneider wrote:

2014-03-13 14:14 GMT+01:00 Matthias Hüsken
matthias.hues...@math.uni-wuppertal.de
mailto:matthias.hues...@math.uni-wuppertal.de:


I know this thread is ancient, but I am only now in the process of
upgrading from Lilypond 2.12.2 to 2.18, and I used the attached
function alignGrob quite heavily. Unfortunately, it does not work in
2.18 any more, and I do not know enough about the Lilypond internals
(and about scheme) to fix it myself. Here is what happens if I try
to compile the attached file from David:


Hi Matthias,
see enclosed file.

HTH,
Pierre


Hi Pierre,

I had a feeling it would be something really easy... Thanks a lot!!!

Cheers, Matthias



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


Staff/chords spacing.

2014-03-13 Thread Matthias Hüsken

Dear all,

I ran into another problem when updating my scores from 2.12 to 2.18 due 
to the changes in the vertical alignment calculation. What I have:


* a StaffGroup consisting of two Staffs
* a ChordLine in between

I want the two Staffs spaced evenly at the same distance (done, see 
below), and I'd like to have the ChordLine vertically centered between 
the two Staffs. Which I have not been able to do until now...


What I came up with: I'm breaking lines manually and set the distance 
between the staffs manually. I tried to set staff-affinity to CENTER to 
get the desired effect, but it does not seem to work. I'm using the 
following code at the moment:


\override VerticalAxisGroup.staff-affinity = #CENTER
\overrideProperty Score.NonMusicalPaperColumn.line-break-system-details
  #'((alignment-distances . (13.2 13.2)))
\break

Any idea what I am doing wrong or how I could fix it? Or should I use a 
different approach? I'd be grateful for pointers in the right direction...


Thanks,

Matthias


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


Re: remove system_start_delimiter

2011-02-24 Thread Matthias Hüsken
 1. How do I remove the system_start_delimiter (large opening brace) at the 
 start
of the score? I've tried a number of things to remove the brace but none
were successful.

You can remove the opening brace by setting the following for the
PianoStaff context (add to your \layout block):

\context {
\PianoStaff
systemStartDelimiter = #'SystemStartBar
} % context

 2. How do I globally set markup text to be in times font? I.e., I want to do
something like this:
 
\override TextSpanner #'font-name = #times
 
but for markup text *THROUGHOUT* the entire score.

Add the following to your \paper block:

myStaffSize = #20
#(define fonts
(make-pango-font-tree Times Times Luxi Mono
(/ myStaffSize 20)))

The three font names stand for serif, sans serif, and mono font (I'm not
completely sure about the order though...), just add the desired fonts
there.

Only drawback: This changes *all* text in your score to the new font.


Cheers,

Matthias

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


Re: Overriding bar-line behaviour

2011-02-17 Thread Matthias Hüsken
  What I'd like to achieve:
  When ending a bar with the repetition sign :|,
  I need double lines (||) at the beginning of the next bar.

 It looks as though you actually mean ending/beginning lines, not bars.

Basically, yes.

  [...]
  (:|| . (:| . ||))
  [...]
  Unfortunately, this does not work:
  LilyPond leaves the  end of the line [...] empty,
  as well as the beginning of the next line.

 Lilypond's barline.cc doesn't recognise your bartype string :||
 and quietly sets the bartype to empty before continuing.
 So unless you extend the C++ hardcoding you are limited
 to the bartypes listed in the bar-line-interface documentation.

Well, I do not think the problem actually lies in the C++ code but in the way 
I tried to override bar-glyph-alist - when I change the code in 
scm/output-lib.scm, it does work... even with \bar :||.

 If you will be using explicit line breaks like in your snippet I would
 suggest a \once-like approach as in the attached barRightrepeatDouble.ly.

This solution works perfectly, thanks a lot! What I actually use is this code:

barCustom =
#(define-music-function (parser location one two) (string? string?)
#{
\once \override Score.BarLine #'break-visibility = #all-visible
\once \override Score.BarLine #'glyph-name = #(lambda(grob)
(if (not (= (ly:item-break-dir grob) RIGHT)) $one $two))
#})

and then e.g. \barCustom :| ||

There is only one detail that need additional attention: It is not possbile to 
change the bar lines at the beginning of the first line with this method. I 
found the following workaround:

% start first line with repeat
\bar |:
% start first line with thick double lines
\bar .|
% start first line with thin double lines
\once \override Score.BarLine #'glyph-name = || \bar |:


Thanks again for finding a solution!

Matthias


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


Variables syntax problem

2011-02-17 Thread Matthias Hüsken
Dear all,

I got another problem I am not able to solve. I change the title of the header 
so that the tempo is included, see attached file. This works nicely, but I 
have not been able to substitute the duration in the \note declaration by 
some variable, i.e. I'd like to be able to do something like

\myTempoNote = 4.

\note #\myTempoNote #UP

What is the correct syntax to pass \myTempoNote to \note?

Thanks

Matthias
\version 2.12.2

myTitle = Song Title
myTempo = 120
myTempoNote = 4

\header
{
title = \markup
{
\override #'(style . cross) { \note #4 #UP  =  \myTempo }
\hspace #7 \myTitle \hspace #7
\small { written by some guy... }
}
}

\new Staff { g'1 }
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variables syntax problem

2011-02-17 Thread Matthias Hüsken
  I got another problem I am not able to solve. I change the title of the
  header so that the tempo is included, see attached file. This works
  nicely, but I have not been able to substitute the duration in the \note
  declaration by some variable, i.e. I'd like to be able to do something
  like
 
  \myTempoNote = 4.
 
  \note #\myTempoNote #UP
 
  What is the correct syntax to pass \myTempoNote to \note?

 Isn't it \note #myTempoNote #UP

 That works for me with 2.13.50. I don't have 2.12 installed.

Yes, it works like that. Somehow I knew it would be too easy for me... Thanks 
a lot!

Matthias


-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de


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


Re: Use custom font's flat (b) and sharp (#) symbols for chords

2011-02-16 Thread Matthias Hüsken
Hi again,

thx so far. Sorry for my English, I think I did not make myself clear enough, 
so I'll try to elaborate a little more.

What I have:

- I am setting notes and chords.
- I changed the font for the chords to a custom one (real book style).
- Notes (and related accidentals like flat and sharp) are set as usual.
- Chord names (and options like 7, sus4 etc.) are set in the custom font.
- Chord accidentals (like the b in A flat (Ab) or the # in F sharp (F#)
  are set with the symbols from Lilypond's font (i.e. accidentals.sharp and
  accidentals.flat from the Feta font).
- Accidentals in chord options (like the b in 7/b9) are set using Feta.

What I'd like to have:

- The output of notes and related accidentals should remain as is.
- Chord accidentals (i.e. for chord names like Ab as well as for chord.
  options like 7/#9) should be set using the b and # from the custom
  font.

Possible options and problems:

1. I could make Lilypond use the custom font's symbols for flat and sharp by
   default like suggested (i.e. fiddling with the font directory).
   Disadvantage: Accidentals for regular notes would also be set with b
   and # from the custom font.
2. I could make Lilypond set chord options (7/b5 etc.) using the custom b
   and # by adding exceptions for all needed chords to
   sequential-music-to-chord-exceptions. Problem: All accidentals in chords
   (e.g. in Ab or F#) would still use the symbols from Feta.

While option 1. is not viable (I do not want to lose Lilypond's accidentals 
for regular notes), option 2. partly solves the problem (for chord options), 
but then I would have two different types of accidentals when setting chords.

So, what I would ideally like to have is a way of making Lilypond use b 
and # from a custom font, but exclusively in chord mode. I did quite some 
searching but did not come up with anything useful, so I already feared it 
might not be easy (or doable at all...).

Any ideas?

Thanks

Matthias

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


Use custom font's flat (b) and sharp (#) symbols for chords

2011-02-16 Thread Matthias Hüsken
Hi everyone,

I'm new to Lilypond and impressed with the ease of writing music and the 
quality of the output.

For writing lead sheets, I changed Lilypond's standard font for printing chord 
names to a custom font. While this works perfectly, the style difference 
between the chord symbols and Lilypond's flat and sharp symbols is very 
obvious. Is there a way to make Lilypond use the custom font's b and # 
symbols instead of the internal ones?

Thanks in advance,

Matthias


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


Re: Use custom font's flat (b) and sharp (#) symbols for chords

2011-02-16 Thread Matthias Hüsken
  So, what I would ideally like to have is a way of making Lilypond use b
  and # from a custom font, but exclusively in chord mode. I did quite
  some searching but did not come up with anything useful, so I already
  feared it might not be easy (or doable at all...).

 I think you can achieve what you want by writing a scheme function
 similar to those defined in scm/chord-names.scm.

 See for example the definition of note-name-german-markup.
 There you find that accidentals are replaced by -es -eses -is or -isis,
 respectively. So you could copy most of this definition and place
 your custom glyphs in there.

That's actually quite a good idea. Based on your idea, the following should do 
the trick:

#(define my-alteration-glyph-name-alist
 '(
   ;; ordered for optimal performance.
   (0 . )
   (-1/2 . #)
   (1/2 . b)

   ))

#(define (my-alteration-text-accidental-markup alteration)
  (make-smaller-markup
   (make-raise-markup
(if (= alteration FLAT)
0.3
0.6)
(make-text-markup
 (assoc-get alteration my-alteration-glyph-name-alist )


My only problem is: How do I get this code to work, i.e. how do I get LilyPond 
to use this code in chord-mode? I assume I would need to somehow activate it 
in the ChordNames context, bit how does this actually work?

Matthias


-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de


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


Re: Use custom font's flat (b) and sharp (#) symbols for chords (solved)

2011-02-16 Thread Matthias Hüsken
Hi again,

thanks a lot for the pointers in the right direction, I finally got my problem 
solved. It is based on the solution found here:
http://www.mailinglistarchive.com/lilypond-user@gnu.org/msg02286.html

In case someone else stumbles upon this problem, here is my (shortened) 
solution:


% correct markup for b and # (use symbols from current font...)
chordFlat = \markup { \hspace #0.2 \fontsize #-1 \raise #0.1 b }
chordSharp = \markup { \hspace #0.1 \fontsize #-1 \lower #0.3 # }

% define custom chords
mhPopChordsMusic =
{
c e g bes-\markup { \super 7 }
% ... define all other possible chords here...
}

% Add to existing exceptions
mhPopChordsAdd = #(append
(sequential-music-to-chord-exceptions mhPopChordsMusic #t)
ignatzekExceptions)

% fix accidentals with some Scheme (using the current font's symbols)
#(define (mh-chord-name-pop-markup pitch)
  (let* ((alt (ly:pitch-alteration pitch)))
  (make-line-markup
(list
  (make-simple-markup (vector-ref #(C D E F G A B
  (ly:pitch-notename pitch)))
  ;; If it's natural, do nothing
  (if (= alt 0)
(make-line-markup (list empty-markup))
(if (= alt FLAT)
  ;; Otherwise, handle adding the flat symbol
  (make-line-markup
(list
  (make-hspace-markup 0.3) ;; WAS: 0.4
  (make-small-markup (make-raise-markup 0.7
(make-text-markup b)))
))
  ;; or handle adding the sharp symbol
  (make-line-markup
(list
  (make-hspace-markup 0.1) ;; WAS: 0.2
  (make-small-markup (make-raise-markup 0.7
(make-text-markup #)))
))
)
)

% % use like this:
%
% {
% popChords =
% {
% \set chordNameExceptions = #mhPopChordsAdd
% \set chordRootNamer = #mh-chord-name-pop-markup
% }
% }
% 
% % or like this:
%
% \layout
% {
% \context
% {
% \Score
% chordNameExceptions = #mhPopChordsAdd
% chordRootNamer = #mh-chord-name-pop-markup
% }
% }


Thanks again!

Matthias


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


Overriding bar-line behaviour

2011-02-16 Thread Matthias Hüsken
Hi again,

while trying to change LilyPond's behaviour concerning bar lines, I stumbled 
upon some strange behaviour. What I'd like to achieve: When ending a bar with 
e repetition sign :|, I need double lines (||) at the beginning of the 
next bar.

I found bar-glyph-alist in scm/output-lib.scm and decided to change it to the 
following lines (shortened for this example):

#(define bar-glyph-alist
  '(
;; regular bar
(| . (| . ()))
;; repetitions
(|: . (| . |:))
(:| . (:| . ()))
(:|: . (:| . |:))
;; double lines
(|| . (|| . ()))
;; double lines combined with repetitions
(||: . (|| . |:))
(:|| . (:| . ||))
))

When setting music now, everything works as expected.

As I consider changing LilyPond's default files as hacking, I decided to move 
the list into my .ly file (see attached file) and revert scm/output-lib.scm 
to its original state. Unfortunately, this does not work: LilyPond leaves the 
end of the line (where a repetition sign :| should be found) empty, as well 
as the beginning of the next line.

Does anyone have any clues what's going wrong?

Thanks,

Matthias

\version 2.12.2

% override default bar types to allow arbitrarily placed bar lines
#(define my-bar-glyph-alist
  '(
;; regular bar
(| . (| . ()))
;; repetitions
(|: . (| . |:))
(:| . (:| . ()))
(:|: . (:| . |:))
;; double lines
(|| . (|| . ()))
;; double lines combined with repetitions
(||: . (|| . |:))
(:|| . (:| . ||))
))

#(define (my-bar-line::calc-glyph-name grob)
  (let* (
  (index-cell (lambda (cell dir)
(if (equal? dir 1)
(cdr cell)
(car cell
  (glyph (ly:grob-property grob 'glyph))
  (dir (ly:item-break-dir grob))
  (result (assoc glyph  my-bar-glyph-alist))
  (glyph-name (if (= dir CENTER)
glyph
(if (and result (string? (index-cell (cdr result) dir)))
(index-cell (cdr result) dir)
#f)))
)
  glyph-name
  ))


\new Score
{
\new Staff
{
\override Staff.BarLine #'glyph-name = #my-bar-line::calc-glyph-name

\bar |: g'1 \bar :|| \break
g'1 \bar || \break
}
}
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Overriding bar-line behaviour

2011-02-16 Thread Matthias Hüsken
Sorry for the noise on the mailing list - I knew it was some stupid mistake... 
I tried to override the wrong value, it should have been

\override Score.BarLine #'break-glyph-function = #my-bar-line::calc-glyph-name

instead of

\override Staff.BarLine #'glyph-name = #my-bar-line::calc-glyph-name

Corrected file attached. Cheers,

Matthias



Am Mittwoch, 16. Februar 2011 schrieb Matthias Hüsken:
 Hi again,

 while trying to change LilyPond's behaviour concerning bar lines, I
 stumbled upon some strange behaviour. What I'd like to achieve: When ending
 a bar with e repetition sign :|, I need double lines (||) at the
 beginning of the next bar.

 I found bar-glyph-alist in scm/output-lib.scm and decided to change it to
 the following lines (shortened for this example):

 #(define bar-glyph-alist
   '(
 ;; regular bar
 (| . (| . ()))
 ;; repetitions
 (|: . (| . |:))
 (:| . (:| . ()))
 (:|: . (:| . |:))
 ;; double lines
 (|| . (|| . ()))
 ;; double lines combined with repetitions
 (||: . (|| . |:))
 (:|| . (:| . ||))
 ))

 When setting music now, everything works as expected.

 As I consider changing LilyPond's default files as hacking, I decided to
 move the list into my .ly file (see attached file) and revert
 scm/output-lib.scm to its original state. Unfortunately, this does not
 work: LilyPond leaves the end of the line (where a repetition sign :|
 should be found) empty, as well as the beginning of the next line.

 Does anyone have any clues what's going wrong?

 Thanks,

 Matthias



-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de

\version 2.12.2

% override default bar types to allow arbitrarily placed bar lines
#(define my-bar-glyph-alist
  '(
;; regular bar
(| . (| . ()))
;; repetitions
(|: . (| . |:))
(:| . (:| . ()))
(:|: . (:| . |:))
;; double lines
(|| . (|| . ()))
;; double lines combined with repetitions
(||: . (|| . |:))
(:|| . (:| . ||))
))

#(define (my-bar-line::calc-glyph-name grob)
  (let* (
  (index-cell (lambda (cell dir)
(if (equal? dir 1)
(cdr cell)
(car cell
  (glyph (ly:grob-property grob 'glyph))
  (dir (ly:item-break-dir grob))
  (result (assoc glyph  my-bar-glyph-alist))
  (glyph-name (if (= dir CENTER)
glyph
(if (and result (string? (index-cell (cdr result) dir)))
(index-cell (cdr result) dir)
#f)))
)
  glyph-name
  ))


\new Score
{
\new Staff
{
\override Score.BarLine #'break-glyph-function = 
#my-bar-line::calc-glyph-name
\bar |: g'1 \bar :|| \break
g'1 \bar || \break
}
}
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Overriding bar-line behaviour

2011-02-16 Thread Matthias Hüsken
Ok, I give up for tonight - obviously, before writing my last mail I tested 
while having the new barline definitions in scm/output-lib.scm (instead of 
reverting that file).

Which means I cannot get things to work without modifying scm/output-lib.scm. 
Any ideas how to put this into a .ly file are most welcome...

Matthias


Am Mittwoch, 16. Februar 2011 schrieb Matthias Hüsken:
 Sorry for the noise on the mailing list - I knew it was some stupid
 mistake... I tried to override the wrong value, it should have been

 \override Score.BarLine #'break-glyph-function =
 #my-bar-line::calc-glyph-name

 instead of

 \override Staff.BarLine #'glyph-name = #my-bar-line::calc-glyph-name

 Corrected file attached. Cheers,

 Matthias

 Am Mittwoch, 16. Februar 2011 schrieb Matthias Hüsken:
  Hi again,
 
  while trying to change LilyPond's behaviour concerning bar lines, I
  stumbled upon some strange behaviour. What I'd like to achieve: When
  ending a bar with e repetition sign :|, I need double lines (||) at
  the beginning of the next bar.
 
  I found bar-glyph-alist in scm/output-lib.scm and decided to change it to
  the following lines (shortened for this example):
 
  #(define bar-glyph-alist
'(
  ;; regular bar
  (| . (| . ()))
  ;; repetitions
  (|: . (| . |:))
  (:| . (:| . ()))
  (:|: . (:| . |:))
  ;; double lines
  (|| . (|| . ()))
  ;; double lines combined with repetitions
  (||: . (|| . |:))
  (:|| . (:| . ||))
  ))
 
  When setting music now, everything works as expected.
 
  As I consider changing LilyPond's default files as hacking, I decided to
  move the list into my .ly file (see attached file) and revert
  scm/output-lib.scm to its original state. Unfortunately, this does not
  work: LilyPond leaves the end of the line (where a repetition sign :|
  should be found) empty, as well as the beginning of the next line.
 
  Does anyone have any clues what's going wrong?
 
  Thanks,
 
  Matthias



-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de


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


Use custom font's flat (b) and sharp (#) symbols for chords

2011-02-15 Thread Matthias Hüsken
Hi everyone,

I'm new to Lilypond and impressed with the ease of writing music and the 
quality of the output.

For writing lead sheets, I changed Lilypond's standard font for printing chord 
names to a custom font. While this works perfectly, the style difference 
between the chord symbols and Lilypond's flat and sharp symbols is very 
obvious. Is there a way to make Lilypond use the custom font's b and # 
symbols instead of the internal ones?

Thanks in advance,

Matthias


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


Re: Use custom font's flat (b) and sharp (#) symbols for chords

2011-02-15 Thread Matthias Hüsken
Thx for the answer!

 )For writing lead sheets, I changed Lilypond's standard font for printing
 )chord names to a custom font. While this works perfectly, the style
 )difference between the chord symbols and Lilypond's flat and sharp
 )symbols is very obvious. Is there a way to make Lilypond use the custom
 )font's b and #
 )symbols instead of the internal ones?
 )
 ---

 Not easily. The flat and sharp glyphs are 'hard coded' as it were.

 http://lilypond.org/doc/v2.13/Documentation/notation/the-feta-font#accident
al-glyphs

 While LilyPond can use other specially design fonts, for instance see:

 http://www.chiark.greenend.org.uk/~sgtatham/gonville/  (we do mention this
 in our Documentation but all the installation instructions are here)

 This still has a hard coded glyph. It may be nearer to what you need
 though?

 You would need to replace the specific glyph for the sharp and flat
 manually within the 'fonts' directory that is installed with LilyPond -
 which is what the above link does for its own font. I don't know how easy
 that would be for you to do - it's certainly beyond my knowledge.

I already found this solution, but to me, it looks like overkill to simply 
replace two symbols. Especially as I need the changed symbols only in 
chordmode - for notes, LiliPond's are perfect.

 Alternatively you could use the LilyPond glyph within the chordname by
 using the \flat and \sharp markup.

I'm not sure I understand - I do not want to use LilyPond's glyphs in chord 
names, but custom ones...


For my purposes, it would just like to be able to redefine the sharp and flat 
symbols only for the chord mode, but I did not find any easy solution... and 
I do not know if this is even possible.

Matthias


-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de


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