Re: Notes or chords sustained with a pedal

2019-12-23 Thread Robert Blackstone
Hi Harm,
Ref.: "Aaron's code should work. If not, I'd be interested how you do “my 
score". Probably one could track down the problem.”

This is a very kind offer.

What do you want to see? 
Surely not the complete _ly.tex-file? (Some 600 lines of code).
Perhaps  the score-definition + the relevant system, i.c. the last of the sore, 
containing bb 54-58. ?

I’ll try to make a relevant test-file. 
It will take some time, just before Christmas.

Anyway, thanks for your offer to help me.

Best regards,

Robert









> On 22 Dec 2019, at 12:51, Thomas Morley  wrote:
> 
> 
> 
> Am So., 22. Dez. 2019 um 11:52 Uhr schrieb Robert Blackstone 
> mailto:blackstone.rob...@gmail.com>>:
> Hi Aaron, Mark, Kieren and Rutger,
> 
> Many thanks for your solutions for my “Laissez vibrer”-problem.
> I’m very impressed by your "LilyPond -creativity”.
> Introducing  my notes into your examples works perfectly.
> Unfortunatly, introducing your codes into my scores either does not change 
> anything, when I use my own score-definition, or they do not compile when I 
> use yours, or better, the crucial elements of your scores. 
> I’ve spent hours to find and try to remove the causes of the errors, to no 
> avail.
> 
> I use “my score” for all of my piano transcriptions, and so far the only 
> thing that sometimes fails is connecting arpeggio’s but I know the remedy.
> Maybe I should mention that I use TeXShop as my editor. 
> 
> Aaron's code should work. If not, I'd be interested how you do “my score. 
> Probably one could track down the problem.
> 
> Cheers,
>   Harm
> 



Re: Notes or chords sustained with a pedal

2019-12-22 Thread Robert Blackstone
Hi Robin, 

Thanks for your critical comment.
I can see your point, but personally I am not very disturbed with or hindered 
by the result of my amateurish hack.
I tried several other hacks, for example coupling the notes with real ties, but 
I found the result extremely ugly. 

And finally I will be the only one who will use this transcription. I would 
have liked it to be perfect and that is why I posted my question on the 
LilyPond mailing-list.
The expert solutions that were proposed didn’t work in my score, no idea why 
not. 

Best regards.

Robert

> On 21 Dec 2019, at 17:38, Robin Bannister  wrote:
> 
> Robert Blackstone wrote:
> 
> 
> > I’m presently transcribing some piano-scores in which schords,
> > sustained with a pedal are notated in a way had not seen before
> > (see screenshot).
> 
> Referring to that original screenshot, surely there is no pedal here. The 
> pedal would blur what the right hand is doing.
> 
> This is much more likely laissezvibrer asking for the lefthand fifth to be 
> allowed to resonate to the sounds produced by the right hand.
> It wants the keys kept pressed even when the initial pp may have decayed to 
> .
> 
> 
> 
> > Anyway, I found something that gave me a result, not quite identical
> > to what I wanted to get, but good enough for me and probably
> > sufficiently clear for a pianist. See the attached screenshot.
> 
> That wouldn't be good enough for me.
> 
> In sightreading mode I would glimpse that in the lefthand there is nothing at 
> the start of the second measure, and so would release the fifth sooner than 
> is intended.
> 
> In sightreading mode I would ignore the middle of the second measure.
> It is only in the context of this thread that I can guess what is meant.
> 
> I think there should be something tie-like (complete or open) crossing from 
> the first measure to the second.
> 
> 
> Cheers,
> Robin
> 
> 
> 
> 
> 
> 
> 




Re: Notes or chords sustained with a pedal

2019-12-22 Thread Thomas Morley
Am So., 22. Dez. 2019 um 11:52 Uhr schrieb Robert Blackstone <
blackstone.rob...@gmail.com>:

> Hi Aaron, Mark, Kieren and Rutger,
>
> Many thanks for your solutions for my “Laissez vibrer”-problem.
> I’m very impressed by your "LilyPond -creativity”.
> Introducing  my notes into your examples works perfectly.
> Unfortunatly, introducing your codes into my scores either does not change
> anything, when I use my own score-definition, or they do not compile when I
> use yours, or better, the crucial elements of your scores.
> I’ve spent hours to find and try to remove the causes of the errors, to no
> avail.
>
> I use “my score” for all of my piano transcriptions, and so far the only
> thing that sometimes fails is connecting arpeggio’s but I know the remedy.
> Maybe I should mention that I use TeXShop as my editor.
>

Aaron's code should work. If not, I'd be interested how you do “my score.
Probably one could track down the problem.

Cheers,
  Harm


Re: Notes or chords sustained with a pedal

2019-12-22 Thread Thomas Morley
Hi Aaron,

Am So., 22. Dez. 2019 um 07:06 Uhr schrieb Aaron Hill
:
>
> On 2019-12-21 9:15 am, Kieren MacMillan wrote:
> >> Here is my attempt at hacking the BarLine stencil to add overlapping
> >> ties:
> >
> > This is so cool. Is there an easy way to make the function determine
> > the "current" set of LVs (i.e., the LV configuration from the most
> > recent LV-ed chord) and automagically apply it to the subsequent
> > barlines (e.g., with a \temporary, to be \reverted manually)?
>
> Things get trickier if you need to keep track of past events.  But here
> is another approach that uses a Scheme engraver to do the bulk of the
> work:

this is really great stuff.
How about putting it in LSR?
Seems to work with 2.18.2 as well.

After a very quick first glnce over it some remarks:

> 
> \version "2.19.83"
>
> #(begin
>(set-object-property! 'activeLaissezVibrer 'translation-type? list?)
>(set-object-property! 'activeLaissezVibrer 'translation-doc
>  "A list of LaissezVibrerTies which should span BarLines.")
>(set! all-translation-properties
>  (cons 'activeLaissezVibrer all-translation-properties)))
>
> #(define (SpanLaissezVibrer_engraver context)
>(define (spanLaissezVibrer? grob)
>  (let* ((cause (ly:grob-property grob 'cause))
> (class (ly:event-property cause 'class '()))
> (span? (ly:event-property cause 'span #f)))
>(and (memq 'laissez-vibrer-event class) span?)))
>(define (past-events tie)
>  (ly:moment(define (rescale-control-points cp xex)
>  (let* ((xmin (apply min (map car cp)))
> (xmax (apply max (map car cp)))
> (xmid (/ (+ xmin xmax) 2))
> (xhw (/ (- xmax xmin) 2)))

(map (lambda (pt) pt <-- this `pt` looks superfluous or am I
overlooking something?
>  (let ((t (/ (- (car pt) xmid) xhw)))
>(cons (interval-index xex t) (cdr pt cp)))
>(define ((stencil-proc ties) grob)
>  (let* ((bd (ly:item-break-dir grob))
> (orig (ly:bar-line::print grob))
> (xex (ly:stencil-extent orig X))
> (x (interval-index xex 0))
> (w (+ 0.8 (/ (interval-length xex) 2)))
> (tie-xex (cons (- x w) (+ x w

Some code-duplication here, iiuc:

>(ly:stencil-add (ly:bar-line::print grob)
>  (apply ly:stencil-add
>(map (lambda (tie)
>  (let* ((cp-orig (ly:grob-property tie 'control-points))
> (cp-temp (rescale-control-points cp-orig tie-xex))
> (sten '()) (xex '()) (yex '()))
>(ly:grob-set-property! tie 'control-points cp-temp)
>(set! sten (ly:tie::print tie))
>(ly:grob-set-property! tie 'control-points cp-orig)
>(set! xex (ly:stencil-extent sten X))
>(set! yex (ly:stencil-extent sten Y))
>(ly:make-stencil (ly:stencil-expr sten)
>  (cons (car xex) (if (> 0 bd) x (cdr xex))) yex)))
>  (map cdr ties))
>(make-engraver
>  (acknowledgers
>((bar-line-interface engraver grob source-engraver)
>  (let ((ties (ly:context-property context
>'activeLaissezVibrer '(
>(set! ties (filter past-events ties))
>(if (not (null? ties)) (ly:grob-set-property!
>  grob 'stencil (stencil-proc ties)
>((semi-tie-interface engraver grob source-engraver)
>  (if (spanLaissezVibrer? grob)
>(ly:context-set-property! context 'activeLaissezVibrer
>  (cons (cons (ly:context-now context) grob)
>(ly:context-property context
>  'activeLaissezVibrer '()
>
> spanLaissezVibrer = #(make-music 'LaissezVibrerEvent 'span #t)
>
> stopSpanLaissezVibrers = \applyContext #(lambda (context)
>(ly:context-set-property! (ly:context-find context 'Staff)
>  'activeLaissezVibrer '()))
>
> Upper = {
>| r2 r8 g'8 b' c''
>| 1\spanLaissezVibrer
>| R1 \stopSpanLaissezVibrers \bar "||"
>| r8 a' g' e' c'2 \bar "|."
> }
> Lower = {
>| 1\spanLaissezVibrer
>| R1
>| g8 b 2.^\spanLaissezVibrer
>| R1 \stopSpanLaissezVibrers
> }
> \score {
>\new PianoStaff <<
>  \new Staff { \clef "treble" \Upper }
>  \new Staff { \clef "bass" \Lower }
>>>
>\layout { \context { \Staff
>  \consists \SpanLaissezVibrer_engraver } }
> }
> 
>
> This is quite different from my previous manual approach, but this has
> advantages of exactly matching the vertical positioning of LV ties
> without needing manual intervention.
>
>
> -- Aaron Hill

Thanks,
  Harm



Re: Notes or chords sustained with a pedal

2019-12-22 Thread Robert Blackstone
Hi Aaron, Mark, Kieren and Rutger,

Many thanks for your solutions for my “Laissez vibrer”-problem.
I’m very impressed by your "LilyPond -creativity”.
Introducing  my notes into your examples works perfectly.
Unfortunatly, introducing your codes into my scores either does not change 
anything, when I use my own score-definition, or they do not compile when I use 
yours, or better, the crucial elements of your scores. 
I’ve spent hours to find and try to remove the causes of the errors, to no 
avail.

I use “my score” for all of my piano transcriptions, and so far the only thing 
that sometimes fails is connecting arpeggio’s but I know the remedy.
Maybe I should mention that I use TeXShop as my editor. 

So, in the end, I will stay with my own tweaks that resulted in a, for me, 
acceptable notation, as in the screenshot I attached in my mail of a few days 
ago.

 
Thanks again. 

Best regards, Robert

Re: Notes or chords sustained with a pedal

2019-12-21 Thread Aaron Hill

On 2019-12-21 9:15 am, Kieren MacMillan wrote:
Here is my attempt at hacking the BarLine stencil to add overlapping 
ties:


This is so cool. Is there an easy way to make the function determine
the "current" set of LVs (i.e., the LV configuration from the most
recent LV-ed chord) and automagically apply it to the subsequent
barlines (e.g., with a \temporary, to be \reverted manually)?


Things get trickier if you need to keep track of past events.  But here 
is another approach that uses a Scheme engraver to do the bulk of the 
work:



\version "2.19.83"

#(begin
  (set-object-property! 'activeLaissezVibrer 'translation-type? list?)
  (set-object-property! 'activeLaissezVibrer 'translation-doc
"A list of LaissezVibrerTies which should span BarLines.")
  (set! all-translation-properties
(cons 'activeLaissezVibrer all-translation-properties)))

#(define (SpanLaissezVibrer_engraver context)
  (define (spanLaissezVibrer? grob)
(let* ((cause (ly:grob-property grob 'cause))
   (class (ly:event-property cause 'class '()))
   (span? (ly:event-property cause 'span #f)))
  (and (memq 'laissez-vibrer-event class) span?)))
  (define (past-events tie)
(ly:moment 0 bd) x (cdr xex))) yex)))
(map cdr ties))
  (make-engraver
(acknowledgers
  ((bar-line-interface engraver grob source-engraver)
(let ((ties (ly:context-property context
  'activeLaissezVibrer '(
  (set! ties (filter past-events ties))
  (if (not (null? ties)) (ly:grob-set-property!
grob 'stencil (stencil-proc ties)
  ((semi-tie-interface engraver grob source-engraver)
(if (spanLaissezVibrer? grob)
  (ly:context-set-property! context 'activeLaissezVibrer
(cons (cons (ly:context-now context) grob)
  (ly:context-property context
'activeLaissezVibrer '()

spanLaissezVibrer = #(make-music 'LaissezVibrerEvent 'span #t)

stopSpanLaissezVibrers = \applyContext #(lambda (context)
  (ly:context-set-property! (ly:context-find context 'Staff)
'activeLaissezVibrer '()))

Upper = {
  | r2 r8 g'8 b' c''
  | 1\spanLaissezVibrer
  | R1 \stopSpanLaissezVibrers \bar "||"
  | r8 a' g' e' c'2 \bar "|."
}
Lower = {
  | 1\spanLaissezVibrer
  | R1
  | g8 b 2.^\spanLaissezVibrer
  | R1 \stopSpanLaissezVibrers
}
\score {
  \new PianoStaff <<
\new Staff { \clef "treble" \Upper }
\new Staff { \clef "bass" \Lower }
  >>
  \layout { \context { \Staff
\consists \SpanLaissezVibrer_engraver } }
}


This is quite different from my previous manual approach, but this has 
advantages of exactly matching the vertical positioning of LV ties 
without needing manual intervention.



-- Aaron Hill

Re: Notes or chords sustained with a pedal

2019-12-21 Thread David R
On Friday, December 20, 2019, Robert Blackstone 
wrote:
> Dear all,
> I’m presently transcribing some piano-scores in which schords, sustained
with a pedal are notated in a way had not seen before (see screenshot).
> I would like to copy it but I have no idea how to do it.
> I would be grateful for any advice.


The "Clumsy Hack Department" says you might create some invisible notes for
those added ties to attach to.

-- 
-- 
David Rogers


RE: Notes or chords sustained with a pedal

2019-12-21 Thread Mark Stephen Mrotek
Robert,

 

Might it be the sostentuto pedal?

http://lilypond.org/doc/v2.19/Documentation/notation/piano

 

Mark

 

From: lilypond-user
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
Robert Blackstone
Sent: Saturday, December 21, 2019 3:33 AM
To: Robin Bannister 
Cc: Lilypond-User Mailing List 
Subject: Notes or chords sustained with a pedal

 

Hi Robin,

 

I tried some of the procedures I found on 

https://lists.gnu.org/archive/html/lilypond-user/2019-05/msg00202.html, the
thread you advised me  to look at but they did not help me very much. 

So I tried to  develop some trick or tweak without having to program things
with scheme, with which I have no experience at all.

Anyway, I found something that gave me a result, not quite identical to what
I wanted to get, but good enough for me and probably sufficiently clear for
a pianist.

 

See the attached screenshot.

 

Best regards,

 

Robert

 

 

 



Re: Notes or chords sustained with a pedal

2019-12-21 Thread Kieren MacMillan
Hi Aaron,

First of all, thanks for all your fabulous Scheme-y hacks! They not only help 
in the moment, but provide great bread crumbs for those of us who eventually 
want to know how to fish (to mix my metaphors).

> Here is my attempt at hacking the BarLine stencil to add overlapping ties:

This is so cool. Is there an easy way to make the function determine the 
"current" set of LVs (i.e., the LV configuration from the most recent LV-ed 
chord) and automagically apply it to the subsequent barlines (e.g., with a 
\temporary, to be \reverted manually)?

Thanks!
Kieren.


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




Re: Notes or chords sustained with a pedal

2019-12-21 Thread Robin Bannister

Robert Blackstone wrote:


> I’m presently transcribing some piano-scores in which schords,
> sustained with a pedal are notated in a way had not seen before
> (see screenshot).

Referring to that original screenshot, surely there is no pedal here. 
The pedal would blur what the right hand is doing.


This is much more likely laissezvibrer asking for the lefthand fifth to 
be allowed to resonate to the sounds produced by the right hand.
It wants the keys kept pressed even when the initial pp may have decayed 
to .




> Anyway, I found something that gave me a result, not quite identical
> to what I wanted to get, but good enough for me and probably
> sufficiently clear for a pianist. See the attached screenshot.

That wouldn't be good enough for me.

In sightreading mode I would glimpse that in the lefthand there is 
nothing at the start of the second measure, and so would release the 
fifth sooner than is intended.


In sightreading mode I would ignore the middle of the second measure.
It is only in the context of this thread that I can guess what is meant.

I think there should be something tie-like (complete or open) crossing 
from the first measure to the second.



Cheers,
Robin










Re: Notes or chords sustained with a pedal

2019-12-21 Thread Aaron Hill

On 2019-12-21 3:32 am, Robert Blackstone wrote:

Hi Robin,

I tried some of the procedures I found on
https://lists.gnu.org/archive/html/lilypond-user/2019-05/msg00202.html
,
the thread you advised me  to look at but they did not help me very
much.
So I tried to  develop some trick or tweak without having to program
things with scheme, with which I have no experience at all.
Anyway, I found something that gave me a result, not quite identical
to what I wanted to get, but good enough for me and probably
sufficiently clear for a pianist.


Looks like I may be a little late to the party.

Here is my attempt at hacking the BarLine stencil to add overlapping 
ties:



\version "2.19.83"

laissezVibrerBar = #(define-music-function
  (positions) (number-pair-list?)
  (define (stencil-proc grob)
(let* ((th (ly:staff-symbol-line-thickness grob))
   (bd (ly:item-break-dir grob))
   (orig (ly:bar-line::print grob))
   (xex (ly:stencil-extent orig X))
   (x (interval-index xex 0))
   (w (+ 0.8 (/ (- (interval-length xex) th) 2
  (define (position-tie pos)
(let* ((y (+ (car pos) (* 2 th (cdr pos
   (tie (make-tie-stencil
  (cons (- x w) y) (cons (+ x w) y)
  th (cdr pos)))
   (xex (ly:stencil-extent tie X))
   (yex (ly:stencil-extent tie Y)))
(ly:make-stencil (ly:stencil-expr tie)
  (cons (car xex) (if (> 0 bd) x (cdr xex))) yex)))
  (ly:stencil-add orig
(apply ly:stencil-add (map position-tie positions)
  #{ \override Staff.BarLine.stencil = $stencil-proc #})


laissezVibrerBarUpper =
  \once \laissezVibrerBar #'((2 . 1) (0 . -1) (-1 . -1))
Upper = { \clef "treble"
  1\laissezVibrer
 \laissezVibrerBarUpper
  R1 \laissezVibrerBarUpper \bar "||"
  R1 \laissezVibrerBarUpper \bar ":|.|:" \break
  R1 \laissezVibrerBarUpper \bar ""
  R1 \laissezVibrerBarUpper \bar "."
  R1 \laissezVibrerBarUpper \bar "|."
}
laissezVibrerBarLower =
  \once \laissezVibrerBar #'((2 . 1) (-1 . -1) (-3 . -1))
Lower = { \clef "bass"
  1\laissezVibrer
 \laissezVibrerBarLower
  \repeat unfold 5 { R1 \laissezVibrerBarLower }
}

\paper { #(set-paper-size "a7landscape")
  indent = 0 ragged-right = ##f tagline = ##f }
\new PianoStaff << \new Staff \Upper \new Staff \Lower >>



-- Aaron Hill

Re: Notes or chords sustained with a pedal

2019-12-20 Thread Robin Bannister

Robert Blackstone wrote:

Dear all,
I’m presently transcribing some piano-scores in which schords, sustained with a 
pedal are notated in a way had not seen before (see screenshot).
I would like to copy it but I have no idea how to do it.



This thread may get you started:
https://lists.gnu.org/archive/html/lilypond-user/2019-05/msg00202.html


Cheers,
Robin