Re: Adding metronome click track to MIDI

2020-06-03 Thread Francesco Petrogalli
Robin, Valentin,

thank you both for your help. I have created a solution based on your
examples. I hope you don't mind the copy and paste + tweak exercise,
as I am assuming that you are happy for me to give a CC BY SA 4.0
license to code that is based on the examples you have published in
the mailing list. FWIW, I have credited both of you in the commit
messages. Please let me know if my assumption is correct. Conversely,
if you rather not have this code included in the source of this open
source project, I will remove it and try to find an alternative
solution. [*]

The code that works for me is the following, I will merge it when I
get an "OK go" from both of you:

https://github.com/fpetrogalli/trr/pull/1/files

The `unfold 83` is a bit ugly, but it allows me to obtain what I need
without having to dig into lilypond internals and scheme syntax.

Kind regards,

Francesco

[*] Admittedly, I should have dont this the other way around, first
ask about using your code, and then including it into my project on
github. Hopefully what I have done, although not formally correct, is
in line with the open source spirit of the lilypond community in terms
of sharing snippets and examples.

On Wed, Jun 3, 2020 at 11:04 AM Valentin Villenave
 wrote:
>
> On 6/3/20, Francesco Petrogalli  wrote:
> > Is there a special midi instrument I could use for that?
>
> Not that I know.
> BTW, here’s a quick-and-dirty way of adding a click track, in case you
> might find it useful:
>
> %%
>
> addTicks =
> #(define-music-function (m) (ly:music?)
>#{ << $m
>  \new Devnull \with {
>\consists Drum_note_performer
>\consists Staff_performer
>\consists Dynamic_performer
>midiInstrument = #"woodblock"
>  } \drummode {
><>\ff \repeat unfold
>$(ly:moment-main-numerator
>  (ly:moment-div
>   (ly:music-length m)
>   (ly:make-moment 1 4)))
>rb4 }>> #})
>
> music = \relative  c' { c2 d e f g a b c }
>
> \score {
>   \new Staff \addTicks \music
>   \layout {}
>   \midi {}
> }
>
> 
>
> Cheers,
> -- V.



Re: two lv ties on merged notehead

2020-06-03 Thread Owen Lamb
Hi Michael,

Looks like LilyPond prints both lv ties, but they end up at exactly the
same spot. The ^ and _ prefixes let you specify direction for most
anything, including \laissezVibrer, so you could do this to separate them:

\new Staff {
  <<
{
  d,4 ^\laissezVibrer ^\markup{ 0.0 }
}
\new Voice {
  \voiceTwo d,4 \laissezVibrer
}
  >>
}

Hope this helps,
Owen

On Wed, Jun 3, 2020 at 5:14 PM Michael Winter via LilyPond user discussion <
lilypond-user@gnu.org> wrote:

> It seems that when a notehead is merged in two voices no matter what you
> do you, lilypond only adds on lv tie. Is there a way to force 2 lv ties?
>
> <<{ d,4\laissezVibrer ^ \markup{ 0.0 }  } \new Voice { \voiceTwo
> d,4\laissezVibrer  }>>
>
> Thanks in advance.
>
> -Michael
>


Re: list of strings from a string

2020-06-03 Thread Freeman Gilmore
> Also it will not backslash-escape quote marks or newlines or, well,
> backslashes.  If you want a rendition that can be read back by Scheme,
> «write» really is the saner option.
>
> --
> David KastrupThank you that is good to know.   It is working fine for me 
> now, thanks, ƒg



Re: list of strings from a string

2020-06-03 Thread David Kastrup
Valentin Villenave  writes:

> On 6/3/20, Freeman Gilmore  wrote:
>>   % Gives me this: (-3 A -6 1 -B),
>
> Well, it _is_ a list of strings, as you can verify by adding:
>
> #(display (map string? Y))
>
> Or you can use
>   #(write Y)
> instead of (display Y), which will print the double quotes.
>
>>   % I need: ("-3" "A" "-6" "1" "-B"), how do I get this?  A list of
>> strings.
>
> Well, you can always do
>
> #(set! Y (map (lambda (s) (string-append "\"" s "\"")) Y))
>
> but as I said, that’s not necessary.

Also it will not backslash-escape quote marks or newlines or, well,
backslashes.  If you want a rendition that can be read back by Scheme,
«write» really is the saner option.

-- 
David Kastrup



two lv ties on merged notehead

2020-06-03 Thread Michael Winter via LilyPond user discussion
It seems that when a notehead is merged in two voices no matter what you do 
you, lilypond only adds on lv tie. Is there a way to force 2 lv ties?

<<{ d,4\laissezVibrer ^ \markup{ 0.0 }  } \new Voice { \voiceTwo 
d,4\laissezVibrer  }>>

Thanks in advance.

-Michael

Re: list of strings from a string

2020-06-03 Thread Freeman Gilmore
David and Valentin Thank you.  I did not know about #(write  ...).
  I will switch to write from now on.

On Wed, Jun 3, 2020 at 11:41 AM Valentin Villenave
 wrote:
>
> On 6/3/20, Freeman Gilmore  wrote:
> >   % Gives me this: (-3 A -6 1 -B),
>
> Well, it _is_ a list of strings, as you can verify by adding:
>
> #(display (map string? Y))
>
> Or you can use
>   #(write Y)
> instead of (display Y), which will print the double quotes.
>
> >   % I need: ("-3" "A" "-6" "1" "-B"), how do I get this?  A list of
> > strings.
>
> Well, you can always do
>
> #(set! Y (map (lambda (s) (string-append "\"" s "\"")) Y))
>
> but as I said, that’s not necessary.
>
> Cheers,
> -- V.



Re: A weird spacing problem

2020-06-03 Thread Gregory Hollands
Robert,

For what it's worth, the following code runs without spacing issues on
2.18.2
Note that I commented out one of the overrides.

-Greg

%
\version "2.18.2"

PartPOneVoiceOne = {
\clef "treble"
\key c \major
\time 3/4
fis'8) c''8\rest  \override NoteColumn #'force-hshift = #-2.5  fis'!2|
fis'!2.^~|
fis'8 [\override NoteColumn #'force-hshift = #-1 f'!8 ] d'2|
}

PartPOneVoiceTwo = {
\clef "treble"
\key c \major
\time 3/4
8 d'8 \rest  < d' f'! >4 _(< c' es'! >4 |
\override NoteColumn #'force-hshift = #-2.5 4 c'4 b4_~)|
b2.|
}

PartPTwoVoiceOne = {
\clef "bass"
\key c \major
\time 3/4
\once \override NoteColumn.X-offset = #-4 \stemDown  8 e8 \rest < es
fis a >2|
\once \override NoteColumn.X-offset = #-4 \stemUp f4 a4 gis4|
s2.|
}

PartPTwoVoiceTwo = {
\clef "bass"
\key c \major
\time 3/4
<< \stemDown {8 d8 \rest s4 } \\ { a8 s8 2 } >> |
%\override NoteColumn #'force-hshift = #-5
es2.|
\override NoteColumn #'force-hshift = #-2 \stemDown < es g >2.|
}

\score {
\new PianoStaff \with {
\override VerticalAxisGroup.staff-staff-spacing = #'((basic-distance . 12))
connectArpeggios = ##t
}
<<
\new Staff = "upper" <<
\new  Voice = "PartPOneVoiceOne"  \PartPOneVoiceOne
\new Voice = "PartPOneVoiceTwo"  \PartPOneVoiceTwo
>>

\new Staff = "lower" <<
\new Voice = "PartPTwoVoiceOne"  \PartPTwoVoiceOne
\new  Voice = "PartPTwoVoiceTwo" \PartPTwoVoiceTwo
>>
>>
}
%


Hi Valentin,
> Thanks for your interest in my problem
> The piece, as you can see in the screenshot, is a piano score with two
> voices in each staff and occasionally a third voice by << { } \\ { } >> or
> \partcombine.
> I triple-checked my source code, first by hiding successively each voice,
> and see what happens, and then to comment out and successively reopen all
> lines, 55 in each voice,  in my score. Compared with the original
> everything is OK except the passage (only 3 bars) shown in the screenshot.
> Thereafter, in the last 7 bars of the piece everything is again perfect.
>
> Overall there are several instances where I needed "\once \override
> NoteColumn #'force-hshift = #x" , and a few "\once\override
> NoteColumn.X-offset = #x”.
> I use LilyPond 2_19_83-1 with TeXShop as the editor. Usually it works
> perfectly.
> I include the problematic part of the score. It is certainly not a *M*WE
> but it works for me and it shows the problem. It also shows that its origin
> does not ly in the previous bars.
> Thanks again for your interest.
> Best regards,
> Robert
>
>
> On 3 Jun 2020, at 14:14, Valentin Villenave 
> wrote:
> On 6/3/20, Robert Blackstone  wrote:
> Hi Robert,
> Unless you post some code, it’s gonna be difficult to help you. You
> should first double check your source files in case there’s some
> \override affecting the DotColumn object somewhere?
> Cheers,
> -- V.


I’m vainly struggling with a weird spacing problem


Re: A weird spacing problem

2020-06-03 Thread Valentin Villenave
On 6/3/20, Mark Stephen Mrotek  wrote:
> When I set piano four part I let Lilypond do all the work.

Hear hear! (Even for more than four parts, btw.)

> I have taken the liberty of recoding the section using four-part voicing.

Yeah, so did I!  That sure was tempting wasn’t it? :-)

Cheers,
-- V.



Re: A weird spacing problem

2020-06-03 Thread Valentin Villenave
On 6/3/20, Robert Blackstone  wrote:
> Overall there are several instances where I needed "\once \override
> NoteColumn #'force-hshift = #x" , and a few "\once\override
> NoteColumn.X-offset = #x”.

Ouch.  That’s pretty brutal.  May I ask why you felt the need to use
all these?  This alters drastically the layout, and basically amounts
to force your own spacing decisions onto LilyPond’s.

Frankly, I’ve written (and transcribed) very complex piano scores, and
not once have I needed to mess with Lily’s own idea of where the
NoteColumn objects should begin and end; of course \voiceThree and
\voiceFour internally rely on that, but with some fairly sane (and
tame) predefined values.  If you need some non-standard alignments,
I’d recommend using the simplest of tricks like invisible rests and
duration multipliers instead:



upperI = \relative {
  fis'8 r fis2 fis2.~ fis8 f d2
}

upperII = \relative {   
  8 r s32 4*15/16( 
  s4*3/4  c b)~ 2.
}

lowerI = \relative {
  \oneVoice 8 r 2
  \voiceOne s4*3/4 f a gis s2.
}

lowerII = \relative {
  s2. es 
}

\new PianoStaff <<
  \accidentalStyle PianoStaff.neo-modern
  \new Staff = "up" <<
\time 3/4
\new Voice { \voiceOne \upperI }
\new Voice { \voiceTwo \upperII }
  >>
  \new Staff = "dn" <<
\clef bass
\new Voice { \voiceOne \lowerI }
\new Voice { \voiceTwo \lowerII }
  >>
>>

\layout { \context { \Staff \consists #Merge_rests_engraver } }



Cheers,
-- V.



Re: A weird spacing problem

2020-06-03 Thread Thomas Morley
Am Mi., 3. Juni 2020 um 19:27 Uhr schrieb Robert Blackstone
:
>
> Hi Valentin,
>
> Thanks for your interest in my problem
>
> The piece, as you can see in the screenshot, is a piano score with two voices 
> in each staff and occasionally a third voice by << { } \\ { } >> or 
> \partcombine.
> I triple-checked my source code, first by hiding successively each voice, and 
> see what happens, and then to comment out and successively reopen all lines, 
> 55 in each voice,  in my score. Compared with the original everything is OK 
> except the passage (only 3 bars) shown in the screenshot. Thereafter, in the 
> last 7 bars of the piece everything is again perfect.
>
> Overall there are several instances where I needed "\once \override 
> NoteColumn #'force-hshift = #x" , and a few "\once\override 
> NoteColumn.X-offset = #x”.
>
> I use LilyPond 2_19_83-1 with TeXShop as the editor. Usually it works 
> perfectly.
>
> I include the problematic part of the score. It is certainly not a MWE but it 
> works for me and it shows the problem. It also shows that its origin does not 
> ly in the previous bars.
>
> Thanks again for your interest.
>
> Best regards,
> Robert
>
>
>
> On 3 Jun 2020, at 14:14, Valentin Villenave  wrote:
>
> On 6/3/20, Robert Blackstone  wrote:
>
> I’m vainly struggling with a weird spacing problem
>
>
> Hi Robert,
> Unless you post some code, it’s gonna be difficult to help you. You
> should first double check your source files in case there’s some
> \override affecting the DotColumn object somewhere?
>
> Cheers,
> -- V.
>
>

Hi Robert,

there are a lot unrelated warnings cluttering the log.
I'd not use pitched rests but normal rests with an override for
staff-position. Also, \voiceXxx
Though, that's unrelated.

The culprit seems to be your
\override NoteColumn.X-offset = #-4
(and some forgotten(?) \once ... )

A minimal would be:
<< { \once \override NoteColumn.X-offset = #-4 d'2. } { \voiceThree b4 } >>

The negative X-offset will push all other stuff to the left including the dots.


Cheers,
  Harm



Makes no sense to me



RE: A weird spacing problem

2020-06-03 Thread Mark Stephen Mrotek
Robert,

 

When I set piano four part I let Lilypond do all the work.

I have taken the liberty of recoding the section using four-part voicing.

 

Mark

 

From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] 
On Behalf Of Robert Blackstone
Sent: Wednesday, June 3, 2020 10:27 AM
To: Valentin Villenave 
Cc: Lilypond-User Mailing List 
Subject: Re: A weird spacing problem

 

Hi Valentin, 

 

Thanks for your interest in my problem

 

The piece, as you can see in the screenshot, is a piano score with two voices 
in each staff and occasionally a third voice by << { } \\ { } >> or 
\partcombine.

I triple-checked my source code, first by hiding successively each voice, and 
see what happens, and then to comment out and successively reopen all lines, 55 
in each voice,  in my score. Compared with the original everything is OK except 
the passage (only 3 bars) shown in the screenshot. Thereafter, in the last 7 
bars of the piece everything is again perfect.

  

Overall there are several instances where I needed "\once \override NoteColumn 
#'force-hshift = #x" , and a few "\once\override NoteColumn.X-offset = #x”.

 

I use LilyPond 2_19_83-1 with TeXShop as the editor. Usually it works perfectly.

 

I include the problematic part of the score. It is certainly not a MWE but it 
works for me and it shows the problem. It also shows that its origin does not 
ly in the previous bars.

 

Thanks again for your interest.

\version "2.19.49"

\header {
}

\new PianoStaff <<
   \new Staff = "upper" <<
 \time 3/4
 \key c \major
 \new Voice = "soprano"
 { \voiceOne \relative c'' {
   fis,8 r
   \once \override NoteColumn.force-hshift = #2.2
   \once \override Accidental.X-extent = #'(1 . 0)
   \once \override Accidental.extra-offset = #'(3 . 0)
   fis!2 |
   fis2.~ | fis8 f d2 |
   }
 }
 
 \new Voice = "alto"
 { \voiceTwo \relative c'' {
   8 r
   
   4 ( |
c b~) | b2. |
}
 }  
 
   >>
   \new Staff = "lower" <<
 \time 3/4
 \key c \major
 \clef bass
 \new Voice = "tenor"
 { \voiceOne \relative c {
   s2. | f4 a gis | s2. |
}
 }
 
 \new Voice = "bass"
 { \voiceTwo \relative c {
   8 d\rest 2 |
   ees2. |  |
   }
   
 }
   >>

 >>
 
\layout {
 indent = #0
   }


%{
convert-ly.py (GNU LilyPond) 2.19.80  convert-ly.py: Processing `'...
Applying conversion: 2.19.2, 2.19.7, 2.19.11, 2.19.16, 2.19.22,
2.19.24, 2.19.28, 2.19.29, 2.19.32, 2.19.40, 2.19.46, 2.19.49
%}


%{
convert-ly.py (GNU LilyPond) 2.19.80  convert-ly.py: Processing `'...
Applying conversion: The document has not been changed.
%}


Re: A weird spacing problem

2020-06-03 Thread Robert Blackstone
Hi Valentin, Thanks for your interest in my problemThe piece, as you can see in the screenshot, is a piano score with two voices in each staff and occasionally a third voice by << { }  \\ {  } >> or \partcombine.I triple-checked my source code, first by hiding successively each voice, and see what happens, and then to comment out and successively reopen all lines, 55 in each voice,  in my score. Compared with the original everything is OK except the passage (only 3 bars) shown in the screenshot. Thereafter, in the last 7 bars of the piece everything is again perfect.  Overall there are several instances where I needed "\once \override NoteColumn #'force-hshift = #x" , and a few "\once\override NoteColumn.X-offset = #x”.I use LilyPond 2_19_83-1 with TeXShop as the editor. Usually it works perfectly.I include the problematic part of the score. It is certainly not a MWE but it works for me and it shows the problem. It also shows that its origin does not ly in the previous bars.Thanks again for your interest.

Horizontal-spacing-problem_ly.tex
Description: Binary data
Best regards,RobertOn 3 Jun 2020, at 14:14, Valentin Villenave  wrote:On 6/3/20, Robert Blackstone  wrote:I’m vainly struggling with a weird spacing problemHi Robert,Unless you post some code, it’s gonna be difficult to help you. Youshould first double check your source files in case there’s some\override affecting the DotColumn object somewhere?Cheers,-- V.

Re: showLastLength

2020-06-03 Thread David Sumbler



On Wed, 2020-06-03 at 18:19 +0200, David Kastrup wrote:
> David Sumbler  writes:
> 
> > I have never used 'showLastLength' or 'showFirstLength' until
> > today.
> > 
> > I inserted a line such as
> > showLastLength = R1*5
> > exactly as shown in NR3.4.2, immediately before the first (and
> > only)
> > \score { } section.
> > 
> > But every time I try to compile the file I get:
> > 
> > syntax error, unexpected SYMBOL
> > 
> > showLastLength = R1*5
> > 
> > Why might this be?
> > 
> > I am using Lilypond v2.19.82
> 
> Once you stop assuming that the manual writers are incompetent and/or
> realise that almost all examples in the manual are actually run
> through
> LilyPond while producing the manual, it should be obvious that the
> principal problem will lie in the particular way you wrote your
> source,
> making it different from what is done in the manual.
> 
> That means that it is absolutely essential to include a minimal
> example
>  for diagnosis.
> 
> Lacking that information, it would be my guess that you have your
> \score
> inside of a \book section, and those don't allow assignments inside.
> But since you neither include an example nor even mention \book, this
> is
> a mere guess.

I don't know why you think I assume that the manual writers are
incompetent - I don't assume any such thing.

I asked why I might be getting the error.  And you have kindly answered
my question, even though it appears that I inadvertently irritated you
to some degree.

The fact is that, yes, the score in question was accessed in a \book
section in another file.  I was not aware that I couldn't use
showLastLength inside a \book { }.

In the mean time, I got around the problem by using
Score.skipTypesetting instead.  I was getting a warning about a hairpin
being too small, with of course no indication of where in the score it
might be - tricky in a 150-page score.  I eventually tracked it down.

Thanks for your help.

David




Re: showLastLength

2020-06-03 Thread Valentin Villenave
On 6/3/20, David Kastrup  wrote:
> Once you stop assuming that the manual writers are incompetent
> […] it should be obvious that

Hmm, since we’re on -user, let’s not antagonize people coming here
asking for advice, perhaps? :-)
https://en.wikipedia.org/wiki/Wikipedia:Assume_good_faith

The OP may have made a mistake somewhere in his code (there’s actually
a good chance for that to be the explanation, as you and I both know),
but _from his point of view_ if something that purportedly works in
the doc suddenly doesn’t when he tries it, then he has every
legitimate reason of wondering why, hasn’t he?

If anything, him immediately coming here to inquire about it goes to
show how much trustworthiness and reliability he’s used to find in our
documentation.

(And yes, I fully realize the irony of me finding myself on the “nice”
side of a good cop/bad cop situation for once.)

Cheers,
-- V.



Re: showLastLength

2020-06-03 Thread David Kastrup
David Sumbler  writes:

> I have never used 'showLastLength' or 'showFirstLength' until today.
>
> I inserted a line such as
>   showLastLength = R1*5
> exactly as shown in NR3.4.2, immediately before the first (and only)
> \score { } section.
>
> But every time I try to compile the file I get:
>
>   syntax error, unexpected SYMBOL
>
>   showLastLength = R1*5
>
> Why might this be?
>
> I am using Lilypond v2.19.82

Once you stop assuming that the manual writers are incompetent and/or
realise that almost all examples in the manual are actually run through
LilyPond while producing the manual, it should be obvious that the
principal problem will lie in the particular way you wrote your source,
making it different from what is done in the manual.

That means that it is absolutely essential to include a minimal example
 for diagnosis.

Lacking that information, it would be my guess that you have your \score
inside of a \book section, and those don't allow assignments inside.
But since you neither include an example nor even mention \book, this is
a mere guess.

-- 
David Kastrup



Re: showLastLength

2020-06-03 Thread Valentin Villenave
On 6/3/20, David Sumbler  wrote:
> I have never used 'showLastLength' or 'showFirstLength' until today.

> I inserted a line such as
>   showLastLength = R1*5
> exactly as shown in NR3.4.2, immediately before the first (and only)
> \score { } section.

Are you sure there isn’t an unclosed block (which is to say, a missing
closing curly brace) somewhere?
showLastLength and showFirstLength need to be defined at the top
level; if you’re using Frescobaldi, you can try clicking on Tools >
Code Formatting > Re-Indent to catch any mismatched braces.

Otherwise, please post some code so that we can help you investigate.

Cheers,
-- V.



Re: Adding metronome click track to MIDI

2020-06-03 Thread Valentin Villenave
On 6/3/20, Francesco Petrogalli  wrote:
> Is there a special midi instrument I could use for that?

Not that I know.
BTW, here’s a quick-and-dirty way of adding a click track, in case you
might find it useful:

%%

addTicks =
#(define-music-function (m) (ly:music?)
   #{ << $m
 \new Devnull \with {
   \consists Drum_note_performer
   \consists Staff_performer
   \consists Dynamic_performer
   midiInstrument = #"woodblock"
 } \drummode {
   <>\ff \repeat unfold
   $(ly:moment-main-numerator
 (ly:moment-div
  (ly:music-length m)
  (ly:make-moment 1 4)))
   rb4 }>> #})

music = \relative  c' { c2 d e f g a b c }

\score {
  \new Staff \addTicks \music
  \layout {}
  \midi {}
}



Cheers,
-- V.



showLastLength

2020-06-03 Thread David Sumbler
I have never used 'showLastLength' or 'showFirstLength' until today.

I inserted a line such as
showLastLength = R1*5
exactly as shown in NR3.4.2, immediately before the first (and only)
\score { } section.

But every time I try to compile the file I get:

syntax error, unexpected SYMBOL

showLastLength = R1*5

Why might this be?

I am using Lilypond v2.19.82

David




Re: list of strings from a string

2020-06-03 Thread Valentin Villenave
On 6/3/20, Freeman Gilmore  wrote:
>   % Gives me this: (-3 A -6 1 -B),

Well, it _is_ a list of strings, as you can verify by adding:

#(display (map string? Y))

Or you can use
  #(write Y)
instead of (display Y), which will print the double quotes.

>   % I need: ("-3" "A" "-6" "1" "-B"), how do I get this?  A list of
> strings.

Well, you can always do

#(set! Y (map (lambda (s) (string-append "\"" s "\"")) Y))

but as I said, that’s not necessary.

Cheers,
-- V.



Re: Adding metronome click track to MIDI

2020-06-03 Thread Robin Bannister

Francesco Petrogalli wrote:


I need to add  a metronome click sound to the MIDI generated with
lilypond, to allow people sync up a record-from-home session.


Here is a clock ticking:  {wbh4 trim4 wbl4 trim4}


Cheers,
Robin



Re: list of strings from a string

2020-06-03 Thread David Kastrup
Freeman Gilmore  writes:

> \version "2.20.0"
>
> #(define Z '())
>
> j = #(define-void-function % Starting form here.
>  (x)
>  (string>?)
>  (set! Z x ))
>
>  \j  "-3 A -6 1 -B"
>
> #(define Y (string-split Z #\sp ))
>   #(display Y)  #(newline)
>
>   % Gives me this: (-3 A -6 1 -B), string-split => list, I do want a list but
>   % I need: ("-3" "A" "-6" "1" "-B"), how do I get this?  A list of strings.

This is a list of strings.  You just need to use "write" instead of "display".

-- 
David Kastrup



Adding metronome click track to MIDI

2020-06-03 Thread Francesco Petrogalli
Hi all,

I need to add  a metronome click sound to the MIDI generated with
lilypond, to allow people sync up a record-from-home session. A quick
web search didn't bring up anything that I could have used. Is there a
special midi instrument I could use for that?

Francesco



list of strings from a string

2020-06-03 Thread Freeman Gilmore
\version "2.20.0"

#(define Z '())

j = #(define-void-function % Starting form here.
 (x)
 (string>?)
 (set! Z x ))

 \j  "-3 A -6 1 -B"

#(define Y (string-split Z #\sp ))
  #(display Y)  #(newline)

  % Gives me this: (-3 A -6 1 -B), string-split => list, I do want a list but
  % I need: ("-3" "A" "-6" "1" "-B"), how do I get this?  A list of strings.

Thank you, ƒgl



Re: Making Lilypond faster

2020-06-03 Thread Valentin Villenave
On 6/3/20, Paolo Prete  wrote:
> Did you succeed (or someone else) in compiling with guile-3, meanwhile ?
> If so, did you see some improvement in speed?

No, for now guile 2.0 has become nearly as reliable as 1.8 but there
remains a noticeable performance drop; building LilyPond with guile
2.2 is possible but triggers some annoying bugs, and with guile 3.0 I
don’t think anybody’s even been giving it a try. The only sure thing
is that 2.20 will be the last stable version requiring guile 1.8,
since that’s been phased out in most GNU/Linux distributions. And,
yes, the possibility of using JIT bytecode starting with Guile 2.0 can
potentially lead to a speed gain, but not until several additional
bugs have been ironed out.

That being said, regardless of the Guile situation, there is a lot of
ongoing optimization work on LilyPond’s c++ code, logic and
computation, which should eventually lead to a speed gain of at least
15 or 20% (I think) on some parts of the processing. The next stable
release will certainly be quite interesting.

Cheers,
-- V.



Re: Making Lilypond faster

2020-06-03 Thread Paolo Prete
>
>
> Hi Paolo,
>
> The suggestion to focus on guile-3 makes no sense at the moment,
> because it is not broadly in the distros, afaict.
>
>
>

Hello Harm,

what about this?

http://lilypond.1069038.n5.nabble.com/guile-3-0-and-LilyPond-here-input-regression-context-defaultchild-cycle-ly-fails-td227492.html#a227495

Did you succeed (or someone else) in compiling with guile-3, meanwhile ?
If so, did you see some improvement in speed?

Thanks!
Best,
P


Re: A weird spacing problem

2020-06-03 Thread Valentin Villenave
On 6/3/20, Robert Blackstone  wrote:
> I’m vainly struggling with a weird spacing problem

Hi Robert,
Unless you post some code, it’s gonna be difficult to help you. You
should first double check your source files in case there’s some
\override affecting the DotColumn object somewhere?

Cheers,
-- V.



A weird spacing problem

2020-06-03 Thread Robert Blackstone
Dear all,

I’m vainly struggling with a weird spacing problem that I’ve never seen before: 
the dot belonging to, for instance, c’2. is widely separated from the note 
itself. (See screenshot).
In this section the horizontal note spacing  is also rather capricious. ( \time 
3/4 for the entire piece. No problems until bar 46 - and after bar 49 unti the 
end (bar 55 )

I’ve no idea what could have caused this.

And I’ll be very grateful for any suggestion.

Best regards, 

Robert Blackstone 





Re: Making Lilypond faster

2020-06-03 Thread Thomas Morley
Am Mi., 3. Juni 2020 um 12:33 Uhr schrieb Paolo Prete :
>
> Hello,
>
> after using 2.19.84 for a while, it seems to me that it is quite faster than 
> the previous one (2.19.83).
>
> 1) Now I wonder if there are some later versions (or git snapshots) even 
> faster: do you have any feedback about this?
>
> 2) Also: is there a way to optimize (when compiling a snapshot) the speed of 
> a release for linux (for example: by choosing a specific version of a 
> dependent library)?
>
> 3) What is the status of Guile 3 support? AFAIK, much of the discussed speed 
> depends on it
>
> thanks!
>
> P

Hi Paolo,

can't say anything to 1) or 2)

ad 3)
LilyPond still uses guile-1.8, if you observe some speedup, then
because of some optimisations.

Experimental builds with guile-2 showed a huge slow down, the last
time I tried it out, which is admittedly a while back.
Though, there is continuous hard work to improve the situation. I
should try it out again...

The suggestion to focus on guile-3 makes no sense at the moment,
because it is not broadly in the distros, afaict.


Cheers,
  Harm



Making Lilypond faster

2020-06-03 Thread Paolo Prete
Hello,

after using 2.19.84 for a while, it seems to me that it is quite faster
than the previous one (2.19.83).

1) Now I wonder if there are some later versions (or git snapshots) even
faster: do you have any feedback about this?

2) Also: is there a way to optimize (when compiling a snapshot) the speed
of a release for linux (for example: by choosing a specific version of a
dependent library)?

3) What is the status of Guile 3 support? AFAIK, much of the discussed
speed depends on it

thanks!

P


Re: Absolute font-size for TextScript

2020-06-03 Thread Paolo Prete
On Wed, Jun 3, 2020 at 12:01 AM Aaron Hill  wrote:

>
> As is tradition, I am almost certainly over-engineering here.  However,
> would the following approach be of any use:
>
> 
> \version "2.20.0"
>
> transformText =
> #(define-music-function
>(grob-path proc)
>((key-list? 'TextScript) procedure?)
>#{ \override $grob-path . before-line-breaking =
> #(grob-transformer 'before-line-breaking
>   (lambda (grob orig)
> (ly:grob-set-property! grob 'text
>   (proc (ly:grob-property grob 'text) #})
>
> boxIt = #(lambda (text) (markup #:box text))
> flipIt = #(lambda (text) (markup #:rotate 180 text))
> sizeIt =
> #(define-scheme-function (size) (number?)
>(lambda (text) (markup #:abs-fontsize size text)))
>
> \layout {
>\context {
>  \Staff
>  \transformText \sizeIt #8
>}
> }
>
> \score {
>\new Staff { b'2.^"Lorem" \once \transformText \boxIt b'4_"ipsum" }
>\layout { #(layout-set-staff-size 8) }
> }
> \score {
>\new Staff { b'2.^"Lorem" b'4_"ipsum" }
>\layout { #(layout-set-staff-size 13) }
> }
> \score {
>\new Staff { \once \transformText \flipIt b'2.^"Lorem" b'4_"ipsum" }
>\layout { #(layout-set-staff-size 21) }
> }
> 
>
>
That's great too!


Re: Error while trying to put a Text above a notehead

2020-06-03 Thread Valentin Villenave
On 6/2/20, Robin Bannister  wrote:
> Well, you could define your own markup command(s).
> Have a look at /scm/define-markup-commands.scm for examples,
> including \abs-fontsize.

Well, for once, there’s even some documentation about it!
http://lilypond.org/doc/v2.21/Documentation/extending/new-markup-command-definition

Cheers,
-- V.