Trouble with Triplets (Corrected)

2019-08-28 Thread Stefano Antonelli
Dear List,

I've been fighting a problem with horizontal spacing for some time now.
 I'm new to lilypond, but I've done my best to read the documentation
and I didn't see an obvious answer.

The first issue to tackle was getting 4 bars to each line, but I found
the bars-per-line-engraver which seems to work nicely without having to
use a spacing voice for line breaks (which I've done before).

The second issue involves the width of the measure required to notate a
certain triplet pattern.  I don't have high hopes that this can be
easily fixed, unless I replace that measure with some kind of place
holder and notate it properly on a page separate from the score.

The third issue is supposed to be fixed by proportional notation:

"LilyPond supports proportional notation, a type of horizontal spacing
in which each note consumes an amount of horizontal space exactly
equivalent to its rhythmic duration. This type of proportional spacing
is comparable to horizontal spacing on top of graph paper."

Graph paper spacing is exactly what I want, but I must be missing
something.

Referring to the attached code, is there any way to:

1. reduce the width of the \first measure

2. align the notes of the \first measure with the \second measure

I would need to reduce the \first measure by approx 75% to fit 4 of
them on one line.  How could I make that happen?  I'd be happy to have
a really squished version as a place holder in the score with a larger
more visible version on a separate page.

It's also worth noting that the printed pdf margins are stacking with
the lilypond margins.  I haven't looked into why yet.

I would also like the /first measure to have consistent spacing with
the \second measure.  The bass drum 8th notes in the /first measure of
the attached pdf illustrate the problem.  These 8th notes are not
evenly spaced.  Furthermore, the first three 8th notes in the /first
measure line up with the first three 8th notes of the /second measure.
 I think that's a clue, but I have no idea what it means.

According to the documentation:

http://lilypond.org/doc/v2.18/Documentation/notation/proportional-notat
ion

The proportionalNotationDuration is set by trial and error with no
clear indication of what an appropriate number would look like.  My
approach was to reduce the number until I saw no further change.

The proportionalNotationDuration only gets the notes approximately
located.  To dial them in the uniform-stretching property must be set.
 However, doing so does not fix the problem.

I even tried to address the inconsistent 8th note spacing by writing
triplet rests as an additional voice (the notes of which I then hid)
hoping to make all of the measures the same width, but that didn't fix
the issue.

Ideas on how to fix these issues are greatly appreciated.

Thanks,
Stef%% http://lsr.di.unimi.it/LSR/Item?id=838

%LSR completed by P.P.Schneider on Feb. 2014 for v2.18

% These two lines are needed to force LilyPond to break only when
% YOU tell it to, via \break and \page Break. You may not need the page-break one.

%\layout {
%  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
%  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
%}

#(define ((bars-per-line-engraver bar-list) context)
  (let* ((working-copy bar-list)
 (total (1+ (car working-copy
`((acknowledgers
   (paper-column-interface
. ,(lambda (engraver grob source-engraver)
 (let ((internal-bar (ly:context-property context 'internalBarNumber)))
   (if (and (pair? working-copy)
(= (remainder internal-bar total) 0)
(eq? #t (ly:grob-property grob 'non-musical)))
   (begin
 (set! (ly:grob-property grob 'line-break-permission) 'force)
 (if (null? (cdr working-copy))
 (set! working-copy bar-list)
 (begin
   (set! working-copy (cdr working-copy
   (set! total (+ total (car working-copy
		   
		   

% place inside a layout context like so:
%\score {
%  \layout {
%\context {
%  \Score
%  %use the line below to insist on your layout
%  %\override NonMusicalPaperColumn.line-break-permission = ##f
%  \consists #(bars-per-line-engraver '(4))
%}
%  }
%}
\include "bars-per-line-engraver.ily"

first = \drummode {
<<
  {
   \voiceOne
cymr8 cymr8 
\tuplet3/2{hh16 hh hh}
hh8
\tuplet3/2{tomh16 tomh tomh}
\tuplet3/2{tomh16 tomh tomh}
\tuplet3/2{tomh16 tomh tomh}
tomh8
  }
  \\
  { \voiceTwo
	\repeat unfold 8 bd8
  }
>>
}

second = \drummode {
<<
  \voiceOne \repeat unfold 8 tomh8
  \\
  \voiceTwo \repeat unfold 8 bd8
>>
}

spacing = \drummode {
%  \hideNotes
  \override TupletBracket.bracket-visibility = ##f
  \override TupletNumber.text = #""
  \voiceThree
  \repeat unfold 8 {
\repeat unfold 8 { \tuplet3/2{ tomh16 

Trouble with Triplets

2019-08-28 Thread Stefano Antonelli
Dear List,

I've been fighting a problem with horizontal spacing for some time now.
 I'm new to lilypond, but I've done my best to read the documentation
and I didn't see an obvious answer.

The first issue to tackle was getting 4 bars to each line, but I found
the bars-per-line-engraver which seems to work nicely without having to
use a spacing voice for line breaks (which I've done before).

The second issue involves the width of the measure required to notate a
certain triplet pattern.  I don't have high hopes that this can be
easily fixed, unless I replace that measure with some kind of place
holder and notate it properly on a page separate from the score.

The second issue is supposed to be fixed by proportional notation:

"LilyPond supports proportional notation, a type of horizontal spacing
in which each note consumes an amount of horizontal space exactly
equivalent to its rhythmic duration. This type of proportional spacing
is comparable to horizontal spacing on top of graph paper."

Graph paper spacing is exactly what I want, but I must be missing
something.

Referring to the attached code, is there any way to:

1. reduce the width of the \first measure

2. align the notes of the \first measure with the \second measure

I would need to reduce the \first measure by approx 75% to fit 4 of
them on one line.  How could I make that happen?  I'd be happy to have
a really squished version as a place holder in the score with a larger
more visible version on a separate page.

It's also worth noting that the printed pdf margins are stacking with
the lilypond margins.  I haven't looked into why yet.

I would also like the /first measure to have consistent spacing with
the \second measure.  The bass drum 8th notes in the /first measure of
the attached pdf illustrate the problem.  These 8th notes are not
evenly spaced.  Furthermore, the first three 8th notes in the /first
measure line up with the first three 8th notes of the /second measure.
 I think that's a clue, but I have no idea what it means.

According to the documentation:

http://lilypond.org/doc/v2.18/Documentation/notation/proportional-notat
ion

The proportionalNotationDuration is set by trial and error with no
clear indication of what an appropriate number would look like.  My
approach was to reduce the number until I saw no further change.

The proportionalNotationDuration only gets the notes approximately
located.  To dial them in the uniform-stretching property must be set.
 However, doing so does not fix the problem.

I even tried to address the inconsistent 8th note spacing by writing
triplet rests as an additional voice (the notes of which I then hid)
hoping to make all of the measures the same width, but that didn't fix
the issue.

Ideas on how to fix these issues are greatly appreciated.

Thanks,
Stef
%% http://lsr.di.unimi.it/LSR/Item?id=838

%LSR completed by P.P.Schneider on Feb. 2014 for v2.18

% These two lines are needed to force LilyPond to break only when
% YOU tell it to, via \break and \page Break. You may not need the page-break one.

%\layout {
%  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
%  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
%}

#(define ((bars-per-line-engraver bar-list) context)
  (let* ((working-copy bar-list)
 (total (1+ (car working-copy
`((acknowledgers
   (paper-column-interface
. ,(lambda (engraver grob source-engraver)
 (let ((internal-bar (ly:context-property context 'internalBarNumber)))
   (if (and (pair? working-copy)
(= (remainder internal-bar total) 0)
(eq? #t (ly:grob-property grob 'non-musical)))
   (begin
 (set! (ly:grob-property grob 'line-break-permission) 'force)
 (if (null? (cdr working-copy))
 (set! working-copy bar-list)
 (begin
   (set! working-copy (cdr working-copy
   (set! total (+ total (car working-copy
		   
		   

% place inside a layout context like so:
%\score {
%  \layout {
%\context {
%  \Score
%  %use the line below to insist on your layout
%  %\override NonMusicalPaperColumn.line-break-permission = ##f
%  \consists #(bars-per-line-engraver '(4))
%}
%  }
%}
\include "bars-per-line-engraver.ily"

first = \drummode {
<<
  {
   \voiceOne
cymr8 cymr8 
\tuplet3/2{hh16 hh hh}
hh8
\tuplet3/2{tomh16 tomh tomh}
\tuplet3/2{tomh16 tomh tomh}
\tuplet3/2{tomh16 tomh tomh}
tomh8
  }
  \\
  { \voiceTwo
	\repeat unfold 8 bd8
  }
>>
}

second = \drummode {
<<
  \voiceOne \repeat unfold 8 tomh8
  \\
  \voiceTwo \repeat unfold 8 bd8
>>
}

spacing = \drummode {
%  \hideNotes
  \override TupletBracket.bracket-visibility = ##f
  \override TupletNumber.text = #""
  \voiceThree
  \repeat unfold 8 {
\repeat unfold 8 { \tuplet3/2{ tomh1

Re: Easy way for converting .ly to svg document

2019-08-28 Thread k.l.
Andrew Bernard wrote
> I forgot to mention, why don't you just open the SVG file? Use any text 
> editor.
> 
> Andrew
> 
> 
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user

Where to find the SVG file? I only get .pdf and .ps



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: Easy way for converting .ly to svg document

2019-08-28 Thread Andrew Bernard
I forgot to mention, why don't you just open the SVG file? Use any text 
editor.


Andrew


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


Easy way for converting .ly to svg document

2019-08-28 Thread k.l.
I'm newly work on lilypond. I saw that when generating PDF document from .ly
source, lilypond use svg as the backend, but what to do to if I want to get
the svg code?

Thanks.



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


stopStaff - startStaff End-of-System Staves

2019-08-28 Thread nagymusic
I attached a screenshot from the ending of my score in which I used
\stopStaff and \startStaff to completely hide staves at the end of the piece
for performance purposes. Would anyone be willing to have a look at the
attached screenshot and explain why there're small segments of staves
visible at the very end of each of the the four systems. I'm also including
a short code snippet from the flute's last four measures. I'd gladly provide
more code details so just let me know.

Thank you for your time and help!

Zvony

 


\time 4/4
r8\! a'4(\p cs''8~
\once \override Glissando.style = #'dashed-line
\once \override Glissando.bound-details.left.padding = #1
\once \override Glissando.bound-details.right.arrow = ##t
cs''2~ \glissando
\once \override Hairpin #'circled-tip = ##t
\override NoteHead.style = #'harmonic cs''1)^\markup "air sound"\>
\bar "||"

\once \override Staff.TimeSignature #'stencil = ##f
\time 4/4
\stopStaff
s2\! s2 ^\markup \teeny \raise #3 \halign #5.5 {Remain in place
until the end of the audio track.} \fermata
\startStaff
\bar "|."



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: Change position of first bar of melody

2019-08-28 Thread Frederik Hanghøj Iversen
\partial was exactly what I was looking for. Thank you so much!

On Wed, Aug 28, 2019 at 11:03 PM Michael Wagner 
wrote:

> How is this different from a partial (ie, a pickup) note. Will “\partial 8
> {c8}” do what you want?
>
> Mike
>
> Sent from my iPhone
>
> On Aug 28, 2019, at 16:19, Frederik Hanghøj Iversen 
> wrote:
>
> I'd like to change it so that the first bar on my sheet is after the first
> note in my melody. Currently I'm working around this by having my melody
> start with rests so that everything lines up. I'd like to not have those
> rests on my sheet however.
>
> I hope I'm explaining this well. I'm a bit of a novice. This particular
> piece of music does what I'm referring to:
>
> https://www.musikipedia.dk/billeder/dendanskesang.gif
>
> Is this possible in Lilypond?
>
> --
> Regards
> *Frederik Hanghøj Iversen*
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>

-- 
Regards
*Frederik Hanghøj Iversen*
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Change position of first bar of melody

2019-08-28 Thread Michael Wagner
How is this different from a partial (ie, a pickup) note. Will “\partial 8 
{c8}” do what you want?

Mike

Sent from my iPhone

> On Aug 28, 2019, at 16:19, Frederik Hanghøj Iversen  
> wrote:
> 
> I'd like to change it so that the first bar on my sheet is after the first 
> note in my melody. Currently I'm working around this by having my melody 
> start with rests so that everything lines up. I'd like to not have those 
> rests on my sheet however.
> 
> I hope I'm explaining this well. I'm a bit of a novice. This particular piece 
> of music does what I'm referring to:
> 
> https://www.musikipedia.dk/billeder/dendanskesang.gif
> 
> Is this possible in Lilypond?
> 
> -- 
> Regards
> Frederik Hanghøj Iversen
> ___
> 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: Change position of first bar of melody

2019-08-28 Thread Leo Correia de Verdier
This is called an upbeat or anacrusis. In lilypond you could do write the 
melody in the beginning of your example like:

\relative c’ {
\partial 8 c8 | a’4 a a f8 a
}

More about it here: 
http://lilypond.org/doc/v2.18/Documentation/learning/advanced-rhythmic-commands

HTH
/Leo

> 28 aug. 2019 kl. 22:19 skrev Frederik Hanghøj Iversen :
> 
> I'd like to change it so that the first bar on my sheet is after the first 
> note in my melody. Currently I'm working around this by having my melody 
> start with rests so that everything lines up. I'd like to not have those 
> rests on my sheet however.
> 
> I hope I'm explaining this well. I'm a bit of a novice. This particular piece 
> of music does what I'm referring to:
> 
> https://www.musikipedia.dk/billeder/dendanskesang.gif
> 
> Is this possible in Lilypond?
> 
> -- 
> Regards
> Frederik Hanghøj Iversen
> ___
> 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


Change position of first bar of melody

2019-08-28 Thread Frederik Hanghøj Iversen
I'd like to change it so that the first bar on my sheet is after the first
note in my melody. Currently I'm working around this by having my melody
start with rests so that everything lines up. I'd like to not have those
rests on my sheet however.

I hope I'm explaining this well. I'm a bit of a novice. This particular
piece of music does what I'm referring to:

https://www.musikipedia.dk/billeder/dendanskesang.gif

Is this possible in Lilypond?

-- 
Regards
*Frederik Hanghøj Iversen*
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Melisma breaking converting from 2.18 to 2.19

2019-08-28 Thread Kieren MacMillan
Hi David,

> you relied upon LP instantiating a Voice context outside the
> << >>, whereas it chose inside (attached). […]
> So I don't think it's a bug or a regression, but a side effect of a
> new feature, documented at the first bullet point on page 11 of
> 2.19.83 changes.

Exactly.  =)

> I suppose it's a case of "Beware all ye that rely on implied instantiations!"

Totally. That being said, I’m pretty sure none of us are going to start 
explicitly instantiating every context anytime soon…  ;)

Cheers,
Kieren.


Kieren MacMillan, composer (he/him)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: DrumVoice Polyphony and MIDI

2019-08-28 Thread Stefano Antonelli
On Wed, 2019-08-28 at 09:01 +0200, Federico Bruni wrote:
> Il giorno lun 26 ago 2019 alle 20:08, Stefano Antonelli 
>  ha scritto:
> > 
> > That is not always a convenient format for working with drum parts
> > though.  I would like to be able to use a syntax more like the
> > following:
> > 
> > test = \drummode {
> >   <<
> >   { \voiceOne cymc4 cymc4 cymc4 cymc4 }
> >   { \voiceOne s4sn4   s4sn4   }
> >   \\
> >   { \voiceTwo bd4   s4bd4   s4}
> >   >>
> > }
> > 
> > \score {
> >   \new DrumStaff {
> > <<
> >   \set Staff.instrumentName = #"Drums"
> >   \new DrumVoice {
> > \test
> > %   \morePolyphonicPieces
> >   }
> > >>
> >   }
> >   \layout { }
> >   \midi {
> > \tempo 4 = 84
> >   }
> > }
> > \version "2.18.2"
> > 
> > The above code generates a score just fine, but the MIDI file is
> > empty
> > (aside from a header).
> > 
> > I don't actually know much about MIDI.  I'm just using the play
> > button
> > in Frescobaldi.  It's helpful when transcribing.
> The MIDI file is not empty when I compile above snippet.
> And I don't see why it should happen to you.
> Did you check carefully? Are you working on a saved file or a draft
> in 
> Frescobaldi?
> Operating system?

Thanks for the help.

Working from a saved file.  I've deleted the output files (both pdf and
midi) and pressed the engrave button.  New files are generated.
 Frescobaldi loads the midi, but doesn't seem to do anything when
pressing the play button.

The midi from the above (not working) code is 174 bytes (the header I
assume).  When I open this file up in audacity, it's recognised as a
midi file, but there is no data on any channels.

The midi from the working code is 216 bytes.  When I open this file up
in audacity, there is data.

OS is Windows 7 on a computer I don't use often.  Frescobaldi is
version 3.0.1.  Lilypond is 2.18.2.

I also just tried it on my primary linux machine.  Similar results.
 Bad file is 162 bytes and the good file is 216 bytes.  The bad file
doesn't work in audacity, but the good file does.  Using lilypond from
the command line.  Version is 2.18.2.

Seems to be consistent with this version of lilypond.  What version are
you using?

Thanks,
Stef

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


Transpose up or down conditionally

2019-08-28 Thread Steve Cummings

(also posted on Stack Exchange)
version 2.19...

How can I make Lilypond decide whether to transpose up or down depending 
on a target octave/range for one of the transposed notes?


I want to make a set of chord voicings, each in multiple transpositions, 
with the lowest note of each transposed voicing always within a 
specified octave, say between "c" and "b" (the octave below middle C in 
Lilypond notation). This would require some sort of conditional (in 
concept, something like: "try transposing the chord down; if the lowest 
note of the downward transposition is too low, transpose up").


I can't find any relevant snippets in the Lilypond snippet library. I 
found one discussion of conditional transposing here: 
http://lilypond.1069038.n5.nabble.com/problems-trying-to-write-a-conditional-transpose-td148815.html 
but the Scheme code is opaque to me--with the sparse comments I can't 
even understand what the original poster was trying to accomplish, much 
less the proposed solution. And when I tried to test that code using the 
short sample "input"  quoted in the above link I got errors, as follows:


|Parsing...C:...tmpdocument.ly:7:3: In procedure ly:music-set-property! 
in expression ((setter ly:music-property) (quote from-to) music ...): 
C:...tmpdocument.ly:7:3: Wrong type argument in position 1 (expecting 
Prob): from-to |


A fancy-ish implementation might take any specified note in a series as 
the reference point for the up/down decision, or even calculate an 
"average" reference pitch, but for my purposes the reference note will 
always be the first one in the chord, for example the 'c' in the C major 
'< c e g >' triad.


Thank you,
Steve


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


Re: DrumVoice Polyphony and MIDI

2019-08-28 Thread Federico Bruni
Il giorno lun 26 ago 2019 alle 20:08, Stefano Antonelli 
 ha scritto:

That is not always a convenient format for working with drum parts
though.  I would like to be able to use a syntax more like the
following:

test = \drummode {
  <<
  { \voiceOne cymc4 cymc4 cymc4 cymc4 }
  { \voiceOne s4sn4   s4sn4   }
  \\
  { \voiceTwo bd4   s4bd4   s4}
  >>
}

\score {
  \new DrumStaff {
<<
  \set Staff.instrumentName = #"Drums"
  \new DrumVoice {
\test
%   \morePolyphonicPieces
  }
>>
  }
  \layout { }
  \midi {
\tempo 4 = 84
  }
}
\version "2.18.2"

The above code generates a score just fine, but the MIDI file is empty
(aside from a header).

I don't actually know much about MIDI.  I'm just using the play button
in Frescobaldi.  It's helpful when transcribing.


The MIDI file is not empty when I compile above snippet.
And I don't see why it should happen to you.
Did you check carefully? Are you working on a saved file or a draft in 
Frescobaldi?

Operating system?




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