Re: Multiple rhythms in same score

2016-06-24 Thread David Wright
On Fri 24 Jun 2016 at 13:17:02 (+1000), Don Gingrich wrote:
> What I think that I want to do may simply be 
> impossible -- I'll say that at the start.
> 
> When I see full scores for a number of songs published,
> it is clear that the reason that various verses are printed
> separately is that one or more bars have significantly
> different rhythm from the first verse.
> 
> But, when attempting to publish a score with the goals of:
> 1) fit it all on one or at most two A4 sheets
> 2) put the lyrics under the score (melody line) 
> 3) put guitar chords above the score
> 
> The case of a quarter note split into two eighth notes
> with a dotted tie and \set \ignoreMelismata = ##t
> \unset \ignoreMelismata in the lyrics works for most 
> cases, but I'm dealing with variations that don't easily
> fit this solution.
> 
> I'm left with a dilemma -- on the score I'm engraving at
> present, Tom Paxton's "Marvellous Toy" it is becoming 
> clear that I've got at least one bar where the first verse
> should be
> b4 b b8 a g4
> 
> and one of the other verses looks like
> 
> b4 b b g
> 
> And I'm fairly certain that I need to replace a:
> 
> 4. 8 4 with a triplet in another instance
> 
> Is there a possible way to show variant notes in a bar
> with lyrics optionally binding to one or the other?
> 
> I'm guessing that the answer is  "no" since publishers like 
> to reduce the page count, where possible. And I've never 
> seen this done.
> 
> So, I won't be too frustrated if the answer is, "It can't
> be done"

It depends on what you find acceptable. Here are two possibilities.
I wrote the first as an exercise in connection with a thread about
repeats a while back. The second is really just cobbled together.
I haven't got time to fiddle about with the exact placement of the
words relative to ossias.

Cheers,
David.


alt.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Insert text between staves

2016-06-24 Thread David Wright
On Thu 23 Jun 2016 at 16:12:56 (-0500), Br. Gabriel-Marie | SSPX wrote:
> Well, I know how to do *that* - that is, I know how to get text
> above and below the staves.
> 
> But I want text above and below the scores - sort of like a
> subtitle.
> 
> At the end of each page, about 3/4 inch below the last line of
> lyrics I want to put my note (it's to say that the chorus should be
> repeated after each verse).
> 
> Page1:
> Chorus
> myText
> 
> Page2:
> verses
> myText
> 

Do you have anything against just splitting off the chorus from the
verses thus:

%%
myText = \markup { \tiny \italic  "Repeat Chorus after every verse "  }

\paper { ragged-bottom = ##t }

chorus= \new Voice = "chorus" \relative c'' { g a b c d }
verses = \new Voice = "verses" \relative c'' { g a b c d }

chorusLyrics = \new Lyrics \lyricsto "chorus" {
  These are the chorus words
}
firstVerse =  \new Lyrics \lyricsto "verses" {
  The words to my song
}
secondVerse =  \new Lyrics \lyricsto "verses" {
  Next verse words go here
}

\score{
  <<
\new Staff { \chorus }
\chorusLyrics
  >>
  \layout{}
}

\myText

\pageBreak

\markup { " " }
\myText
\markup { " " }
\markup { " " }

\score{
  <<
\new Staff { \verses }
\firstVerse
\secondVerse
  >>
  \layout{}
}
%%

Cheers,
David.

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


Re: always glissandi

2016-06-24 Thread David Nalesnik
On Fri, Jun 24, 2016 at 5:19 AM, David Kastrup  wrote:
> Tobias Hagedorn  writes:
>
>> Sorry I get this error message:
>>
>>  GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
>> #
>> (define-music-function (music) (ly:music?)
>>
>> Perhaps it depends on my version… I have to update
>> lilypond. music-function is complete new for me and very interesting!
>> I have to learn a bit more by myself and spending more time on this :)
>> Thanks a lot for this quick answering!
>> Tobias
>>
>> \version "2.19.15"
>>
>> addGlissandi =
>> #(define-music-function (music) (ly:music?)
>
> Yes.  I think it's something like 2.19.22 where you can write music
> functions like that.  Before it had to be
>
> #(define-music-function (parser location music) (ly:music?)


I changed this in the attached, so I think this ought to work at least
back to current stable.

I've also tweaked the code a little so it's more understandable, in
case someone wants to fool with the mechanism for deciding when to
draw glissandi in the presence of note repetitions.  I suppose it
could get really fancy with glissandoMap.

DN
\version "2.19.30"

#(define get-pitches
   (lambda (mus)
 (let ((note-evs
(cond
 ((music-is-of-type? mus 'event-chord)
  (filter (lambda (e) (music-is-of-type? e 'note-event))
  (ly:music-property mus 'elements)))
 ((music-is-of-type? mus 'note-event) (list mus))
 (else '()
   (map (lambda (ne) (ly:music-property ne 'pitch)) note-evs


#(define pitch-reps?
   (lambda (a b)
 (let* ((pitchesA (get-pitches a))
(pitchesB (get-pitches b))
; a list of pitches in pitchesA that are shared with B
; pitches only in pitchesA will be represented by #f
(shared
 (map (lambda (pa)
(find (lambda (pb) (equal? pa pb)) pitchesB))
   pitchesA)))
   ; return #t if repetitions preclude glissando
   ; logic below is just a placeholder...
   (if (= (length pitchesA) (length pitchesB))
   (every ly:pitch? shared)
   (any ly:pitch? shared)


addGlissandi =
#(define-music-function (parser location music) (ly:music?)
   (music-map
(lambda (mus)
  (if (music-is-of-type? mus 'sequential-music)
  (let ((elts (ly:music-property mus 'elements)))
(pair-for-each
 (lambda (p)
   (if (> (length p) 1)
   (let ((a (car p))
 (b (cadr p)))
 (if (not (pitch-reps? a b))
 (begin
  (if (music-is-of-type? a 'event-chord)
  (append! (ly:music-property a 'elements)
(list (make-music 'GlissandoEvent
  (if (music-is-of-type? a 'note-event)
  (set! (ly:music-property a 'articulations)
(cons (make-music 'GlissandoEvent)
  (ly:music-property a 'articulations)
 elts)))
  mus)
music)
   music)


\addGlissandi {
  %\override Glissando.breakable = ##t
  %\override Glissando.after-line-breaking = ##t
  g4 c'~ c' 
   c'  c' g'
  c'' g' c'2
  %\break
  g'1
}

\addGlissandi {
  1~
  4   
  1
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


RE:Multiple rhythms in same score

2016-06-24 Thread Stephen MacNeil
Hi Don

I see this a lot, (in guitar music -- typically vocals are added) the two
typical  ways are 1. use small notes eg 2. use the same size notes. I can
post examples if you need.

>>I'm guessing that the answer is  "no" since publishers like
>>to reduce the page count

really? it's been my experience they cram as much garbage as possible in
every book to increase the page count so they can charge more money.

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


Re: always glissandi

2016-06-24 Thread David Kastrup
Tobias Hagedorn  writes:

> Sorry I get this error message:
>
>  GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
> #
> (define-music-function (music) (ly:music?)
>
> Perhaps it depends on my version… I have to update
> lilypond. music-function is complete new for me and very interesting!
> I have to learn a bit more by myself and spending more time on this :)
> Thanks a lot for this quick answering!
> Tobias
>
> \version "2.19.15"
>
> addGlissandi =
> #(define-music-function (music) (ly:music?)

Yes.  I think it's something like 2.19.22 where you can write music
functions like that.  Before it had to be

#(define-music-function (parser location music) (ly:music?)

...

There is some rationale for sticking with a stable version like 2.18.2,
but if you are using a development version like 2.19.15 anyway, it makes
more sense to update semi-frequently.

-- 
David Kastrup

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


Phishing Scam Message

2016-06-24 Thread Michael Hendry
I recently received a message, ostensibly from Socrates Leptos, addressed to 
“undisclosed recipients” and with my name in the Bcc: box.

I treated it with suspicion partly because I’d forgotten about an exchange of 
emails on this list with Socrates last summer, and partly because it was asking 
me to log in to Google Docs through a “SIGN IN” link to 
http://szoka.info.pl/admin0453/Share%20Files/?code=personaldoc

I have notified Google of a suspected phishing scam, but felt that list members 
should be warned in case the scammer has been pairing up @gmail.com addresses 
harvested from the list and generating emails which appear to be between 
friends or colleagues.

Michael


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


Re: always glissandi

2016-06-24 Thread Tobias Hagedorn
Sorry I get this error message:

 GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
#
(define-music-function (music) (ly:music?)

Perhaps it depends on my version… I have to update lilypond. music-function is 
complete new for me and very interesting! I have to learn a bit more by myself 
and spending more time on this :)
Thanks a lot for this quick answering!
Tobias

\version "2.19.15"

addGlissandi =
#(define-music-function (music) (ly:music?)
(music-map
(lambda (mus)
(if (music-is-of-type? mus 'event-chord)
(append! (ly:music-property mus 'elements)
(list (make-music 'GlissandoEvent
(if (music-is-of-type? mus 'note-event)
(set! (ly:music-property mus 'articulations)
(cons (make-music 'GlissandoEvent)
(ly:music-property mus 'articulations

mus)
music)
music)


Am 24.06.2016 um 09:18 schrieb Orm Finnendahl 
:

> Hi David,
> 
> Am Donnerstag, den 23. Juni 2016 um 20:55:50 Uhr (-0500) schrieb David
> Nalesnik:
>> I'm thinking I'm safe in betting that I've spent more time on this
>> than this will ever save you :)
> 
> true, but it clears up things for other users like me as well, so
> it's well invested ;-)
> 
> Thanks for sharing!
> 
> --
> Orm

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


Re: always glissandi

2016-06-24 Thread Orm Finnendahl
Hi David,

Am Donnerstag, den 23. Juni 2016 um 20:55:50 Uhr (-0500) schrieb David
Nalesnik:
> I'm thinking I'm safe in betting that I've spent more time on this
> than this will ever save you :)

 true, but it clears up things for other users like me as well, so
it's well invested ;-)

Thanks for sharing!

--
Orm

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


Re: RE:Decaying squiggle

2016-06-24 Thread Richard Shann

On Fri, 2016-06-24 at 07:59 +0100, Richard Shann wrote:
> Could you attach this code as a file - I get it causing a crash in
> ghostscript (after using convert-ly and trying on 2.18.0 and 2.19.43), 

Oh, 

https://gist.github.com/mwitmer/1370615
it seems to be published - that code has compile just fine.

Richard




> I
> suspect this is because of whitespace being inserted by some part of the
> food chain.
> Thanks!
> 
> Richard
> 
> 
> On Thu, 2016-06-23 at 16:08 -0400, Stephen MacNeil wrote:
> > Hi Andrew
> > 
> > 
> > This is common in guitar. Modern scores. Mark Witmer wrote code for
> > this it's old but I still use it. 
> > 
> > %%%
> > 
> > 
> > 
> > \version "2.16.0"
> > 
> > 
> > % vibrato.ly
> > 
> > % Author: Mark Witmer
> > 
> > 
> > % Sets the next trill spanner to draw a waveform with the provided
> > wevelength
> > 
> > % and amplitudes. The waveform will go from one amplitude to the next
> > in a
> > 
> > % linear fashion.
> > 
> > vibrato = #(define-music-function (parser location amplitudes
> > wavelength) (list? number?) #{ 
> > 
> > \once \override TrillSpanner #'after-line-breaking = $(lambda (grob) 
> > 
> > (ly:grob-set-property! grob 'stencil (makevib grob amplitudes
> > wavelength)))
> > 
> > #})
> > 
> > #(define adjustvib #t)
> > 
> > 
> > % Creates the postscript for one system of the vibrato marking
> > 
> > #(define (make_ps no-sib? lbound xspan span-so-far amplitude-vector
> > wavelength) 
> > 
> > (if (or (= xspan -inf.0) (= xspan +inf.0))
> > 
> > ""
> > 
> > (let ((lbound 
> > 
> > (cond
> > 
> > ((and (> span-so-far 0) adjustvib) 
> > 
> > (- lbound 18))
> > 
> > (no-sib? (+ lbound 1))
> > 
> > (else lbound)))
> > 
> > (last 
> > 
> > (inexact->exact (floor (/ (+ span-so-far xspan) wavelength)
> > 
> > (format 
> > 
> > #f "gsave currentpoint translate 0.15 setlinewidth newpath /x ~a\
> > 
> > def\nx 0.0 moveto\n ~a ~a"
> > 
> > lbound 
> > 
> > (let make-curve 
> > 
> > ((current (inexact->exact (floor (/ span-so-far wavelength)
> > 
> > (cond 
> > 
> > ((= current (vector-length amplitude-vector)) "")
> > 
> > ((< (vector-ref amplitude-vector current) 0) "")
> > 
> > (else
> > 
> > (let ((current-ps 
> > 
> > (format 
> > 
> > #f " x ~a add ~a x ~a add ~a x ~a \
> > 
> > add 0.0 curveto\n/x x ~a add def\n"
> > 
> > (exact->inexact (/ wavelength 3)) 
> > 
> > (vector-ref amplitude-vector current)
> > 
> > (exact->inexact (* 2 (/ wavelength 3))) 
> > 
> > (- (vector-ref amplitude-vector current))
> > 
> > wavelength
> > 
> > wavelength)))
> > 
> > (if (= (+ current 1) last) 
> > 
> > current-ps 
> > 
> > (format #f "~a~a" current-ps 
> > 
> > (make-curve (+ 1 current
> > 
> > "stroke grestore"
> > 
> > 
> > % Returns the width of a grob
> > 
> > #(define (grob-width grob)
> > 
> > (if (or (= (car (ly:grob-property grob 'X-extent)) -inf.0)
> > 
> > (= (car (ly:grob-property grob 'X-extent)) +inf.0))
> > 
> > 0
> > 
> > (- (cdr (ly:grob-property grob 'X-extent)) 
> > 
> > (car (ly:grob-property grob 'X-extent)
> > 
> > 
> > % Returns the number of ems already traversed by the grob's siblings
> > in previous systems
> > 
> > #(define (width-up-to grob siblings count)
> > 
> > (if (eq? (car siblings) grob)
> > 
> > count
> > 
> > (+ (+ count (width-up-to grob (cdr siblings) count))
> > 
> > (grob-width (car siblings)
> > 
> > 
> > % Returns the total width of the individual grobs for each system that
> > make up the original grob
> > 
> > #(define (calcfull siblings count)
> > 
> > (if (eqv? (length siblings) 0)
> > 
> > count
> > 
> > (calcfull (cdr siblings) (+ count (grob-width (car siblings))
> > 
> > 
> > % Fills a vector of length len with linear interpolations between the
> > values found in amplitudes
> > 
> > #(define (fill-amplitude-vector! amplitude-vector len current-index
> > amplitudes)
> > 
> > (if (> (length amplitudes) 1)
> > 
> > (let ((start-amplitude (car amplitudes))
> > 
> > (end-amplitude (cadr amplitudes))
> > 
> > (start-index current-index)
> > 
> > (end-index (+ current-index 
> > 
> > (inexact->exact 
> > 
> > (floor (/ (vector-length amplitude-vector) 
> > 
> > (- len 1)))
> > 
> > (do ((n current-index (+ 1 n)))
> > 
> > ((or (> n (+ start-index end-index)) 
> > 
> > (>= n (vector-length amplitude-vector
> > 
> > (vector-set! amplitude-vector n 
> > 
> > (exact->inexact 
> > 
> > (+ start-amplitude 
> > 
> > (* (/ (- n start-index) (- end-index start-index))
> > 
> > (- end-amplitude start-amplitude))
> > 
> > (fill-amplitude-vector!
> > 
> > amplitude-vector len end-index (cdr amplitudes)
> > 
> > 
> > % Makes the vector of amplitudes for the vibrato marking
> > 
> > #(define (make-amplitude-vector amplitudes total-span wavelength)
> > 
> > (let* ((current-start 0)
> > 
> > (len (inexact->exact (floor (/ total-span wavelength
> > 
> > (amplitude-vector (make-vector len)))
> > 
> > (if (> (length amplitudes) 1) 
> > 
> > (fill-amplitude-vector! 
> > 
> > amplit

Re: RE:Decaying squiggle

2016-06-24 Thread Richard Shann
Could you attach this code as a file - I get it causing a crash in
ghostscript (after using convert-ly and trying on 2.18.0 and 2.19.43), I
suspect this is because of whitespace being inserted by some part of the
food chain.
Thanks!

Richard


On Thu, 2016-06-23 at 16:08 -0400, Stephen MacNeil wrote:
> Hi Andrew
> 
> 
> This is common in guitar. Modern scores. Mark Witmer wrote code for
> this it's old but I still use it. 
> 
> %%%
> 
> 
> 
> \version "2.16.0"
> 
> 
> % vibrato.ly
> 
> % Author: Mark Witmer
> 
> 
> % Sets the next trill spanner to draw a waveform with the provided
> wevelength
> 
> % and amplitudes. The waveform will go from one amplitude to the next
> in a
> 
> % linear fashion.
> 
> vibrato = #(define-music-function (parser location amplitudes
> wavelength) (list? number?) #{ 
> 
> \once \override TrillSpanner #'after-line-breaking = $(lambda (grob) 
> 
> (ly:grob-set-property! grob 'stencil (makevib grob amplitudes
> wavelength)))
> 
> #})
> 
> #(define adjustvib #t)
> 
> 
> % Creates the postscript for one system of the vibrato marking
> 
> #(define (make_ps no-sib? lbound xspan span-so-far amplitude-vector
> wavelength) 
> 
> (if (or (= xspan -inf.0) (= xspan +inf.0))
> 
> ""
> 
> (let ((lbound 
> 
> (cond
> 
> ((and (> span-so-far 0) adjustvib) 
> 
> (- lbound 18))
> 
> (no-sib? (+ lbound 1))
> 
> (else lbound)))
> 
> (last 
> 
> (inexact->exact (floor (/ (+ span-so-far xspan) wavelength)
> 
> (format 
> 
> #f "gsave currentpoint translate 0.15 setlinewidth newpath /x ~a\
> 
> def\nx 0.0 moveto\n ~a ~a"
> 
> lbound 
> 
> (let make-curve 
> 
> ((current (inexact->exact (floor (/ span-so-far wavelength)
> 
> (cond 
> 
> ((= current (vector-length amplitude-vector)) "")
> 
> ((< (vector-ref amplitude-vector current) 0) "")
> 
> (else
> 
> (let ((current-ps 
> 
> (format 
> 
> #f " x ~a add ~a x ~a add ~a x ~a \
> 
> add 0.0 curveto\n/x x ~a add def\n"
> 
> (exact->inexact (/ wavelength 3)) 
> 
> (vector-ref amplitude-vector current)
> 
> (exact->inexact (* 2 (/ wavelength 3))) 
> 
> (- (vector-ref amplitude-vector current))
> 
> wavelength
> 
> wavelength)))
> 
> (if (= (+ current 1) last) 
> 
> current-ps 
> 
> (format #f "~a~a" current-ps 
> 
> (make-curve (+ 1 current
> 
> "stroke grestore"
> 
> 
> % Returns the width of a grob
> 
> #(define (grob-width grob)
> 
> (if (or (= (car (ly:grob-property grob 'X-extent)) -inf.0)
> 
> (= (car (ly:grob-property grob 'X-extent)) +inf.0))
> 
> 0
> 
> (- (cdr (ly:grob-property grob 'X-extent)) 
> 
> (car (ly:grob-property grob 'X-extent)
> 
> 
> % Returns the number of ems already traversed by the grob's siblings
> in previous systems
> 
> #(define (width-up-to grob siblings count)
> 
> (if (eq? (car siblings) grob)
> 
> count
> 
> (+ (+ count (width-up-to grob (cdr siblings) count))
> 
> (grob-width (car siblings)
> 
> 
> % Returns the total width of the individual grobs for each system that
> make up the original grob
> 
> #(define (calcfull siblings count)
> 
> (if (eqv? (length siblings) 0)
> 
> count
> 
> (calcfull (cdr siblings) (+ count (grob-width (car siblings))
> 
> 
> % Fills a vector of length len with linear interpolations between the
> values found in amplitudes
> 
> #(define (fill-amplitude-vector! amplitude-vector len current-index
> amplitudes)
> 
> (if (> (length amplitudes) 1)
> 
> (let ((start-amplitude (car amplitudes))
> 
> (end-amplitude (cadr amplitudes))
> 
> (start-index current-index)
> 
> (end-index (+ current-index 
> 
> (inexact->exact 
> 
> (floor (/ (vector-length amplitude-vector) 
> 
> (- len 1)))
> 
> (do ((n current-index (+ 1 n)))
> 
> ((or (> n (+ start-index end-index)) 
> 
> (>= n (vector-length amplitude-vector
> 
> (vector-set! amplitude-vector n 
> 
> (exact->inexact 
> 
> (+ start-amplitude 
> 
> (* (/ (- n start-index) (- end-index start-index))
> 
> (- end-amplitude start-amplitude))
> 
> (fill-amplitude-vector!
> 
> amplitude-vector len end-index (cdr amplitudes)
> 
> 
> % Makes the vector of amplitudes for the vibrato marking
> 
> #(define (make-amplitude-vector amplitudes total-span wavelength)
> 
> (let* ((current-start 0)
> 
> (len (inexact->exact (floor (/ total-span wavelength
> 
> (amplitude-vector (make-vector len)))
> 
> (if (> (length amplitudes) 1) 
> 
> (fill-amplitude-vector! 
> 
> amplitude-vector (length amplitudes) 0 amplitudes)
> 
> (vector-fill! amplitude-vector (car amplitudes)))
> 
> amplitude-vector))
> 
> 
> % Creates a stencil that draws a sine wave for vibrato based on the
> provided amplitudes and wavelength
> 
> #(define (makevib grob amplitudes wavelength)
> 
> (let* ((orig (ly:grob-original grob))
> 
> (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '()))
> 
> (span (ly:grob-property grob 'X-extent))
> 
> (xbeg (car span))
> 
> (xend (cdr span))
> 
> (xspan (- xend xbeg))
> 
> (total-span (if (eqv? (length siblings) 0) (- xspan 3) (- (calcfull
> siblings 0) 3)))
> 
> (lbound (i