Re: musicxml2ly

2012-05-11 Thread Martin Tarenskeen



On Sat, 12 May 2012, Martin Tarenskeen wrote:




On Sun, 8 Apr 2012, Martin Tarenskeen wrote:

The good news is that in many cases only a little editing of the .ly file 
is required to turn a bad conversion into a good one. For example, all lead 
sheets from Wikifonia that I have tried have the Chords printed below 
instead of above the staff.


I remember this had been fixed in one of the previous lilypond 2.15.x 
versions, but with musicxml2ly from Lilypond 2.15.37 I am still (again?) 
having this problem.


Same with 2.15.38

--

MT


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


Re: Merging notes and shiftOn

2012-05-11 Thread Nick Payne

On 12/05/12 16:06, Nick Payne wrote:
In the documentation on collision resolution 
(http://lilypond.org/doc/v2.15/Documentation/notation/multiple-voices#collision-resolution), 
it states: "The \shiftOn command allows (but does not force) the notes 
in a voice to be shifted. When \shiftOn is applied to a voice, a note 
or chord in that voice is shifted *only* if its stem would otherwise 
collide with a stem from another voice, and only if the colliding 
stems point in the same direction." (the emphasis on *only* is mine).


However, in the example below, where I have to use shiftOff in the 
middle voice (to get the two F notes to merge) and shiftOn in the 
treble voice (to prevent the merged half notes from having their heads 
filled in), the two A half notes in the treble voice *are* being 
shifted, though from my reading of the sentence quoted above, the 
shift is not needed.


\version "2.15.38"

treble = \relative c''' {
\shiftOn
a2 a
}

bass = \relative c' {
f2 f
}

middle = \relative c' {
\shiftOff f8[ c'] b c f,[ c'] b c
}

\score {
\new Staff {
\clef treble
\mergeDifferentlyHeadedOn
<<
\context Voice = "1" { \voiceOne \treble }
\context Voice = "2" { \voiceTwo \bass }
\context Voice = "3" { \voiceThree \middle }
>>
}
\layout { }
}


p.s. I have just found out that if I replace \shiftOn with \shiftOn 
\override NoteColumn #'force-hshift = #0, then the notes in the treble 
voice do not actually get moved, and I still get the correct merging of 
the notes in the other voices. However, it still seems that the 
documentation does not correctly describe how shiftOn actually behaves.


Nick

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


Re: musicxml2ly

2012-05-11 Thread Martin Tarenskeen



On Sun, 8 Apr 2012, Martin Tarenskeen wrote:

The good news is that in many cases only a little editing of the .ly file is 
required to turn a bad conversion into a good one. For example, all lead 
sheets from Wikifonia that I have tried have the Chords printed below instead 
of above the staff.


I remember this had been fixed in one of the previous lilypond 2.15.x 
versions, but with musicxml2ly from Lilypond 2.15.37 I am still (again?) 
having this problem.


--

MT

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


Merging notes and shiftOn

2012-05-11 Thread Nick Payne
In the documentation on collision resolution 
(http://lilypond.org/doc/v2.15/Documentation/notation/multiple-voices#collision-resolution), 
it states: "The \shiftOn command allows (but does not force) the notes 
in a voice to be shifted. When \shiftOn is applied to a voice, a note or 
chord in that voice is shifted *only* if its stem would otherwise 
collide with a stem from another voice, and only if the colliding stems 
point in the same direction." (the emphasis on *only* is mine).


However, in the example below, where I have to use shiftOff in the 
middle voice (to get the two F notes to merge) and shiftOn in the treble 
voice (to prevent the merged half notes from having their heads filled 
in), the two A half notes in the treble voice *are* being shifted, 
though from my reading of the sentence quoted above, the shift is not 
needed.


\version "2.15.38"

treble = \relative c''' {
\shiftOn
a2 a
}

bass = \relative c' {
f2 f
}

middle = \relative c' {
\shiftOff f8[ c'] b c f,[ c'] b c
}

\score {
\new Staff {
\clef treble
\mergeDifferentlyHeadedOn
<<
\context Voice = "1" { \voiceOne \treble }
\context Voice = "2" { \voiceTwo \bass }
\context Voice = "3" { \voiceThree \middle }
>>
}
\layout { }
}
<>___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Dashed Stem

2012-05-11 Thread David Nalesnik
Hi Harm,

I suggest the code below. It's very close to your own but it seems to
> avoid the problems.
>
>
When I tried your code out, the same problems happened for me!  I concluded
that this is an issue with the viewer in LilyPondTool, and sure enough,
when I "view PDF with external PDF-viewer," the problem disappears, and I
see all 20 line segments with both your version and mine too.

Certain aspects of your rewrite are clearer than mine--thank you!

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


Re: Dashed Stem

2012-05-11 Thread Thomas Morley
2012/5/12 David Nalesnik :

> Looking at this some more, I've come up with an alternate which more closely
> duplicates an ordinary stem.  Instead of using line segments, I used
> round-filled-box stencils, which is what Lily uses to draw stems.
>
> Everything is fine when the dashes aren't too small.  If you ask for more
> than 6 at staff-size 20, though, some dashes won't appear.  You see similar
> behavior if the staff size is reduced.  (To see this, uncomment the line at
> the top of the function.)  I'm not sure what's going on here, if this is a
> limitation of 'round-filled-box, or something I'm doing wrong.

Hi David,

I suggest the code below. It's very close to your own but it seems to
avoid the problems.

\version "2.15.36"

%#(set-global-staff-size 14)

#(define (make-round-filled-box x1 x2 y1 y2 blot-diameter)
 (ly:make-stencil (list 'round-filled-box (- x1) x2 (- y1) y2 blot-diameter)
  (cons x1 x2)
  (cons y1 y2)))

#(define ((dashed-stem num) grob)
   (let* ((blot (ly:output-def-lookup (ly:grob-layout grob) 'blot-diameter))
  (stencil (ly:stem::print grob))
  (X-ext (ly:stencil-extent stencil X))
  (thickness (interval-length X-ext))
  (ext (ly:stencil-extent stencil Y))
  (len (interval-length ext))
  (new-stencil empty-stencil)
  (factors
(map
  (lambda (x) (* (/ len (1- (* 2 num))) x))
  (iota (* 2 num)

   (define (helper args)
 (set! new-stencil
(ly:stencil-add new-stencil
 (ly:stencil-translate-axis
  (make-round-filled-box (/ thickness -2) (/ thickness 2)
 (car args) (cadr args) blot)
  (interval-start ext)
  Y)))
 (if (null? (cddr args))
   new-stencil
   (helper (cddr args

(if (zero? num)
stencil
(helper factors

% test

% compare only avoids too much typing :)

compare =
#(define-music-function (parser location music)(ly:music?)
  (let* ((new-music (ly:music-deep-copy music)))
#{
$music
\override Stem #'stencil = #(dashed-stem 20)
$new-music
\revert Stem #'stencil
#}))

\relative c' {
\compare g
\compare a
\compare b
\compare c
\compare d
\compare e
\compare f
\compare g
\compare a
\compare b
\compare c
\compare d
\compare e
\compare f
\compare g
\compare a
}

\relative c' {
\compare \transpose c c' 32
\compare \transpose c d' 
\compare \transpose c e' 
\compare \transpose c f' 
\compare \transpose c g' 
\compare \transpose c a' 
\compare \transpose c b' 
\compare \transpose c c'' 
}

Best,
  Harm

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


Re: Dashed Stem

2012-05-11 Thread David Nalesnik
Hi again,

On Fri, May 11, 2012 at 11:24 AM, David Nalesnik
wrote:

> Hi Urs,
>
> On Fri, May 11, 2012 at 7:06 AM, Urs Liska  wrote:
>
>> Am I right that you can't make a Stem dashed? I didn"t find anything in
>> the IR.
>>
>> What would then be the proper way to attach a dashed line to a note in
>> place of the Stem?
>>
>>
> Here's something I came up with.  It's not ideal.  If you compare the
> substitute stems with ordinary stems, you'll find differences.  (These
> relate, I think, to how rounded the lines are--to 'blot-diameter.)  But
> hopefully this will do.
>
> The argument allows you to specify the number of dashes in your stem.
>

Looking at this some more, I've come up with an alternate which more
closely duplicates an ordinary stem.  Instead of using line segments, I
used round-filled-box stencils, which is what Lily uses to draw stems.

Everything is fine when the dashes aren't too small.  If you ask for more
than 6 at staff-size 20, though, some dashes won't appear.  You see similar
behavior if the staff size is reduced.  (To see this, uncomment the line at
the top of the function.)  I'm not sure what's going on here, if this is a
limitation of 'round-filled-box, or something I'm doing wrong.

Anyway, here it is:

\version "2.15.38"

%#(set-global-staff-size 14)

#(define (dashed-stem num)
  (lambda (grob)
(let* ((stencil (ly:stem::print grob))
   (X-ext (ly:stencil-extent stencil X))
   (Y-ext (ly:stencil-extent stencil Y))
   (b-d (ly:output-def-lookup (ly:grob-layout grob) 'blot-diameter))
   (len (interval-length Y-ext))
   (lst '())
   (factors
 (map
   (lambda (x) (* (/ len (1- (* 2 num))) x))
   (iota (* 2 num)

 (define (helper args)
   (set! lst
 (cons
   (ly:make-stencil
 `(round-filled-box
   (- ,(car X-ext))
   ,(cdr X-ext)
   (- ,(+ (car Y-ext) (car args)))
   ,(+ (car Y-ext) (cadr args))
   ,b-d)
 X-ext
 Y-ext)
   lst))

   (if (null? (cddr args))
   lst
   (helper (cddr args

 (if (zero? num)
 stencil
 (apply ly:stencil-add (helper factors))

\relative c'' {
  \once \override Stem #'stencil = #(dashed-stem 2)
  c
  \once \override Stem #'stencil = #(dashed-stem 3)
  d
  \once \override Stem #'stencil = #(dashed-stem 5)
  e
  \once \override Stem #'stencil = #(dashed-stem 6)
  f
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: help needed for new church hymnbook / hulp gevraagd voor nieuw liedboek

2012-05-11 Thread Wilbert Berendsen
Op Thu, 10 May 2012 09:25:57 -0400
Dossy Shiobara  schreef:

> On 5/10/12 5:58 AM, Wilbert Berendsen wrote:
> > The music engraving is done using LilyPond.
> 
> What format is the source material in?  Hand-written scores?  How will
> this material be provided to those who are selected to join the
> engraving team?

The source is both handwritten and (but mostly) scans of printed scores
in PDF or JPG format.

We have everything in Git, but is is also possible to zip and unzip a
bunch of folders and transfer them by other means.

Many thanks to all for the (many) replies. We will contact you
all in a few days.

-- 
Wilbert Berendsen
(http://www.wilbertberendsen.nl)


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


Regarding horizontal shifts.

2012-05-11 Thread Hwaen Ch'uqi
Greetings All,
  In this snippet, the second arpeggio overlaps with the preceding
cross-staff notation. How may I best solve this? Ideally, I should
like to shift the second half of the measure to the right. Has the
solution something to do with padding? My efforts thus far have not
yielded anything fruitful.
  Many thanks.
Hwaen Ch'uqi

\version "2.15.38"

\score{
  \new PianoStaff<<
\set PianoStaff.connectArpeggios = ##t
\new Staff = up{
  \key c \minor \time 2/4 \clef treble \relative{
<<
  {
4\arpeggio \arpeggio
  }
  \\
  {
r16  \change Staff = down \stemUp  \change Staff =
up \stemDown  r  \change Staff = down \stemUp 
\change Staff = up \stemDown 
  }
>>
  }
}
\new Staff = down{
  \key c \minor \time 2/4 \clef bass \relative{
<<
  {
s2
  }
  \\
  {
4\arpeggio \arpeggio
  }
>>
  }
}
  >>
}

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


Re: Dashed Stem

2012-05-11 Thread David Nalesnik
Hi Urs,

On Fri, May 11, 2012 at 7:06 AM, Urs Liska  wrote:

> Am I right that you can't make a Stem dashed? I didn"t find anything in
> the IR.
>
> What would then be the proper way to attach a dashed line to a note in
> place of the Stem?
>
>
Here's something I came up with.  It's not ideal.  If you compare the
substitute stems with ordinary stems, you'll find differences.  (These
relate, I think, to how rounded the lines are--to 'blot-diameter.)  But
hopefully this will do.

The argument allows you to specify the number of dashes in your stem.


\version "2.15.38"

#(define (dashed-stem num)
  (lambda (grob)
(let* ((stencil (ly:stem::print grob))
   (ext (ly:stencil-extent stencil Y))
   (len (interval-length ext))
   (lst '())
   (factors
 (map
   (lambda (x) (* (/ len (1- (* 2 num))) x))
   (iota (* 2 num)

 (define (helper args)
   (set! lst
 (cons
   (make-line-stencil
 0.13 ;; thickness
 0 (+ (car ext) (car args))
 0 (+ (car ext) (cadr args)))
   lst))
   (if (null? (cddr args))
   lst
   (helper (cddr args

 (if (zero? num)
 stencil
 (apply ly:stencil-add (helper factors))

\relative c'' {
  \once \override Stem #'stencil = #(dashed-stem 2)
  c
  \once \override Stem #'stencil = #(dashed-stem 3)
  d
  \once \override Stem #'stencil = #(dashed-stem 4)
  e
  \once \override Stem #'stencil = #(dashed-stem 5)
  f
}

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


Re: is shapeSlur broken?

2012-05-11 Thread Urs Liska

Am 11.05.2012 01:27, schrieb David Nalesnik:

Hi Harm,

On Thu, May 10, 2012 at 6:00 PM, Thomas Morley 
mailto:thomasmorle...@googlemail.com>> 
wrote:


2012/5/11 Thomas Morley mailto:thomasmorle...@googlemail.com>>:
> Hi David,
>
> I thought a while about your function.
> I'd like to suggest some changes. In the attached file you can see:
>
> - Elimination of `function' as argument of shape-curve and
introducing
> it as local variable.


I like this!  I had thought of looking up the callback (as an 
alternative to passing it in), but hadn't found a way to do it.  Nice!


> - A new condition added in shape-curve at the siblings-variable:
ly:spanner?


Right--otherwise overriding LaissezVibrerTie won't work.

> - In the music-function I added a new variable to specify the grob.


Aha--I didn't realize you could drop the # in the latest versions.  I 
like this too.  Of course, if you want to stick with shapeSlur (and 
its ilk) you can define it like this:


shapeSlur =
#(define-music-function (parser location offsets) (list?)
  #{
\once \override Slur #'control-points = #(shape-curve offsets 
location)

  #})
I would prefer this one, although it needs a lot of individual functions 
be defined.
But there should be no problem in defining the shapeXXX set of function 
parallel to a \shape XXX #'( version).


I hope I'll find the way how to update #(display-control-points) (from 
the other thread on bug-lilypond) so it works with the other curve types 
too.


Best
Urs


>
> These give the advantage to define only one music-function.
> Of course there is need to specify which grob should be applied.
>
> But now it works for all curves:
>
> Slur
> PhrasingSlur
> Tie
> RepeatTie
> LaissezVibrerTie
>
> I didn't test it very widly, but what do you think?

I like it all.


Oops, forgot to delete the wrong version-number..
Please switch to \version "2.15.36" or higher.

I don't have 2.14.2 up to test, but this all should work there 
provided you add the # before the string?


So:
\shape #"Slur" #'( ...

Thanks so much!

Best,
David



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


Dashed Stem

2012-05-11 Thread Urs Liska
Am I right that you can't make a Stem dashed? I didn"t find anything in the IR.

What would then be the proper way to attach a dashed line to a note in place of 
the Stem?

Thanks
Urs
-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: is shapeSlur broken?

2012-05-11 Thread David Kastrup
David Nalesnik  writes:

> Should be just around the corner!

We just had another fix for a critical regression in, and I marked
updating the \footnote documentation to \footnote behavior (\footnote is
now used as a postevent consistently) also as Critical.  Once the
release candidate gets out, we have a delay of two weeks for other
critical regressions to be found.

I certainly hope that we get through that without new regressions being
found, but it is not like that hope would be particularly novel.

-- 
David Kastrup


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


Re: is shapeSlur broken?

2012-05-11 Thread David Nalesnik
On Thu, May 10, 2012 at 6:53 PM, Thomas Morley <
thomasmorle...@googlemail.com> wrote:

> Hi David,
>
> 2012/5/11 David Nalesnik :
>
> > I don't have 2.14.2 up to test, but this all should work there provided
> you
> > add the # before the string?
> >
> > So:
> > \shape #"Slur" #'( ...
>

I was wrong here.  You can use \shape Slur . . .  there too.


>
> I tested what's needed to make it work with 2.14.2 (therefor the
> 2.14.2-version-number in the file).
> Well, you can boil down the main-function quite easily, but
> `ly:input-warning' is not part of 2.14. Deleting the whole
> warning-part would mean a considerable loss of functionality.
>

Here you can substitute ly:input-message (which doesn't stand out as well).

Just for the record, to make this work in 2.14.2, you need to add dollar
signs before the variables in the music function. So:

shape =
#(define-music-function (parser location grob offsets)
(string? list?)
  #{
\once \override $grob #'control-points =
  #(shape-curve $offsets $location)
  #})


> And I didn't think about an alternative for 2.14.2, hoping for 2.16 coming
> soon.
>

Should be just around the corner!

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


Re: is shapeSlur broken?

2012-05-11 Thread David Nalesnik
>
>
> > So:
> > \shape #"Slur" #'( ...
>
> Looks awful.  Why not call it with the syntax used for any override?
>
> \shape Slur #'( ...
>
>
Yes, it is pretty horrible.  I didn't realize that LilyPond would accept
strings not enclosed in double quotes.

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


Re: Output for tablet or smartphone

2012-05-11 Thread Ben Luo
Hi Jonathan,

I you mean convert ly file to pdf, it should work. I ever did for piano
notes (Mikro Kosmos) for kindle 3, it should work for ipad/iphone. But I
don't think PDF in A4 size is suitable for tab/kindle.

I use below for kindle 3.

version "2.14.2"
% This format is for 6' e-ink reader.
#(set-default-paper-size "a6")
#(set-global-staff-size 20)

\paper {
top-margin = 1\mm
bottom-margin = 1\mm
left-margin = 4\mm
line-width = 98\mm
print-page-number = ##f
page-limit-inter-system-space = ##t
}


On Wed, Apr 18, 2012 at 11:20 PM, Jonathan Wilkes wrote:

> Hello,
>
> 1) Has anyone printed out a pdf score for a tablet or smartphone that is
> just like one long roll?  In other words, if you have voice and piano, it'd
> just be the two continuous staves in one long system, and the paper width
> would be however long it needs to be to fit everything onto one page.  Then
> you could scroll horizontally with your finger to read the music.
>
> -Jonathan
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: is shapeSlur broken?

2012-05-11 Thread David Kastrup
David Nalesnik  writes:

> So:
> \shape #"Slur" #'( ...

Looks awful.  Why not call it with the syntax used for any override?

\shape Slur #'( ...

-- 
David Kastrup


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