Re: Naming multiple midi files

2019-12-21 Thread Robin Bannister

  kupirijo wrote:


I would like to specify the name (or extensions) of the .midi files
exported by the \midi{} command. I have multiple \scores{} in one .ly
file producing one .pdf file and multiple .midi files.


I do something like that by setting up a \book block for each midi 
output file.  Each such block has a \score section and a \midi section 
and starts off with a \bookOutputName (or just a \bookOutputSuffix) 
declaration.


See
http://lilypond.org/doc/v2.19/Documentation/notation/output-file-names


Cheers,
Robin



Notes or chords sustained with a pedal

2019-12-21 Thread Robert Blackstone
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





convert-ly problems

2019-12-21 Thread Peter Gentry
Thanks Knute

 

However the problem for windows (as usual) is more difficult.  In addition
to the PATH I needed the following to set up the association.

First get check the associated name of the python file type. 

In an admin command prompt run the following

*   assoc {Python} result  "no association.."
*
*   I created one

Python="C:\Program Files (x86)\LilyPond\usr\bin\python.exe" "%1"

Now I look in Default Apps and there is PYTHON

SUCCESS!

Now convert-ly.py works

 

I could have use something Lily specific as the association PYTHONLILY say
maybe I will later.

 

I expect I will have to do something similar if I go back to PYTHON  proper.

 

Isn't Windows wonderful 

 

Regards Peter

 



Re: [Spam] Notes or chords sustained with a pedal

2019-12-21 Thread Rutger Hofman

Hi Robert,

I use trickery:
1) with a shortened first note duration to stop the first tie
2) with hidden notes to get ties to start/stop at a time I want

\version "2.21.0"

% By Nick Payne. Hide notes etc but also avoid (invisible) collisions.

transOn = {
  \override NoteColumn.ignore-collision = ##t
  \override NoteHead.no-ledgers = ##t
  \hide NoteHead
  \hide Stem
  \hide Flag
  \hide Beam
  \hide Dots
  \hide Accidental
  \hide TupletBracket
  \hide TupletNumber
}

\score {
\new Staff {
\clef bass
\relative c {
1*1/4~ \once \transOn q2 \once \transOn q4~ |
\once \transOn q1 |
}
}
}

HTH,

Rutger

On 12/21/19 12:32 PM, 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.


See the attached screenshot.

Best regards,

Robert







RE: convert-ly problems

2019-12-21 Thread Peter Gentry
I spoke too soon.

 

C:\WINDOWS\system32>convert-ly

 

C:\WINDOWS\system32>C:\"Program Files (x86)"\LilyPond\usr\bin\python.exe
C:\"Program Files (x86)"\LilyPond\usr\bin\convert-ly.py

C:\Program Files (x86)\LilyPond\usr\bin\python.exe: can't open file
'C:"Program': [Errno 22] Invalid argument

 

C:\WINDOWS\system32>

 

This did work first time but now another wonderful windows surprise.

 

 

 

 

 

 

 

 

From: Peter Gentry  
Sent: 21 December 2019 12:02
To: Lilypond Users (lilypond-user@gnu.org) 
Cc: 'ksnor...@gmail.com' 
Subject: convert-ly problems

 

Thanks Knute

 

However the problem for windows (as usual) is more difficult.  In addition
to the PATH I needed the following to set up the association.

First get check the associated name of the python file type. 

In an admin command prompt run the following

*   assoc {Python} result  "no association.."
*
*   I created one

Python="C:\Program Files (x86)\LilyPond\usr\bin\python.exe" "%1"

Now I look in Default Apps and there is PYTHON

SUCCESS!

Now convert-ly.py works

 

I could have use something Lily specific as the association PYTHONLILY say
maybe I will later.

 

I expect I will have to do something similar if I go back to PYTHON  proper.

 

Isn't Windows wonderful 

 

Regards Peter

 



A suggestion - add rf to built-in dynamics

2019-12-21 Thread Peter Toye
May I suggest adding 'rf' to the built-in dynamics? Beethoven and Brahms used 
it quite a lot, even if it is synonymous with 'rfz' (pedants might disagree). 
As did some other, lesser, composers (one of whose music I am currently 
engraving).

A far as I can see, it just needs adding 

rfz = #(make-dynamic-script "rfz")

to dynamic-scripts-init.ly

There's an easy workaround of course - just put that line somewhere in your own 
music, but to me it seems as though it's common enough to build it into 
LilyPond.

 
Regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

Re: A suggestion - add rf to built-in dynamics

2019-12-21 Thread Kieren MacMillan
Hi Peter,

> May I suggest adding 'rf' to the built-in dynamics? Beethoven and Brahms used 
> it quite a lot, even if it is synonymous with 'rfz' (pedants might disagree).

Is f the same as fz?

> A far as I can see, it just needs adding
> rfz = #(make-dynamic-script "rfz")
> to dynamic-scripts-init.ly

You could always submit a patch!  =)

Cheers,
Kieren.


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




Re: A suggestion - add rf to built-in dynamics

2019-12-21 Thread Peter Toye

Saturday, December 21, 2019, 1:04:09 PM, Kieren MacMillan wrote:

> Hi Peter,

>> May I suggest adding 'rf' to the built-in dynamics? Beethoven and Brahms 
>> used it quite a lot, even if it is synonymous with 'rfz' (pedants might 
>> disagree).

> Is f the same as fz?
f=forte, fz=forzando or sforzando.. rf=rfz=rinforzando (Source: The New Oxford 
Companion to Music)

>> A far as I can see, it just needs adding
>> rfz = #(make-dynamic-script "rfz")
>> to dynamic-scripts-init.ly

> You could always submit a patch!  =)
When I've worked out how to do it. Also, the documentation will have to be 
upgraded.
I'm windows-based which, looking at the CG, is not a good starting place for 
patching.

> Cheers,
> Kieren.
> 

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

All the best,

Peter

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-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: Naming multiple midi files

2019-12-21 Thread kupirijo
Thanks. I am aware of this method but this is not exactly what I want. I 
need to output one .pdf file, not many.


Is this possible?

Best,

kupirijo

Στις 21/12/19 1:11 pm, ο Robin Bannister έγραψε:

kupirijo wrote:


I would like to specify the name (or extensions) of the .midi files
exported by the \midi{} command. I have multiple \scores{} in one .ly
file producing one .pdf file and multiple .midi files.


I do something like that by setting up a \book block for each midi 
output file.  Each such block has a \score section and a \midi section 
and starts off with a \bookOutputName (or just a \bookOutputSuffix) 
declaration.


See
http://lilypond.org/doc/v2.19/Documentation/notation/output-file-names


Cheers,
Robin




Re: Naming multiple midi files

2019-12-21 Thread Robin Bannister

kupirijo wrote:

Thanks. I am aware of this method but this is not exactly what I want. I
need to output one .pdf file, not many.


The \book blocks I suggested will not produce .pdf files.
They do not contain \layout sections.

To output the .pdf file you need a single additional \book block with 
\paper, \score and \layout sections (and no \midi section).



Cheers,
Robin





Re: Naming multiple midi files

2019-12-21 Thread kupirijo
I see. But then I need to copy the notes twice, one for the book with 
layout and for the book with the midi.


kupirijo

Στις 21/12/19 6:55 pm, ο Robin Bannister έγραψε:

kupirijo wrote:

Thanks. I am aware of this method but this is not exactly what I want. I
need to output one .pdf file, not many.


The \book blocks I suggested will not produce .pdf files.
They do not contain \layout sections.

To output the .pdf file you need a single additional \book block with 
\paper, \score and \layout sections (and no \midi section).



Cheers,
Robin






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 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: A suggestion - add rf to built-in dynamics

2019-12-21 Thread Malte Meyn




Am 21.12.19 um 13:42 schrieb Peter Toye:
May I suggest adding 'rf' to the built-in dynamics? Beethoven and Brahms 
used it quite a lot, even if it is synonymous with 'rfz' (pedants might 
disagree). As did some other, lesser, composers (one of whose music I am 
currently engraving).


A far as I can see, it just needs adding

rfz = #(make-dynamic-script "rfz")

to dynamic-scripts-init.ly


Should LilyPond support other dynamics that are not present yet? Looking 
at https://w3c.github.io/smufl/gitbook/tables/dynamics.html I’d propose


\pp
\ff
\sfzp
\sffz
\pf

I have never seen the last one but I’ve also never seen LilyPond’s \sp 
and \spp. However, I have seen \mfp and \ffp for accents weaker/stronger 
than \fp. So maybe one could add them too?




Re: Naming multiple midi files

2019-12-21 Thread Carl Sorensen


On 12/21/19, 10:06 AM, "kupirijo"  wrote:

I see. But then I need to copy the notes twice, one for the book with 
layout and for the book with the midi.

No, you just need to put the notes in a variable.

myMusic = { ... }

\score {
   \myMusic
   \layout{}
}

\score {
   \myMusic
   \midi{}
}

HTH,

Carl


kupirijo

Στις 21/12/19 6:55 pm, ο Robin Bannister έγραψε:
> kupirijo wrote:
>> Thanks. I am aware of this method but this is not exactly what I want. I
>> need to output one .pdf file, not many.
>
> The \book blocks I suggested will not produce .pdf files.
> They do not contain \layout sections.
>
> To output the .pdf file you need a single additional \book block with 
> \paper, \score and \layout sections (and no \midi section).
>
>
> Cheers,
> Robin
>
>






Re: LSR contribution

2019-12-21 Thread Thomas Morley
Am Sa., 21. Dez. 2019 um 00:35 Uhr schrieb Michael Käppler :
>
> Hi Harm et al.,
> attached is my updated version.
> I decided to split up the validity checks from the actual engraver,
> because otherwise in case of invalid parameters the engraver would
> only be instantiated to do nothing and nevertheless have its
> acknowledger called every time.
> The code is much more verbose now, which makes the flow of information
> and control
> clearer I hope.
>
> Please let me know what you think about it.
>
> Cheers,
> Michael


Hi Michael,

thanks again for your updated snippet.

I've taken a closer look.

You try to give the user always meaningful warning-messages.
That's great, putting out really helpful messages is hard work...
Alas, speaking only for me, I don't like those multiple nested `if`.
Thus I defined `type-check-intervals-given` and use it to filter the
user-given interval-list.
`filter` will return false for the first occurrence of failed
`type-check-intervals-given`. Thus it can be used to deal with
user-errors step-by-step.
Along with it, I added a basic check for the user provided list (about
equal length of each sublist)
There was an undefined variable `gen-warntext`, which is now gone as well.

Furthermore, I changed the basic `intervaldefs` to take only pairs of
the interval-string and the semi-tonoc steps. The diatonic steps are
calculated relying on the interval-string.

I found no need to do work in `process-acknowledged`.
Thus all work is done in 'note-head-interface of `acknowledgers`
Probably more efficient, but I have not really checked.

A plethora of minor changes in code and comments... ;)

WDYT?

Btw, there is one case, where I don't know how to deal with:
2.18.2 can't cope with an empty engraver, see:

\score {
  \new Staff \relative c' { c4 d }
  \layout {
\context {
  \Voice
  \consists \color_interval_engraver #intervaldefs #`(("30-" 0 #t ,green))
}
  }
}

No problem for 2.19.83, though.

Cheers,
  Harm
\version "2.18.2"

%% Interval definitions alist
%% Key:
%% number determines the interval type, 1=prime, 2=second, 3=third ...
%% plus and minus signs determine variant, no sign=perfect interval, +=major,
%% ++=augmented, -=minor, --=diminished
%% Value:
%% the cdr represents the semitonic steps.
%% diatonic steps are calculated relying on the key in the engraver
%% Only positive values are specified, negative values for
%% intervals downwards are generated in the engraver.
%% This list may be extended or completely overwritten
%% Usage: #(display (assoc-get "4--" intervaldefs))

#(define intervaldefs
   '(("1++" . 1)
 ("1" . 0)
 ("2-" . 1)
 ("2--" . 0)
 ("2+" . 2)
 ("2++" . 3)
 ("3-" . 3)
 ("3--" . 2)
 ("3+" . 4)
 ("3++" . 5)
 ("4--" . 4)
 ("4++" . 6)
 ("4" . 5)
 ("5--" . 6)
 ("5++" . 8)
 ("5" . 7)
 ("6-" . 8)
 ("6--" . 7)
 ("6+" . 9)
 ("6++" . 10)
 ("7-" . 10)
 ("7--" . 9)
 ("7+" . 11)
 ("7++" . 12)
 ("8--" . 11)
 ("8++" . 13)
 ("8" . 12)
 ("9-" . 13)
 ("9--" . 12)
 ("9+" . 14)
 ("9++" . 15)
 ("10-" . 15)
 ("10--" . 14)
 ("10+" . 16)
 ("10++" . 17)
 ("11--" . 16)
 ("11++" . 18)
 ("11" . 17)
 ("12--" . 18)
 ("12" . 19)))

%% Create an engraver that compares the intervals between sequential pitches
%% of a voice with a given list of intervals.
%% If a specified interval is found, the heads of both notes encompassing
%% the interval are colored.
%%
%% Mode of operation:
%% Intervals are defined by two integers representing the diatonic
%% resp. semitonic distance between two pitches.
%% It is necessary to take both distances into account to distinguish
%% between enharmonically identical intervals, e.g. a major third
%% and a diminished fourth.
%% Example:
%% d -> f# : diatonic distance = 2 steps (f# is derived from f natural),
%% semitonic distance = 4 steps
%% d -> gb: diatonic distance = 3 steps (gb is derived from g natural),
%% semitonic distance = 4 steps
%%
%% The engraver consists of two parts:
%%
%% color_interval_engraver: checks, whether the given parameters are valid,
%% looks up the interval in the interval definitions alist and hands
%% the determined interval distances together with the other unchanged
%% parameters over to the actual engraver color-interval-engraver-core.
%%
%% color-interval-engraver-core: creates a scheme-engraver which
%% acknowledges note head grobs and stores the last and
%% current grob locally. Then the pitches are extracted and the interval between
%% the last and current pitch is compared to the specified interval.
%%
%% Usage:
%% \color_interval_engraver #intervaldefs #debug? intervals-given
%%
%% intervaldefs: alist containing information about semitonical distances for 
%% certain intervals, diatonical distance is calculated in the engraver using
%% `string-diatonic-semi-tonic-list`, relying on the key.
%%
%% debug?: (optional) boolean, if true, output information a

Re: convert-ly problems

2019-12-21 Thread Knute Snortum
-->C:\"Program Files (x86)"\LilyPond\usr\bin\python.exe<--

This looks like the quotes are in the wrong place.

---
Knute Snortum
(via Gmail)

On Sat, Dec 21, 2019 at 4:32 AM Peter Gentry
 wrote:
>
> I spoke too soon.
>
>
>
> C:\WINDOWS\system32>convert-ly
>
>
>
> C:\WINDOWS\system32>C:\"Program Files (x86)"\LilyPond\usr\bin\python.exe 
> C:\"Program Files (x86)"\LilyPond\usr\bin\convert-ly.py
>
> C:\Program Files (x86)\LilyPond\usr\bin\python.exe: can't open file 
> 'C:"Program': [Errno 22] Invalid argument
>
>
>
> C:\WINDOWS\system32>
>
>
>
> This did work first time but now another wonderful windows surprise.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> From: Peter Gentry 
> Sent: 21 December 2019 12:02
> To: Lilypond Users (lilypond-user@gnu.org) 
> Cc: 'ksnor...@gmail.com' 
> Subject: convert-ly problems
>
>
>
> Thanks Knute
>
>
>
> However the problem for windows (as usual) is more difficult.  In addition to 
> the PATH I needed the following to set up the association.
>
> First get check the associated name of the python file type.
>
> In an admin command prompt run the following
>
> assoc {Python} result  “no association……”
>
> I created one
>
> Python="C:\Program Files (x86)\LilyPond\usr\bin\python.exe" "%1"
>
> Now I look in Default Apps and there is PYTHON
>
> SUCCESS!
>
> Now convert-ly.py works
>
>
>
> I could have use something Lily specific as the association PYTHONLILY say 
> maybe I will later.
>
>
>
> I expect I will have to do something similar if I go back to PYTHON  proper.
>
>
>
> Isn’t Windows wonderful 
>
>
>
> Regards Peter
>
>



Re: A suggestion - add rf to built-in dynamics

2019-12-21 Thread Andrew Bernard
Hi Peter,

Well I have a library file with over 150 custom dynamics, for use with
engraving new complexity school scores. It's a big file, with all
sorts of rare dynamics. I see no need to push non-standard or rare
dynamics on everybody. Just make an include file for your score and
add 'rf'. One could argue that the original composers are in error, or
it's an obsolete convention, and perhaps this would mislead modern
players anyway (the infinite discussion of the urtext!).

I don't see a need for rf to be added to the core set.

[And amusingly I have  all the ones Malte suggested. and lots of marks
like 'f (poco)' and similar which is actually commonly found, and yet
does not need to be in the core.]


Andrew

On Sat, 21 Dec 2019 at 23:42, Peter Toye  wrote:
>
> May I suggest adding 'rf' to the built-in dynamics? Beethoven and Brahms used 
> it quite a lot, even if it is synonymous with 'rfz' (pedants might disagree). 
> As did some other, lesser, composers (one of whose music I am currently 
> engraving).
>
> A far as I can see, it just needs adding
>
> rfz = #(make-dynamic-script "rfz")
>
> to dynamic-scripts-init.ly
>
> There's an easy workaround of course - just put that line somewhere in your 
> own music, but to me it seems as though it's common enough to build it into 
> LilyPond.
>
>
> Regards,
>
> Peter
> mailto:lilyp...@ptoye.com
> www.ptoye.com



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 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