Re: exact dimenions of pdf/png

2012-11-03 Thread Werner LEMBERG

 The usage manual however (section 4.4) tells me to do this:

   lilypond -dbackend=eps \
-dno-gs-load-fonts \
-dinclude-eps-fonts \
--png \
-dresolution=1200 \
figure.ly

 That results in a png that is too wide.  There seems another
 mechanism at work to determine size of resulting image.  Cropping?

 I seem to remember some slop added for the sake of the manual or
 something.  Werner?

There is some extra offset for lilypond-book (via `eps-box-padding'
IIRC).  Unfortunately, the bbox calculation within LilyPond has
problems; for example, beams are not correctly taken into account -- I
think there is a bug report already for this.

If you really need the tightest PNG image possible, I suggest to use
margins on all sides, then using a different program like `pnmcrop' to
remove the borders.

 I have no idea why the more complex options would be recommended here:
 when converting to PNG anyhow, it would seem quite irrelevant to me
 which fonts are getting embedded or not in the intermediate EPS file.

Correct.


Werner

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


Dashed bar-line bug

2012-11-03 Thread Jakub Pavlík
Hi,

I believe I've just discovered a bug.
Running the development version of lily
(2.17.5, commit bc4b56a8dee39a1fa3f40ac329ab0754d46fc56f )

the following snippet produces two notes next to each other, without any
visible barline at all. See the attached image.
I checked it in the current documentation and it seems that the dashed
barline ought to work as it did in 2.15.
( http://lilypond.org/doc/v2.16/Documentation/notation/bars#bar-lines )

- snip

 \score {

\relative c' {

a \bar : a

}

}

--

Best wishes,
Jakub
attachment: dashedlinebug.png___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


How to specify lilypond exec option in Frascobaldi?

2012-11-03 Thread MING TSANG
Hi, fellow lily users:

I am executing lilypond by Frescobaldi.  How to specify lilypond options, eg 
--png in Frescobaldi (not as command-line)? 

 
Blessing in+,
Ming___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to specify lilypond exec option in Frascobaldi?

2012-11-03 Thread Federico Bruni

Il 03/11/2012 13:27, MING TSANG ha scritto:

Hi, fellow lily users:

I am executing lilypond by Frescobaldi. How to specify lilypond options,
eg --png in Frescobaldi (not as command-line)?
Blessing in+,
Ming


Use the custom compilation in the LilyPond menu

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


Re: Dashed bar-line bug

2012-11-03 Thread Jakub Pavlík
And - 2.16.0 is free of this bug.

J.


2012/11/3 Jakub Pavlík jkb.pav...@gmail.com

 Hi,

 I believe I've just discovered a bug.
 Running the development version of lily
 (2.17.5, commit bc4b56a8dee39a1fa3f40ac329ab0754d46fc56f )

 the following snippet produces two notes next to each other, without any
 visible barline at all. See the attached image.
 I checked it in the current documentation and it seems that the dashed
 barline ought to work as it did in 2.15.
 ( http://lilypond.org/doc/v2.16/Documentation/notation/bars#bar-lines )

 - snip

 \score {

 \relative c' {

 a \bar : a

 }

 }

 --

 Best wishes,
 Jakub

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


Re: Dashed bar-line bug

2012-11-03 Thread Thomas Morley
2012/11/3 Jakub Pavlík jkb.pav...@gmail.com:
 And - 2.16.0 is free of this bug.

 J.



 2012/11/3 Jakub Pavlík jkb.pav...@gmail.com

 Hi,

 I believe I've just discovered a bug.
 Running the development version of lily
 (2.17.5, commit bc4b56a8dee39a1fa3f40ac329ab0754d46fc56f )

 the following snippet produces two notes next to each other, without any
 visible barline at all. See the attached image.
 I checked it in the current documentation and it seems that the dashed
 barline ought to work as it did in 2.15.
 ( http://lilypond.org/doc/v2.16/Documentation/notation/bars#bar-lines )

 - snip

 \score {

 \relative c' {

 a \bar : a

 }

 }


 --

 Best wishes,
 Jakub



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


Hi,

no bug, but the barline-interface is heavily changed with 2.17.5.
http://lilypond.org/doc/v2.17/Documentation/changes-big-page.html

It's now very easy to define own custom-BarLines.

But there was need to change several strings.
: is now used _only_ for repeat-bar-lines, p.e. :|.
The dashed bar-line now needs !, and others.

See ‘scm/bar-line.scm’ for more details.

An example:

\version 2.17.5

% some custom-bars:
\defineBarLine :||.!.||: #'(:||.! !.||:  ||.!.||)
\defineBarLine :||.! #'(:||.! #f  ||.!)
\defineBarLine !.||: #'(| !.||: !.||)

m = \relative c' {
a \bar ! a \bar !
\break
a \bar :||.!.||: a \bar :||.!.||:
\break
a \bar !.||: a \bar :||.! a \bar !.||:
\break
a \bar :||.!
}

\score {
\new StaffGroup 
\new Staff \m
\new Staff \m

}


Regards
  Harm

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


Re: Changing staff size with custom note head stencils

2012-11-03 Thread Paul Morris

On Nov 2, 2012, at 4:45 PM, David Kastrup d...@gnu.org wrote:

 Paul Morris p...@paulwmorris.com writes:
 
 On Oct 31, 2012, at 7:11 PM, Paul Morris p...@paulwmorris.com wrote:
 
 That worked to avoid the error, but didn't seem quite right (since it
 didn't seem to matter what values you fed it).  So I checked the
 LilyPond source code (scm/output-ps.scm), and it seems like this is
 the better way to do it:
 
 upTriangle =
 #(ly:make-stencil
'(path 0.09
'(moveto -.1875 -.5
   this quote seems spurious.

Thanks David, I tried removing it, but I got the following error:

  In expression (moveto -0.1875 -0.5 ...)  [...]  Unbound variable: moveto

-Paul


  lineto .65625 .5
  lineto 1.5 -.5
  closepath
  )
'round  
'round  
#t  
)
(cons -.1875 1.5)
(cons -.5 .5)
 )


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


Re: Dashed bar-line bug

2012-11-03 Thread Jakub Pavlík
Ok.
I'm sorry for the noise
and thankful for the explanation.

Jakub


2012/11/3 Thomas Morley thomasmorle...@googlemail.com

 2012/11/3 Jakub Pavlík jkb.pav...@gmail.com:
  And - 2.16.0 is free of this bug.
 
  J.
 
 
 
  2012/11/3 Jakub Pavlík jkb.pav...@gmail.com
 
  Hi,
 
  I believe I've just discovered a bug.
  Running the development version of lily
  (2.17.5, commit bc4b56a8dee39a1fa3f40ac329ab0754d46fc56f )
 
  the following snippet produces two notes next to each other, without any
  visible barline at all. See the attached image.
  I checked it in the current documentation and it seems that the dashed
  barline ought to work as it did in 2.15.
  ( http://lilypond.org/doc/v2.16/Documentation/notation/bars#bar-lines )
 
  - snip
 
  \score {
 
  \relative c' {
 
  a \bar : a
 
  }
 
  }
 
 
  --
 
  Best wishes,
  Jakub
 
 
 
  ___
  lilypond-user mailing list
  lilypond-user@gnu.org
  https://lists.gnu.org/mailman/listinfo/lilypond-user
 

 Hi,

 no bug, but the barline-interface is heavily changed with 2.17.5.
 http://lilypond.org/doc/v2.17/Documentation/changes-big-page.html

 It's now very easy to define own custom-BarLines.

 But there was need to change several strings.
 : is now used _only_ for repeat-bar-lines, p.e. :|.
 The dashed bar-line now needs !, and others.

 See ‘scm/bar-line.scm’ for more details.

 An example:

 \version 2.17.5

 % some custom-bars:
 \defineBarLine :||.!.||: #'(:||.! !.||:  ||.!.||)
 \defineBarLine :||.! #'(:||.! #f  ||.!)
 \defineBarLine !.||: #'(| !.||: !.||)

 m = \relative c' {
 a \bar ! a \bar !
 \break
 a \bar :||.!.||: a \bar :||.!.||:
 \break
 a \bar !.||: a \bar :||.! a \bar !.||:
 \break
 a \bar :||.!
 }

 \score {
 \new StaffGroup 
 \new Staff \m
 \new Staff \m
 
 }


 Regards
   Harm

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


Re: Dashed bar-line bug

2012-11-03 Thread David Kastrup
Thomas Morley thomasmorle...@googlemail.com writes:

 no bug, but the barline-interface is heavily changed with 2.17.5.
 http://lilypond.org/doc/v2.17/Documentation/changes-big-page.html

 It's now very easy to define own custom-BarLines.

 But there was need to change several strings.
 : is now used _only_ for repeat-bar-lines, p.e. :|.
 The dashed bar-line now needs !, and others.

 See ‘scm/bar-line.scm’ for more details.

The convert-ly rules for 2.17.5 state

str = re.sub (barstring + r':', '\\1\\2;', str)

which is not really related to !.  Is this an oversight?

-- 
David Kastrup


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


Re: Function for rendering key textually in 3 languages

2012-11-03 Thread Olivier Biot
On Sat, Nov 3, 2012 at 1:09 AM, Olivier Biot olivier.b...@gmail.com wrote:
 On Tue, Oct 30, 2012 at 10:50 PM, Eluze elu...@gmail.com wrote:
 shutterfreak wrote
 Hi all,

 I'd like to have a function to translate a key signature into the
 textual representation of that key in 3 languages.

 For instance, I'd write this in my score:


 and the rendering would look like this:


 The logic I'm trying to implement, is (in pseudo-code):
 1. key format =
 key_name
  [
 accidentals
 ]
 2. IF
 key_name
  is lowercase THEN key is minor ELSE key is major.
 3. If accidentals are added, they pertain to the key name

 How should I proceed?

 I guess you should use some scheme code to

 - create those translations/associations (a table?)
 - concatenate the 3 translated elements
 - include them in your LilyPond code

 if you feel this could be of general interest you should file an enhancement
 request.

 hth
 Eluze

 Hi Eluze,

 I am not yet fluent in Scheme, hence I need some indications in how to 
 proceed.

 It would be extremely helpful if I would know how to e.g. translate
 c+ into C sharp minor and D into D major.

 Best regards,

 Olivier

Dear all,

I definitely have problems with Scheme and LilyPond interpretation. I
now have the Scheme standard open as well.

I tried to simplify the initial job by first creating a function with
one string argument returning either a string or a markup. Does not
work.

I tried hundreds of alternatives, with musoc-function and withj
markup-command, with a define and define-scheme-funciton, to no avail.

Why is the following not working?

%%% BEGIN SNIPPET

\version 2.16.0

#(define-markup-command (tonicEN props layout tonic) ( string? )
(
(cond
( (string=? tonic 'cis) (C sharp) )
( (string=? tonic 'dis) (D sharp) )
)
)
)

\header {
  composer = myself
  title = \tonicEN cis
}

\score {
  \relative c' {
a bes cis deses e fisis ges
  }
  \layout {}
}

%%% END SNIPPET

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


Re: Show (and increment) bar numbers only after a double bar

2012-11-03 Thread Thomas Morley
2012/11/1 Olivier Biot olivier.b...@gmail.com:
 Hi all,

 Is there a way to display and increment bar numbers only after a double bar?
[...]

Hi Olivier,

why not use RehearsalMark?

\version 2.17.5

barMark = { \bar || \mark \default }

\relative c' {
\set Score.markFormatter = #format-mark-circle-numbers
c1  
\barMark
e
f
\barMark
\break
g
}

A function is possible, too:

\version 2.17.5

doubleBarMark =
#(define-music-function (parser location music) (ly:music?)
  (music-map (lambda (m)
(if (eq? 'ContextSpeccedMusic (ly:music-property m 'name))
  (let* ((elt (ly:music-property m 'element))
 (prop-set (ly:music-property elt 'name))
 (value (ly:music-property elt 'value))
 (symbol (ly:music-property elt 'symbol)))

(if (and (eq? prop-set 'PropertySet) ;; needed?
 (equal? value ||)
 (eq? symbol 'whichBar)) ;; needed?
  (set! m (make-sequential-music
 (list (make-music
 'SequentialMusic
 'elements
 (list
   m
   (make-music
 'MarkEvent
 'label '() )
  m)
  music))

%--- test

mus =
\relative c' {
\doubleBarMark {
c1  
\bar ||
e
f
\bar ||
\break
g
}
}

musII =
\relative d' {
  \key d \minor
  \clef bass
  \time 3/8
  \bar ||
  a16-.-\upbow b (c) d(c) b (
  a) b (c) d(c) b-\laissezVibrer \bar ||
  a16 (b) c(d) c(b)
  a (b c d c) b-. \bar ||
  a b c d c b
  a (b c d) c (b) \bar ||
  a (b) c-. d-. c b
  a16 (b) c(d) c(b)
  a (b c d c) b-. \bar ||
  a b c d c b
  a (b c d) c (b) \bar ||
  a (b) c-. d-. c b
}

\score {
  \new StaffGroup 
\new Staff \doubleBarMark \musII
\new Staff \doubleBarMark \musII
  
  \layout {
 \context {
 \Score
 markFormatter = #format-mark-circle-numbers
 \override BarNumber #'stencil = #point-stencil
 %\override RehearsalMark #'X-extent = #'(0 . 0)
 \override RehearsalMark #'break-align-symbols =
#'(staff-bar time-signature key-signature clef left-edge)
 }
 \context {
 \Staff
 \remove Time_signature_engraver
 \remove Clef_engraver
 \remove Key_engraver
 }
  }
}



HTH,
  Harm

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


Re: Dashed bar-line bug

2012-11-03 Thread Thomas Morley
2012/11/3 David Kastrup d...@gnu.org:
[...]

 The convert-ly rules for 2.17.5 state

 str = re.sub (barstring + r':', '\\1\\2;', str)

 which is not really related to !.  Is this an oversight?

No.

Rereading Jakub's initial mail, I think he confused dotted with dashed.

In 2.16.0 : was used for the _dotted-bar_ _and_ for the colon in a
repeat-bar-line.
The dotted-bar is now assigned with ;
The dashed-bar with !
In 2.17.5 : is assigned to the colon of a repeat-bar-line, only.

-Harm

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


Re: Function for rendering key textually in 3 languages

2012-11-03 Thread David Kastrup
Olivier Biot olivier.b...@gmail.com writes:

 I definitely have problems with Scheme and LilyPond interpretation. I
 now have the Scheme standard open as well.

 I tried to simplify the initial job by first creating a function with
 one string argument returning either a string or a markup. Does not
 work.

 I tried hundreds of alternatives, with musoc-function and withj
 markup-command, with a define and define-scheme-funciton, to no avail.

 Why is the following not working?

 %%% BEGIN SNIPPET

 \version 2.16.0

 #(define-markup-command (tonicEN props layout tonic) ( string? )
 (
 (cond
 ( (string=? tonic 'cis) (C sharp) )
 ( (string=? tonic 'dis) (D sharp) )
 )
 )
 )

One reason is because markup commands have rather rudimentary argument
parsing (to make you appreciate the work done on music functions more,
ha ha) and distinguish only markup, markup list, and Scheme as argument
type.  A quoted LilyPond string counts only as markup.  And markup
commands can only be used inside of explicit markup.

Then you use ( ) where they don't belong.  Remember: those are _not_
mere grouping constructs but form a list.  And a list of lists is
something different from a list.  In evaluated contexts (like this is),
( ) are a function call.  So you try calling C sharp as a function
(which does not work) and call the result of the cond as a function
again (which also does not work).

Just because Scheme seems to be crawling with parens does not mean that
you can throw in a few more and hope that nobody will notice.

'cis is awfully awkward (strings are self-quoting and don't need '
before them) but not actually wrong.

 \header {
   composer = myself
   title = \tonicEN cis
 }

You would likely have to write

title = \markup \tonicEN #cis

here after fixing the above definition.  Alternatively, use

tonicEn =
#(define-scheme-function (parser layout tonic) (string?) ...

in which case title = \toniEN cis should work fine.  With the current
development version, you should be able to use \tonicEN pretty much
everywhere a string can be used, with 2.16.0 the uses will likely be
more restrained.  On the right side of an assignment or as a function
argument, however, should work fine all the time.

-- 
David Kastrup


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


Re: Show (and increment) bar numbers only after a double bar

2012-11-03 Thread Olivier Biot
On Sat, Nov 3, 2012 at 5:42 PM, Thomas Morley
thomasmorle...@googlemail.com wrote:
 2012/11/1 Olivier Biot olivier.b...@gmail.com:
 Hi all,

 Is there a way to display and increment bar numbers only after a double bar?
 [...]

 Hi Olivier,

 why not use RehearsalMark?
[...]
 A function is possible, too:
[...]

 HTH,
   Harm

Hi Thomas,

Many thanks for providing both approaches! I'm learning a lot with
both examples. The simplest approach with rehearsal marks is the one I
am implementing now.

Now I only need to devise a way to emulate the double bar at the start
of each score line.

Best regards,

Olivier

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


Re: Function for rendering key textually in 3 languages

2012-11-03 Thread Olivier Biot
On Sat, Nov 3, 2012 at 5:54 PM, David Kastrup d...@gnu.org wrote:
 Olivier Biot olivier.b...@gmail.com writes:

 I definitely have problems with Scheme and LilyPond interpretation. I
 now have the Scheme standard open as well.

 I tried to simplify the initial job by first creating a function with
 one string argument returning either a string or a markup. Does not
 work.

 I tried hundreds of alternatives, with musoc-function and withj
 markup-command, with a define and define-scheme-funciton, to no avail.

 Why is the following not working?

[...]

 One reason is because markup commands have rather rudimentary argument
 parsing (to make you appreciate the work done on music functions more,
 ha ha) and distinguish only markup, markup list, and Scheme as argument
 type.  A quoted LilyPond string counts only as markup.  And markup
 commands can only be used inside of explicit markup.

 Then you use ( ) where they don't belong.  Remember: those are _not_
 mere grouping constructs but form a list.  And a list of lists is
 something different from a list.  In evaluated contexts (like this is),
 ( ) are a function call.  So you try calling C sharp as a function
 (which does not work) and call the result of the cond as a function
 again (which also does not work).

 Just because Scheme seems to be crawling with parens does not mean that
 you can throw in a few more and hope that nobody will notice.

 'cis is awfully awkward (strings are self-quoting and don't need '
 before them) but not actually wrong.

 \header {
   composer = myself
   title = \tonicEN cis
 }

 You would likely have to write

 title = \markup \tonicEN #cis

 here after fixing the above definition.  Alternatively, use

 tonicEn =
 #(define-scheme-function (parser layout tonic) (string?) ...

 in which case title = \toniEN cis should work fine.  With the current
 development version, you should be able to use \tonicEN pretty much
 everywhere a string can be used, with 2.16.0 the uses will likely be
 more restrained.  On the right side of an assignment or as a function
 argument, however, should work fine all the time.

 --
 David Kastrup


Hi David,

Thanks a lot - I now start to see the mistakes I made (excess
parentheses around the cond expression and excess parentheses around
the return values in the cond sub expressions).

I have however to use quotes around the note name for it to work.

Here's code that actually works, maybe it can be useful for others:

%%% BEGIN SNIPPET
\version 2.16.0

tonicEN = #(define-scheme-function (parser layout tonic) (string?)
(
cond
( (string=? tonic cis) C sharp )
( (string=? tonic dis) D sharp )
)
)

\header {
  composer = myself
  title = \tonicEN cis
}

\score {
  \relative c' {
a bes cis deses e fisis ges
  }
  \layout {}
}
%%% END SNIPPET

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


Re: Show (and increment) bar numbers only after a double bar

2012-11-03 Thread Thomas Morley
2012/11/3 Olivier Biot olivier.b...@gmail.com:
[...}
 Now I only need to devise a way to emulate the double bar at the start
 of each score line.

After an idea of Mats Bengtsson:

\version 2.17.5

doubledSystemStartBar =
\override Score.SystemStartBar #'stencil =
  #(lambda (grob)
(ly:grob-set-property! grob 'collapse-height 1)
(let* ((stil (ly:system-start-delimiter::print grob))
   (staff-space (ly:staff-symbol-staff-space grob))
   (staff-line-thickness (ly:staff-symbol-line-thickness grob))
   (pddng (* 0.3 staff-space))
   (new-stil (ly:stencil-combine-at-edge
stil
X
RIGHT
stil
pddng)))

  (ly:grob-set-property! grob 'padding (* -1 (+ pddng (* 2
staff-line-thickness
  new-stil))

Use it in the voice or

  \layout {
 \context {
 \Score
 \doubledSystemStartBar
 }
  }


Cheers,
  Harm

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


Re: Show (and increment) bar numbers only after a double bar

2012-11-03 Thread Olivier Biot
On Sat, Nov 3, 2012 at 6:58 PM, Thomas Morley
thomasmorle...@googlemail.com wrote:
 2012/11/3 Olivier Biot olivier.b...@gmail.com:
 [...}
 Now I only need to devise a way to emulate the double bar at the start
 of each score line.

 After an idea of Mats Bengtsson:

[...]

Thank you again Thomas, this does exactly what I wanted! I wouldn't
have been able to code this on my own.

Best regards,

Olivier

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


Re: Function for rendering key textually in 3 languages

2012-11-03 Thread Olivier Biot
On Sat, Nov 3, 2012 at 6:11 PM, Olivier Biot olivier.b...@gmail.com wrote:
 Hi David,

 Thanks a lot - I now start to see the mistakes I made (excess
 parentheses around the cond expression and excess parentheses around
 the return values in the cond sub expressions).

 I have however to use quotes around the note name for it to work.

 Here's code that actually works, maybe it can be useful for others:

[...]

I now got the method to use 2 parameters and produce the key signature in text:

%%% START of snippet 1
tonicEN = #(define-scheme-function (parser layout tonic arg) (string? string?)
 (string-append
  (cond
   ( (string=? tonic a) A )
   ( (string=? tonic b) B )
   ( (string=? tonic c) C )
   ( (string=? tonic d) D )
   ( (string=? tonic e) E )
   ( (string=? tonic f) F )
   ( (string=? tonic g) G )

   ( (string=? tonic aes) A flat )
   ( (string=? tonic bes) B flat )
   ( (string=? tonic ces) C flat )
   ( (string=? tonic des) D flat )
   ( (string=? tonic ees) E flat )
   ( (string=? tonic fes) F flat )
   ( (string=? tonic ges) G flat )

   ( (string=? tonic ais) A sharp )
   ( (string=? tonic bis) B sharp )
   ( (string=? tonic cis) C sharp )
   ( (string=? tonic dis) D sharp )
   ( (string=? tonic eis) E sharp )
   ( (string=? tonic fis) F sharp )
   ( (string=? tonic gis) G sharp )
   )
  (cond
   ( (string=? arg major)  major )
   ( (string=? arg minor)  minor )
   )
  )
 )
%%% END of snippet 1

I have a similar tonicDE and tonicFR function now. I can call only one
of those and assign the value to a header parameter (e.g., title).

What I now need to figure out, is how to print the output in a markup,
like in the currently not working snippets below:

%%% START of snippet 2
\header {
  title = \markup {\italic \tonicEN cis minor}
}
%%% END of snippet 2

%%% START of snippet 3
 \markup {
\fill-line {
  \center-column {
\concat {
  \italic \tonicEN cis minor
  \upright \tonicDE cis minor
}
  }
}
 }
%%% END of snippet 3

Best regards,

Olivier

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


Re: Changing staff size with custom note head stencils

2012-11-03 Thread David Kastrup
Paul Morris p...@paulwmorris.com writes:

 On Nov 2, 2012, at 4:45 PM, David Kastrup d...@gnu.org wrote:

 Paul Morris p...@paulwmorris.com writes:
 
 On Oct 31, 2012, at 7:11 PM, Paul Morris p...@paulwmorris.com wrote:
 
 That worked to avoid the error, but didn't seem quite right (since it
 didn't seem to matter what values you fed it).  So I checked the
 LilyPond source code (scm/output-ps.scm), and it seems like this is
 the better way to do it:
 
 upTriangle =
 #(ly:make-stencil
'(path 0.09
'(moveto -.1875 -.5
   this quote seems spurious.

 Thanks David, I tried removing it, but I got the following error:

   In expression (moveto -0.1875 -0.5 ...)  [...]  Unbound variable: moveto

Well, I haven't looked usage up in the manual but will take your word
for it as I don't know my way around the backend.  Seems like some
design decisions were involved with consequences I don't find intuitive,
or something else is at play here.

I'll certainly stand by my statement that the quote _seems_ spurious,
even though that may not be your fault but that of the make-stencil
design.

Sorry for the confusion.

-- 
David Kastrup

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


Re: Function for rendering key textually in 3 languages

2012-11-03 Thread David Kastrup
Olivier Biot olivier.b...@gmail.com writes:

 On Sat, Nov 3, 2012 at 6:11 PM, Olivier Biot olivier.b...@gmail.com wrote:
 Hi David,

 Thanks a lot - I now start to see the mistakes I made (excess
 parentheses around the cond expression and excess parentheses around
 the return values in the cond sub expressions).

 I have however to use quotes around the note name for it to work.

 Here's code that actually works, maybe it can be useful for others:

 tonicEN = #(define-scheme-function (parser layout tonic arg) (string? string?
 of those and assign the value to a header parameter (e.g., title).

 What I now need to figure out, is how to print the output in a markup,
 like in the currently not working snippets below:

 %%% START of snippet 2
 \header {
   title = \markup {\italic \tonicEN cis minor}

That's inside of a markup.  I _think_ this should work in current 2.17
with define-scheme-function, but likely not in 2.16.

So you'll need a define-markup-command after all to use inside of
\markup, and best give it two markup? arguments (if the arguments are
not plain strings, you'll likely get an error then).

It is actually possible to both use define-scheme-function and
define-markup-command with the same name, and LilyPond will pick the
right one depending on context.

-- 
David Kastrup

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


Re: increase vertical space

2012-11-03 Thread Noeck
Am 02.11.2012 01:20, schrieb Reinhold Kainhofer:
 On 2012-11-01 22:54, Eluze wrote:
 Janek Warchoł-2 wrote
 This may sound surprising, but there are many cases when LilyPond's
 vertical spacing could be noticeably improved (i admit that most of
 these cases would matter only to a demanding professional engraver).
 
 +999
 
 Except that some very easy cases also matter to normal users. E.g.
 simply take a look at my empty score sheets and see how they look when
 you remove all the overrides in the \paper block):
 http://www.edition-kainhofer.com/en/empty-scoresheets.html

I checked it out and can't see any obvious/shocking difference.

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


Re: Function for rendering key textually in 3 languages

2012-11-03 Thread Olivier Biot
On Sat, Nov 3, 2012 at 7:35 PM, David Kastrup d...@gnu.org wrote:
 Olivier Biot olivier.b...@gmail.com writes:

 On Sat, Nov 3, 2012 at 6:11 PM, Olivier Biot olivier.b...@gmail.com wrote:

 What I now need to figure out, is how to print the output in a markup,
 like in the currently not working snippets below:

 %%% START of snippet 2
 \header {
   title = \markup {\italic \tonicEN cis minor}

 That's inside of a markup.  I _think_ this should work in current 2.17
 with define-scheme-function, but likely not in 2.16.

Aah... I'm still using v2.16 stable for now.

 So you'll need a define-markup-command after all to use inside of
 \markup, and best give it two markup? arguments (if the arguments are
 not plain strings, you'll likely get an error then).

Okay.

 It is actually possible to both use define-scheme-function and
 define-markup-command with the same name, and LilyPond will pick the
 right one depending on context.

Hi David,

Okay, one more magic recipe I see :-)

I now have two methods sharing the same name but defined differently,
that do the job:

%%% BEGIN snippet 1
tonalityEN =
#(define-scheme-function (parser layout tonic scale) (string? string?)
   (string-append
(cond
 ( (string=? tonic a) A )
 ( (string=? tonic b) B )
 ( (string=? tonic c) C )
 ( (string=? tonic d) D )
 ( (string=? tonic e) E )
 ( (string=? tonic f) F )
 ( (string=? tonic g) G )
 ( (string=? tonic aes) A flat )
 ( (string=? tonic bes) B flat )
 ( (string=? tonic ces) C flat )
 ( (string=? tonic des) D flat )
 ( (string=? tonic ees) E flat )
 ( (string=? tonic fes) F flat )
 ( (string=? tonic ges) G flat )
 ( (string=? tonic ais) A sharp )
 ( (string=? tonic bis) B sharp )
 ( (string=? tonic cis) C sharp )
 ( (string=? tonic dis) D sharp )
 ( (string=? tonic eis) E sharp )
 ( (string=? tonic fis) F sharp )
 ( (string=? tonic gis) G sharp )
 )
(cond
 ( (string=? scale major)  major )
 ( (string=? scale minor)  minor )
 )
)
   )

#(define-markup-command (tonalityEN layout props tonic scale) (string? string?)
   (interpret-markup layout props
 (markup
  (cond
   ( (string=? tonic a) A )
   ( (string=? tonic b) B )
   ( (string=? tonic c) C )
   ( (string=? tonic d) D )
   ( (string=? tonic e) E )
   ( (string=? tonic f) F )
   ( (string=? tonic g) G )
   ( (string=? tonic aes) A flat )
   ( (string=? tonic bes) B flat )
   ( (string=? tonic ces) C flat )
   ( (string=? tonic des) D flat )
   ( (string=? tonic ees) E flat )
   ( (string=? tonic fes) F flat )
   ( (string=? tonic ges) G flat )
   ( (string=? tonic ais) A sharp )
   ( (string=? tonic bis) B sharp )
   ( (string=? tonic cis) C sharp )
   ( (string=? tonic dis) D sharp )
   ( (string=? tonic eis) E sharp )
   ( (string=? tonic fis) F sharp )
   ( (string=? tonic gis) G sharp )
   )
  (cond
   ( (string=? scale major) major )
   ( (string=? scale minor) minor )
   )
  )
 )
   )
%%% END snippet 1

The difference is a single space character since the first definition
makes use of the space-eating concat function.

Next I want to try to call the new markup method in a scoreTitleMarkup
block, but there I can't yet find the proper solution:

%%% BEGIN snippet 2
scoreTitleMarkup = \markup {
  \column {
\vspace #.5
\rounded-box {
  \column {
\fill-line {
  \bold { \justify-field #'header:piece }
  \italic \tonalityEN #'header:piece-tonality #'header:piece-scale
} % \fill-line
  } % \column
} % \rounded-box
  } % \column
} % \markup


\score {
  \new Staff {
\relative c' {
\key c \major
c d e fis ges d b
}
  }

  \header {
piece = The piece title comes here
piece-tonality = c
piece-scale = major
  }
}
%%% END snippet 2

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


Re: increase vertical space

2012-11-03 Thread Reinhold Kainhofer

On 2012-11-03 22:32, Noeck wrote:

Am 02.11.2012 01:20, schrieb Reinhold Kainhofer:

On 2012-11-01 22:54, Eluze wrote:

Janek Warchoł-2 wrote

This may sound surprising, but there are many cases when LilyPond's
vertical spacing could be noticeably improved (i admit that most of
these cases would matter only to a demanding professional engraver).


+999

Except that some very easy cases also matter to normal users. E.g.
simply take a look at my empty score sheets and see how they look when
you remove all the overrides in the \paper block):
http://www.edition-kainhofer.com/en/empty-scoresheets.html


I checked it out and can't see any obvious/shocking difference.


Some examples:
-) Single staff: Without the spacing settings, the first staff is 
uncomfortably close to the upper edge of the paper, the last staff is 
uncomfortably close to the footer. Even if there are only very few 
systems on per page (i.e. lots of stretching involved), the top and 
bottom margin do not stretch at all, which makes them look even more 
glued to the top/bottom.


-) Full orchestra score: All staves and groups are spaced equally 
(actually, not equally, some distances seem larger than others, but I 
fail to see any understandable reason), while in normal scores, the 
stretching within staff groups should be less than the space between 
staff groups.


-) If you create an organ score with 7 systems per page (not possible in 
the script, since it is vertically crowded and not really suitable for 
hand-writing notes into it), the space between the manual and the pedal 
will be larger than the space between two systems.



And all these do not even include pages with multiple scores and title 
markups between them...


Cheers,
Reinhold

--
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://www.kainhofer.com
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * Edition Kainhofer, Music Publisher, http://www.edition-kainhofer.com

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