Horizontal position of beats in file

2013-05-29 Thread Jay Anderson
Last year it was asked how to get the horizontal position of the bar
lines (and first beats):
http://lists.gnu.org/archive/html/lilypond-user/2012-01/msg00762.html

I'd like to get each beat position as well. My first thought was
something along these lines:


#(define (average a b)
  (/ (+ a b) 2))

#(define (create-print-x-offset tag)
  (lambda (grob)
(let* ((system (ly:grob-system grob))
   (x-extent (ly:grob-extent grob system X))
   (x (average (car x-extent) (cdr x-extent
  (display (ly:grob-properties system))
  (newline)
  (display (string-append tag ":"))
  (display x)
  (newline

music = \relative c'
{
  \repeat unfold 3 {c2 c8 c4 c8 |}
}

outline =
{
  \override Score.BarLine.after-line-breaking = #(create-print-x-offset "bar")
  \repeat unfold 3
  {
\repeat unfold 4
{
  \once \override Score.NoteColumn.after-line-breaking =
#(create-print-x-offset "note")
  s4
} |
  }
}

\score
{
  \new Staff
  <<
\music
\outline
  >>
}


For the beats that don't have a note column it doesn't work. The
example above only has notes directly on the first and third beats:
{c2 c8 c4 c8 |}. Adding in hidden notes will affect the spacing so
that won't work. My only other thought is to equally space the missing
beats between the note columns that are found, but that could be
tricky. Any suggestions? Thanks.

-Jay

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


Re: problem with \RemoveEmptyStaves

2013-05-29 Thread Keith OHara

On Wed, 29 May 2013 02:58:44 -0700, Werner LEMBERG  wrote:


In a big score, it removes staves even if only a single system fits
on a page, see the attached image.
 How can I avoid this?


The last time this question came up, the suggestion was
  http://lsr.dsi.unimi.it/LSR/Item?id=312
Probably you will want to adapt that to apply to the whole Score.


Thanks.  *Very* kludgy.


No, not at all.  The RemoveEmptyStaves feature was intended to be adjusted in 
that way, so the solution in that snippet is a safe and direct way to avoid 
removing staves when you don't want them removed.  It will not break at the 
next LilyPond version or interfere with anything else.

I just tried it.  I changed Staff to Score in showMultiRests and at the places 
where I want all the staves to print I put \once\showMultiRests in the voice I 
use for tempo and time signatures.

Doing what you want requires compiling twice: once to see where only one system 
fits on a page, then place \once\showMultiRests and compile again.  Putting the 
empty staves back where you want them should not change the page breaks, so you 
won't need go in circles.


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


Re: Feature Request: Chromatic note names

2013-05-29 Thread Paul Morris
ericoschm...@yahoo.com.br wrote
> Sorry for the delay, here's the file i had been doing some testing.

Thanks for posting your file.  I now see that re-setting the language like
this
  \language english

overwrites the changes that were made by 
  #(ly:parser-set-note-names parser dodecaPitchNames)

and that lets you combine different types of staff, as shown in the snippet
below.  That's good to know!


I haven't been able to look closely at your message about the problem of
converting the chromatic note names back to traditional names.  But I wonder
if a simple find/replace operation on the .ly text file would work as well
or better than converting to MIDI and back?  

It just seems like you could lose a lot of info through the MIDI conversion
(since MIDI is meant for audio and not notation).  You could just do a
find/replace for each of your 12 chromatic note names, converting them to
the traditional names.  Maybe you could script this somehow.  I wonder if
there are scripts for converting .ly files from one note-name language to
another that could help?

If your target is a sharp key you would use the sharp names for the
"black-key" enharmonic notes, or flat names for a flat key.  That would
result in the correct notes for any notes in the key, and then you could
manually change any accidental notes that fall outside the key (choosing a
sharp or flat enharmonic) if needed.  (If the target key had more than 5
sharps or flats, you'd need to adjust for that, for example F --> E#.)

Hmmm... then the tritones and relative entry problem would only occur if
there were a tritone that included an accidental note, and you would have a
50/50 chance of it coming out correctly.  You could manually check the
accidentals I guess.  (Maybe a helper function that would highlight any note
that was a tritone away from the previous one, and maybe it could even check
that one note was not in the current key? Might be tricky.)

Just checked the LSR and this looks promising:
http://lsr.dsi.unimi.it/LSR/Item?id=638

Nice definitions for "gambiarra"!  

-Paul


% BEGIN SNIPPET
\version "2.16"

% set the nominals to be 12-equal
#(ly:set-default-scale (ly:make-scale '#(0 1/2 1 3/2 2 5/2 3 7/2 4 9/2 5
11/2)))

% Set the pitches to 12-equal with enharmonic equivalences
% keep the original pitch names.
% all tritones go downwards on \relative, unless specified otherwise.
% Preserves quartertones as half-sharps.
dodecaPitchNames =
#(map (lambda (pitchname)
(let* (
   (pitch (cdr pitchname))
   (nominal-steps (vector-ref '#(0 2 4 5 7 9 11)
(ly:pitch-notename pitch)))
   (fractional-steps
(+ nominal-steps (* 2 (ly:pitch-alteration pitch
   (steps (inexact->exact (floor fractional-steps)))
   )
  (cons (car pitchname)
(ly:make-pitch
 (ly:pitch-octave pitch)
 steps
 (/ (- fractional-steps steps) 2)
   pitchnames)

#(ly:parser-set-note-names parser dodecaPitchNames)

<<
  \new Staff  \with {
\override StaffSymbol #'line-positions = #'( -6 0 6 )
  } {
\relative f { a ais b c cis d dis e f fis g gis a ais b c cis d dis e f
fis g gis a ais b c fis c fis }
  }
  \language english
  \new Staff {
\relative f { a as b c cs d ds e f fs g gs a as b c cs d ds e f fs g gs
a as b c fs c fs }
  }
>>




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Feature-Request-Chromatic-note-names-tp145984p146475.html
Sent from the User mailing list archive at Nabble.com.

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


RE: Huge gap between piano staves

2013-05-29 Thread Mark Stephen Mrotek
Derek:

In my piano scores for dynamics I refer to:
http://www.lilypond.org/doc/v2.16/Documentation/learning/articulation-and-dy
namics
and for pedaling to:
http://www.lilypond.org/doc/v2.16/Documentation/notation/piano

Mark

-Original Message-
From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
Phil Holmes
Sent: Wednesday, May 29, 2013 8:31 AM
To: Derek; lilypond-user@gnu.org
Subject: Re: Huge gap between piano staves

- Original Message - 
From: "Derek" 
To: 
Sent: Wednesday, May 29, 2013 1:33 AM
Subject: Huge gap between piano staves


> Hi there,
>
> I have a vocal/piano score with centered dynamics for the piano part. As
> soon as I added the dynamics ( \new Dynamics = "Dynamics_pf" \dynamics) 
> the
> gap between the right and left hand of the piano became enormous even 
> where
> there weren't any dynamics between them. I have scoured the documentation
> but for the life of me I cannot find a solution to shrink the gap between
> the two.
>

> I am running 2.16
> I also have a staff for the pedal ( \new Dynamics = "pedal" \pedal) and I
> can't seem to get enough of a gap between the pedal markings and the next
> stave. Any suggestions?
>


Please supply a tiny example illustrating this. 
http://lilypond.org/tiny-examples.html

--
Phil Holmes 


___
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: Huge gap between piano staves

2013-05-29 Thread Phil Holmes
- Original Message - 
From: "Derek" 

To: 
Sent: Wednesday, May 29, 2013 1:33 AM
Subject: Huge gap between piano staves



Hi there,

I have a vocal/piano score with centered dynamics for the piano part. As
soon as I added the dynamics ( \new Dynamics = "Dynamics_pf" \dynamics) 
the
gap between the right and left hand of the piano became enormous even 
where

there weren't any dynamics between them. I have scoured the documentation
but for the life of me I cannot find a solution to shrink the gap between
the two.

I am running 2.16
I also have a staff for the pedal ( \new Dynamics = "pedal" \pedal) and I
can't seem to get enough of a gap between the pedal markings and the next
stave. Any suggestions?



Please supply a tiny example illustrating this. 
http://lilypond.org/tiny-examples.html


--
Phil Holmes 



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


Re: problem with \RemoveEmptyStaves

2013-05-29 Thread Werner LEMBERG

>> In a big score, it removes staves even if only a single system fits
>> on a page, see the attached image.
> 
> In some big scores (say, Mahler) you need to remove the empty staves
> just to let the rest fit legibly on a page.

OK.  In other words, we would need a new value for property
`remove-empty', say, `multiple-systems-per-page-only', to make
lilypond do what I want.  Would this be possible to implement?  I can
imagine cyclic dependencies...

>>  How can I avoid this?
> 
> The last time this question came up, the suggestion was
>   http://lsr.dsi.unimi.it/LSR/Item?id=312
> Probably you will want to adapt that to apply to the whole Score.

Thanks.  *Very* kludgy.


Werner

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


Re: Does the optimal-page-breaker work?

2013-05-29 Thread Keith OHara
Werner LEMBERG  gnu.org> writes:

> >> I'm successfully using ly:page-turn-breaking with an organ piece,
> >> fitting about 200 bars on 11 pages.
> 
> I'm inserting \allowPageTurn commands: In virtually all places where a
> turn could happen, one hand plays while the other hand can turn the
> page.

This example included 14 \allowPageTurns, from which LilyPond chose the
5 best page-turns.  The music would fit on 10 pages with no regard to
possible page turns, so by using just 11 pages with good page-turns,
LilyPond does quite a good job.

ly:page-turn-breaking works, so we do get some benefit form LilyPond's
efforts to estimate how tall the systems will be when choosing the line-
breaks.

The default page-breaker still seems to get no benefit (such as smarter
choices of line-breaks) from the estimates of how many systems will fit
on a page, but suffers loose or over-full pages when those estimates are
wrong.

Shevek  saultobin.com> writes:

> I recommend playing with system-count and systems-per-page. 
> I have found this to be the best way to get Lilypond's page breaking
> algorithms to give good results.

That does work.  By setting systems-per-page manually, we are making
the page-breaking decisions ourselves.


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


Re: problem with \RemoveEmptyStaves

2013-05-29 Thread Keith OHara
Werner LEMBERG  gnu.org> writes:

> In a big score, it removes staves even if only a single system
> fits on a page, see the attached image.

In some big scores (say, Mahler) you need to remove the empty staves just
to let the rest fit legibly on a page.

You might like it if you restore some stretchability at the bottom of the
page. (I don't remember the command, but the default has some stretch.)

>  How can I avoid this?

The last time this question came up, the suggestion was
  http://lsr.dsi.unimi.it/LSR/Item?id=312
Probably you will want to adapt that to apply to the whole Score.


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