Re: Scheme: get current beam-thickness

2020-01-25 Thread Aaron Hill

On 2020-01-25 12:31 pm, David Kastrup wrote:

...proper English...


I fear that ship has long sailed w.r.t. software engineering.  
Developers are too committed to their neologisms and jargon for any 
authoritative dictionary to keep meaningful pace with the vernacular.  
On this topic, I recall when Bill Watterson (via Calvin) famously said, 
"Verbing weirds language."


That said, I commend you for keeping up the good fight.


-- Aaron Hill



Re: Scheme: get current beam-thickness

2020-01-25 Thread David Kastrup
Aaron Hill  writes:

> On 2020-01-25 12:05 pm, David Kastrup wrote:
>> Aaron Hill  writes:
>> 
>>> On 2020-01-25 11:40 am, David Kastrup wrote:
 Aaron Hill  writes:
> I am unaware of any simpler approach, as it is my understanding that
> grobs do not persist the entire context within which they were
> created.
 How would they then make it to the page?  Suicided grobs have their
 properties deleted prematurely, but those are not the rule.
 
> Mind you, I would love to be shown that I am incorrect.
 This is Scheme anyway.  In general, objects persist as long as you
 are
 able to reference them.
>>> Wait, do grobs have a reference to the context?
>> No, or this would cause the contexts to persist until the end of 
>> typesetting.
>> 
>>> I know you can use \applyOutput to process grobs at a given moment in
>>> time, and that provides you access to both the grobs and the context.
>>> And my snippet showed using an engraver to achieve something similar.
>>> But within, say, a stencil procedure, it seems like you only have the
>>> grob to work with.  Is there some ly:grob-context method that I have
>>> been overlooking?
>> You wrote "it is my understanding that grobs do not persist the
>> entire
>> context within which they were created".  "persist" is an intransitive
>> verb, so your statement was about the duration of grobs, not of
>> contexts.
>
> Wiktionary disagrees.  The fourth definition is computing-specific and
> allows "persist" to be transitive: "to *cause* to be persisted, made 
> permanent" (emphasis mine).
>
> But who cares what some crowd-sourced site says.

dak@lola:/usr/local/tmp/lilypond$ dict persist
3 definitions found

>From The Collaborative International Dictionary of English v.0.48 [gcide]:

  Persist \Per*sist"\, v. i. [imp. & p. p. {Persisted}; p. pr. &
 vb. n. {Persisting}.] [L. persistere; per + sistere to stand
 or be fixed, fr. stare to stand: cf. F. persister. See
 {Per-}, and {Stand}.]
 To stand firm; to be fixed and unmoved; to stay; to continue
 steadfastly; especially, to continue fixed in a course of
 conduct against opposing motives; to persevere; -- sometimes
 conveying an unfavorable notion, as of doggedness or
 obstinacy.
 [1913 Webster]
  
   If they persist in pointing their batteries against
   particular persons, no laws of war forbid the making
   reprisals.   --Addison.
 [1913 Webster]
  
   Some positive, persisting fops we know,
   Who, if once wrong, will needs be always so. --Pope.
 [1913 Webster]
  
   That face persists.
   It floats up; it turns over in my mind.  --Mrs.
Browning.
 [1913 Webster]
  
 Syn: See {Persevere}, and {Insist}.
  [1913 Webster] Persistence

>From WordNet (r) 3.0 (2006) [wn]:

  persist
  v 1: continue to exist; "These stories die hard"; "The legend of
   Elvis endures" [syn: {prevail}, {persist}, {die hard},
   {run}, {endure}]
  2: be persistent, refuse to stop; "he persisted to call me every
 night"; "The child persisted and kept asking questions" [syn:
 {persevere}, {persist}, {hang in}, {hang on}, {hold on}]
  3: stay behind; "The smell stayed in the room"; "The hostility
 remained long after they made up" [syn: {persist}, {remain},
 {stay}]

(3rd source is just a thesauraus).

> If you prefer "persist" only to be intransitive, then we need another
> verb or phrasing.  How about: "Grobs do not maintain their own copy
> nor reference to the context in which they were created."  Is that an
> accurate statement?

Yes.  You could also just replace your transitive "persist" with "make
persist" or "cause to persist" and turn it into proper English.  If you
want to use your 4th meaning, I'd strongly recommend using it only in
constructs where it cannot possibly be one of the other meanings.

-- 
David Kastrup



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 11:15 am, Kieren MacMillan wrote:

Hi again!

Tried taking your advice, and building the custom context from
scratch. The problem, of course, is that I don’t know all the
engravers and what they do (a.k.a. why they’re needed)… and the
documentation doesn’t exactly make everything crystal clear in that
regard.


If you permit me to be honest: I would not have the foggiest idea 
either.  (:



But clearly that doesn’t Do The Right Thing™. Any guidance would be 
appreciated.


The Internals Reference does list which engravers produce which grobs, 
and there is always the source code itself.  The problem though is 
knowing what you are looking for.  This is especially tricky when you 
have normally invisible grobs, since their very existence is a mystery 
before pulling back the curtain.


LSR 280 [1] might be handy too.  In fact, it shows that a number of 
relevant engravers are in the Voice, not the Staff by default.  This 
suggests we might need both a custom RowReducedStaff and RowReducedVoice 
to reach the goal.


[1]: http://lsr.di.unimi.it/LSR/Item?id=280


-- Aaron Hill



Re: Scheme: get current beam-thickness

2020-01-25 Thread Aaron Hill

On 2020-01-25 12:05 pm, David Kastrup wrote:

Aaron Hill  writes:


On 2020-01-25 11:40 am, David Kastrup wrote:

Aaron Hill  writes:

I am unaware of any simpler approach, as it is my understanding that
grobs do not persist the entire context within which they were
created.

How would they then make it to the page?  Suicided grobs have their
properties deleted prematurely, but those are not the rule.


Mind you, I would love to be shown that I am incorrect.

This is Scheme anyway.  In general, objects persist as long as you
are
able to reference them.


Wait, do grobs have a reference to the context?


No, or this would cause the contexts to persist until the end of 
typesetting.



I know you can use \applyOutput to process grobs at a given moment in
time, and that provides you access to both the grobs and the context.
And my snippet showed using an engraver to achieve something similar.
But within, say, a stencil procedure, it seems like you only have the
grob to work with.  Is there some ly:grob-context method that I have
been overlooking?


You wrote "it is my understanding that grobs do not persist the entire
context within which they were created".  "persist" is an intransitive
verb, so your statement was about the duration of grobs, not of
contexts.


Wiktionary disagrees.  The fourth definition is computing-specific and 
allows "persist" to be transitive: "to *cause* to be persisted, made 
permanent" (emphasis mine).


But who cares what some crowd-sourced site says.  If you prefer 
"persist" only to be intransitive, then we need another verb or 
phrasing.  How about: "Grobs do not maintain their own copy nor 
reference to the context in which they were created."  Is that an 
accurate statement?



-- Aaron Hill



Re: Scheme: get current beam-thickness

2020-01-25 Thread David Kastrup
Aaron Hill  writes:

> On 2020-01-25 11:40 am, David Kastrup wrote:
>> Aaron Hill  writes:
>>> I am unaware of any simpler approach, as it is my understanding that
>>> grobs do not persist the entire context within which they were
>>> created.
>> How would they then make it to the page?  Suicided grobs have their
>> properties deleted prematurely, but those are not the rule.
>> 
>>> Mind you, I would love to be shown that I am incorrect.
>> This is Scheme anyway.  In general, objects persist as long as you
>> are
>> able to reference them.
>
> Wait, do grobs have a reference to the context?

No, or this would cause the contexts to persist until the end of typesetting.

> I know you can use \applyOutput to process grobs at a given moment in
> time, and that provides you access to both the grobs and the context.  
> And my snippet showed using an engraver to achieve something similar.
> But within, say, a stencil procedure, it seems like you only have the 
> grob to work with.  Is there some ly:grob-context method that I have
> been overlooking?

You wrote "it is my understanding that grobs do not persist the entire
context within which they were created".  "persist" is an intransitive
verb, so your statement was about the duration of grobs, not of
contexts.

-- 
David Kastrup



Re: Scheme: get current beam-thickness

2020-01-25 Thread Aaron Hill

On 2020-01-25 11:40 am, David Kastrup wrote:

Aaron Hill  writes:

I am unaware of any simpler approach, as it is my understanding that
grobs do not persist the entire context within which they were
created.


How would they then make it to the page?  Suicided grobs have their
properties deleted prematurely, but those are not the rule.


Mind you, I would love to be shown that I am incorrect.


This is Scheme anyway.  In general, objects persist as long as you are
able to reference them.


Wait, do grobs have a reference to the context?

I know you can use \applyOutput to process grobs at a given moment in 
time, and that provides you access to both the grobs and the context.  
And my snippet showed using an engraver to achieve something similar.  
But within, say, a stencil procedure, it seems like you only have the 
grob to work with.  Is there some ly:grob-context method that I have 
been overlooking?



-- Aaron Hill



Re: Scheme: get current beam-thickness

2020-01-25 Thread David Stephen Grant
Thank you for the responses - I'll look into Aaron's suggestion, which
looks like it may do the trick.


Re: Scheme: get current beam-thickness

2020-01-25 Thread David Kastrup
Aaron Hill  writes:

> On 2020-01-25 10:39 am, David Stephen Grant wrote:
>> I'm trying to create a custom flag stencil, and would like to get the
>> current _beam_ thickness. As a first step, in the following example
>> I would
>> expect 0.5, then 1, to be printed to the console. Is there a way of
>> doing
>> this?
>
> With a little bit of encouragement, yes:
>
> 
> \version "2.19.83"
>
> BeamThicknessToFlag_engraver = #(lambda (...)
>   `((acknowledgers
>   (flag-interface . ,(lambda (engraver grob source-engraver)
> (ly:grob-set-property! grob 'beam-thickness
>   (ly:assoc-get 'beam-thickness
> (ly:context-grob-definition
>   (ly:translator-context engraver)
>   'Beam
>
> customFlag = #(lambda (grob)
>   (let ((bt (ly:grob-property grob 'beam-thickness)))
> (grob-interpret-markup grob #{ \markup #(number->string bt) #})))
>
> \new Voice
> \with { \consists \BeamThicknessToFlag_engraver }
> {
>   \override Flag.stencil = \customFlag
>
>   c'8 r8
>
>   \override Beam.beam-thickness = #0.5
>   c'8 r8
>
>   \override Beam.beam-thickness = #1.0
>   c'8 r8
>
>   \revert Beam.beam-thickness
>   c'8 r8
> }
> 
>
> I am unaware of any simpler approach, as it is my understanding that
> grobs do not persist the entire context within which they were
> created.

How would they then make it to the page?  Suicided grobs have their
properties deleted prematurely, but those are not the rule.

> Mind you, I would love to be shown that I am incorrect.

This is Scheme anyway.  In general, objects persist as long as you are
able to reference them.

-- 
David Kastrup



Re: Syntax highlighting

2020-01-25 Thread Craig Dabelstein
Hi all,

This is what I've been doing to test, after cloning the repo. Instructions
start halfway down this page: https://pygments.org/docs/lexerdevelopment/

You probably don;t even have to `make mapfiles` on this LilyPond branch.


   1.

   Run make mapfiles
   2.

   Run the lexer to convert the LilyPond file to html: python -m pygments
   -O full -f html -o /tmp/example.html tests/examplefiles/example.ily
   3.

   Open the html file: /tmp/example.html


On Sat, 25 Jan 2020 at 23:50, Henning Hraban Ramm 
wrote:

>
> > Am 2020-01-25 um 10:45 schrieb Urs Liska :
> >
> > Am Samstag, den 25.01.2020, 17:48 +1000 schrieb Craig Dabelstein:
> >> Hi everyone,
> >>
> >> I've written a LilyPond syntax highlighter for pygments. It's not
> perfect but it's mostly working. Is there anyone out there who could test
> it?
> >>
> >> https://github.com/craigdab/pygments/tree/LilyPond
> >
> > Thank you for working on it.
> >
> > How does one test it?
> > First clone the repository and install pygments from there (its
> `setup.py`) I suppose. The README suggests using `pip`, which surely
> wouldn't work, isn't it?
> >
> > I have installed Pygments through pip3, is there a way to avoid a
> conflict, e.g. by *not* installing your pygments clone but directly invoke
> the proper executable?
>
> It would make sense to create a virtualenv, activate it and install
> Craig’s pygments there via setup.py
>
>
> Greetlings, Hraban
> ---
> fiëé visuëlle
> Henning Hraban Ramm
> https://www.fiee.net
>
>
>
>
>
>

-- 
Craig Dabelstein
Owner
Maxime's Music
M: 0404884173
A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
W: concertbandmusicstore.com E:
cr...@concertbandmusicstore.com 






Re: Scheme: get current beam-thickness

2020-01-25 Thread Aaron Hill

On 2020-01-25 10:39 am, David Stephen Grant wrote:

I'm trying to create a custom flag stencil, and would like to get the
current _beam_ thickness. As a first step, in the following example I 
would
expect 0.5, then 1, to be printed to the console. Is there a way of 
doing

this?


With a little bit of encouragement, yes:


\version "2.19.83"

BeamThicknessToFlag_engraver = #(lambda (...)
  `((acknowledgers
  (flag-interface . ,(lambda (engraver grob source-engraver)
(ly:grob-set-property! grob 'beam-thickness
  (ly:assoc-get 'beam-thickness
(ly:context-grob-definition
  (ly:translator-context engraver)
  'Beam

customFlag = #(lambda (grob)
  (let ((bt (ly:grob-property grob 'beam-thickness)))
(grob-interpret-markup grob #{ \markup #(number->string bt) #})))

\new Voice
\with { \consists \BeamThicknessToFlag_engraver }
{
  \override Flag.stencil = \customFlag

  c'8 r8

  \override Beam.beam-thickness = #0.5
  c'8 r8

  \override Beam.beam-thickness = #1.0
  c'8 r8

  \revert Beam.beam-thickness
  c'8 r8
}


I am unaware of any simpler approach, as it is my understanding that 
grobs do not persist the entire context within which they were created.  
Mind you, I would love to be shown that I am incorrect.



-- Aaron Hill



Re: Scheme: get current beam-thickness

2020-01-25 Thread Thomas Morley
Am Sa., 25. Jan. 2020 um 19:40 Uhr schrieb David Stephen Grant
:
>
> I'm trying to create a custom flag stencil, and would like to get the current 
> _beam_ thickness. As a first step, in the following example I would expect 
> 0.5, then 1, to be printed to the console. Is there a way of doing this?
>
> Thanks,
> David
>
> \version "2.19.83"
> #(define (my-flag)
>   (lambda (grob)
> (format #t "~a"
>   ;;; GET THE CURRENT BEAM-THICKNESS
>   )
> empty-stencil))
> {
>   \override Flag.stencil = #(my-flag)
>   \override Beam.beam-thickness = #0.5
>   c'8 r8
>   \override Beam.beam-thickness = #1.0
>   c'8 r8
> }

Hi,

your example prints no Beams, actually no Beam-grob is created.
Thus any override for Beam will not find the grob to apply, in
consequence you can't read the grob-properties of a non-existing grob
from a different grob.

May I ask how your Flag will look? We have some code implemented in
the source which may help...


Cheers,
  Harm



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Kieren MacMillan
Hi again!

Tried taking your advice, and building the custom context from scratch. The 
problem, of course, is that I don’t know all the engravers and what they do 
(a.k.a. why they’re needed)… and the documentation doesn’t exactly make 
everything crystal clear in that regard.

So far, I have:

%%%
\version "2.19.83"
\language "english"

\paper {
  line-width = 4\in
  ragged-right = ##f
}

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef4. 8 g2 r4 8 cs' }
testier = { bf4 a4 ~ 8 cs''8 4 d'1 }

RowReduce_engraver = #(lambda (...)
 `((listeners
 (note-event .
   ,(lambda (engraver event)
 (let* ((elem (ly:event-property event 'music-cause))
(pitch (ly:music-property elem 'pitch))
(semitone (ly:pitch-semitones pitch))
(index (modulo semitone (length rowrefs
   (ly:music-set-property! elem 'pitch
 (ly:make-pitch 0 (list-ref rowrefs index) 0

\layout {
  \context {
\type "Engraver_group"
\name RowReductionStaff
\inherit-acceptability RowReductionStaff Staff
\consists "Axis_group_engraver"
\consists "Staff_symbol_engraver"
\consists "Rhythmic_column_engraver"
\consists "Note_heads_engraver"
\consists "Note_head_line_engraver"
\consists "Note_spacing_engraver"
\consists \RowReduce_engraver
\override StaffSymbol.line-count = #6
\defaultchild "Voice"
  }
}

\score {
  <<
\new Staff { \test }
\new Staff { \testier }
\new RowReductionStaff << \test \\ \testier >>
  >>
}
%%%

But clearly that doesn’t Do The Right Thing™. Any guidance would be appreciated.

Thanks,
Kieren.


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




Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Kieren MacMillan
Hi Aaron,

> A "\\" seems to tame the console output with no other changes to the input:
> %%%
>  \new RowReductionStaff { \new Voice << \test \\ \testier >> }
> %%%
> But that might just be sweeping things under the proverbial rug.

Yes… and it changes the output (e.g., note how the noteheads aren’t aligned in 
the first dyad!).

> Something to consider is that RowReductionStaff could be built up from 
> scratch in terms of the engravers you require.

Oh! That’s probably a fabulous idea.

> Plus I suspect the MIDI performers would be inappropriate for this context.  
> (But now I wonder what it would sound like to convert semitones into tones.)

Ha! That *could* be fun.

Thanks,
Kieren.


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




Scheme: get current beam-thickness

2020-01-25 Thread David Stephen Grant
I'm trying to create a custom flag stencil, and would like to get the
current _beam_ thickness. As a first step, in the following example I would
expect 0.5, then 1, to be printed to the console. Is there a way of doing
this?

Thanks,
David

\version "2.19.83"
#(define (my-flag)
  (lambda (grob)
(format #t "~a"
  ;;; GET THE CURRENT BEAM-THICKNESS
  )
empty-stencil))
{
  \override Flag.stencil = #(my-flag)
  \override Beam.beam-thickness = #0.5
  c'8 r8
  \override Beam.beam-thickness = #1.0
  c'8 r8
}


Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 9:38 am, Kieren MacMillan wrote:

%%%
\new RowReductionStaff { \new Voice << \test \testier >> }
%%%

I’m hoping eventually to understand how to manipulate each element
well enough to (e.g.) eliminate tied notes, have it "duration
independent" (in the sense of not throwing "incompatible stem"
errors), etc.


A "\\" seems to tame the console output with no other changes to the 
input:


%%%
  \new RowReductionStaff { \new Voice << \test \\ \testier >> }
%%%

But that might just be sweeping things under the proverbial rug.

Something to consider is that RowReductionStaff could be built up from 
scratch in terms of the engravers you require.  At it stands, \Staff 
brings in many engravers.  A more restrictive set of \consists would 
reduce the amount of superfluous grobs you need to \omit.  Plus I 
suspect the MIDI performers would be inappropriate for this context.  
(But now I wonder what it would sound like to convert semitones into 
tones.)



-- Aaron Hill



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Kieren MacMillan
Hi Aaron,

> I must confess I have no idea what row-reduction means in a musical context.

In this case, I’m trying to take all the pitch events (i.e., a note played at a 
given moment) and represent them [without octave information] on a 6-line staff 
where the bottom line is the 0th element of the tone row and the space on top 
of the top line is the 11th element.

> Regardless, it sounds like I missed a fun presentation.  (:

Well, *I* had fun anyway… you’ll have to ask others whether *they* found it any 
fun.  ;)

> Here's a "spicier" take on your code that uses an engraver:

Nice! This seems so much more to my purpose(s). See the example with slightly 
richer data:

%%%
\version "2.19.83"
\language "english"

\paper {
  line-width = 4\in
  ragged-right = ##f
}

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef4. 8 g2 r4 8 cs' }
testier = { bf4 a4 ~ 8 cs''8 4 d'1 }

RowReduce_engraver = #(lambda (...)
 `((listeners
 (note-event .
   ,(lambda (engraver event)
 (let* ((elem (ly:event-property event 'music-cause))
(pitch (ly:music-property elem 'pitch))
(semitone (ly:pitch-semitones pitch))
(index (modulo semitone (length rowrefs
   (ly:music-set-property! elem 'pitch
 (ly:make-pitch 0 (list-ref rowrefs index) 0

\layout {
  \context {
\Staff
\name RowReductionStaff
\alias Staff
\inherit-acceptability RowReductionStaff Staff
\override StaffSymbol.line-count = #6
\consists \RowReduce_engraver
\omit Clef
\omit TimeSignature
\omit Stem
\omit Flag
\omit Beam
\omit Dots
\omit Rest
\omit Tie
\omit BarLine
\override NoteHead.duration-log = #4
  }
}

\score {
  <<
\new Staff { \test }
\new Staff { \testier }
\new RowReductionStaff { \new Voice << \test \testier >> }
  >>
}
%%%

I’m hoping eventually to understand how to manipulate each element well enough 
to (e.g.) eliminate tied notes, have it "duration independent" (in the sense of 
not throwing "incompatible stem" errors), etc.

> Note that one aspect of this that needs refactoring is the rowrefs array 
> itself.  This probably should be a context property rather than a global.  
> That way you could say:
> 
>  \new RowReductionStaff
>\with { rowrefs = #'(8 6 7 5 3 0 9) }
>{ \test }
> 

Yes! Nice.

> I have posted about custom context properties before, but let me know if you 
> need pointers.

Well… I’ll try my hand at "fishing" first, and get back to you if I find myself 
too hungry.  :)

Thanks!
Kieren.



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




Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 8:45 am, Kieren MacMillan wrote:
Very helpful! Here’s an example of what I’m currently playing around 
with:


Neat, although I must confess I have no idea what row-reduction means in 
a musical context.  Does it have any connection to the linear algebraic 
term?  Regardless, it sounds like I missed a fun presentation.  (:


Here's a "spicier" take on your code that uses an engraver:


\version "2.19.83"
\language "english"

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef4. 8 g2 r4 8 cs' }

RowReduce_engraver = #(lambda (...)
  `((listeners
  (note-event .
,(lambda (engraver event)
  (let* ((elem (ly:event-property event 'music-cause))
 (pitch (ly:music-property elem 'pitch))
 (semitone (ly:pitch-semitones pitch))
 (index (modulo semitone (length rowrefs
(ly:music-set-property! elem 'pitch
  (ly:make-pitch 0 (list-ref rowrefs index) 0

\layout {
  \context {
\Staff
\name RowReductionStaff
\alias Staff
\inherit-acceptability RowReductionStaff Staff
\consists \RowReduce_engraver
\omit Clef
\omit TimeSignature
\omit Stem
\omit Flag
\omit Beam
\omit Dots
\omit Rest
\omit BarLine
\override NoteHead.duration-log = #4
  }
}

\score {
  <<
\new Staff { \test }
\new RowReductionStaff { \test }
  >>
}


To my eye, that looks cleaner from an end-user perspective, with 
everything wrapped up in the custom Staff context.


Note that one aspect of this that needs refactoring is the rowrefs array 
itself.  This probably should be a context property rather than a 
global.  That way you could say:



  \new RowReductionStaff
\with { rowrefs = #'(8 6 7 5 3 0 9) }
{ \test }


I have posted about custom context properties before, but let me know if 
you need pointers.



-- Aaron Hill



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Kieren MacMillan
Hi Aaron,

Thanks for the quick and helpful response!

> Yes.  The list-splicing forms of # and $ are #@ and $@, respectively.

Ah!

> In this case, we are using $@ to take the list of bare pitches and have the 
> parser handle them the same as if the user had simply entered them.

Nice to know how that works.

> I have learned to never make assumptions on performance without concrete, 
> profiling data.

A good philosophy.

> Mainly, I wanted to show you a different coding pattern just so you are aware 
> of the options available.

Definitely appreciated!

> music-pitches extracts just the pitch information from the music.  That means 
> a lot of what makes up a music expression is lost in the process.  For 
> instance, chords will appear as individual pitches.  Depending on your needs, 
> this could be acceptable.

It was also a relatively gentle way in to Scheme-ing.  ;)

> However, is it ultimately your intention to transform a music expression by 
> altering the pitches according to some process (like a \modalTranspose)?

Yes.

> If so, extracting pitches is probably not the best approach.  Instead, you 
> will want to use music-map (or one of its kin) to help you traverse the music 
> expression, so you can then conditionally modify each part as needed.

Very helpful! Here’s an example of what I’m currently playing around with:

  SNIPPET BEGINS
\version "2.19.83"
\language "english"

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef4. 8 g2 r4 8 cs' }

xform-pitches =
#(define-music-function (music) (ly:music?)
   (music-map
(lambda (elem)
  (if (memq 'note-event (ly:music-property elem 'types))
  (let* ((pitch (ly:music-property elem 'pitch))
 (semitone (ly:pitch-semitones pitch))
 (index (modulo semitone (length rowrefs
(ly:music-set-property! elem 'pitch
  (ly:make-pitch 0 (list-ref rowrefs index) 0
  elem)
music)
   music)

\layout {
  \context {
\Staff
\name RowReductionStaff
\alias Staff
\inherit-acceptability RowReductionStaff Staff
\omit Clef
\omit TimeSignature
\omit Stem
\omit Flag
\omit Beam
\omit Dots
\omit Rest
\omit BarLine
\override NoteHead.duration-log = #4
  }
}

\score {
  <<
{ \test }
\new RowReductionStaff { \xform-pitches \test }
  >>
}
  SNIPPET ENDS

Thanks for your help so far!

Cheers,
Kieren.


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




Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 8:23 am, Aaron Hill wrote:

On 2020-01-25 7:48 am, Kieren MacMillan wrote:

Also: I notice that rests and skips are ignored:

This is intuitive/understandable to me (given the functions we’re
using); and I’m glad they’re just ignored [rather than causing
errors]. But how can I turn every rest or skip into a skip [of
equivalent duration] in the output? My intuition tells me I should use
an if statement… but I’m betting there’s a more automagic way.  =)


My reading comprehension skills are quite lacking today... :P

You wanted to convert rests to skips, and I ignored that.  This should 
work:



\version "2.19.83"

rests-to-skips =
#(define-music-function (music) (ly:music?)
  (music-map
(lambda (elem)
  (if (memq 'rest-event (ly:music-property elem 'types))
(make-music 'SkipEvent 'duration (ly:music-property elem 
'duration))

elem))
music)
  music)

test = { c'4 r d' s e' r f' s g' }

<<
  { \test }
  { \rests-to-skips \test }






-- Aaron Hill



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 7:48 am, Kieren MacMillan wrote:
Perhaps the simplest option is to avoid ly:music and instead use 
splicing to let the parser do the heavy lifting:


I assume you mean the "$@", which is the only thing in this code I
don’t understand?


Yes.  The list-splicing forms of # and $ are #@ and $@, respectively.  
In this case, we are using $@ to take the list of bare pitches and have 
the parser handle them the same as if the user had simply entered them.



Note that I refactored your nested maps into a single one.


Will the performance be improved, or only the compactness of the code?


I have learned to never make assumptions on performance without 
concrete, profiling data.  It is possible that Guile's compiler is smart 
enough to optimize the nested maps, so performance might not differ.  In 
general, a single map means only one pass through a collection, so cache 
utilization is often better.  But on such small data sets, the benefits 
are going to be minimal.


Mainly, I wanted to show you a different coding pattern just so you are 
aware of the options available.  Nested maps are useful when you need to 
manipulate the collection as a whole in-between steps.  But if you are 
only operating on the individual elements, a single map usually makes 
more sense.



Also: I notice that rests and skips are ignored:

This is intuitive/understandable to me (given the functions we’re
using); and I’m glad they’re just ignored [rather than causing
errors]. But how can I turn every rest or skip into a skip [of
equivalent duration] in the output? My intuition tells me I should use
an if statement… but I’m betting there’s a more automagic way.  =)


music-pitches extracts just the pitch information from the music.  That 
means a lot of what makes up a music expression is lost in the process.  
For instance, chords will appear as individual pitches.  Depending on 
your needs, this could be acceptable.


However, is it ultimately your intention to transform a music expression 
by altering the pitches according to some process (like a 
\modalTranspose)?  If so, extracting pitches is probably not the best 
approach.  Instead, you will want to use music-map (or one of its kin) 
to help you traverse the music expression, so you can then conditionally 
modify each part as needed.



\version "2.19.83"
\language "english"

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef4. 8 g2 r4 8 cs' }

row-staff-notes =
#(define-music-function (mus) (ly:music?)
  #{ $@(map (lambda (pitch)
  (let* ((semitone (ly:pitch-semitones pitch))
 (index (modulo semitone (length rowrefs
(ly:make-pitch 0 (list-ref rowrefs index) 0)))
(music-pitches mus)) #})

<<
  { <>8 $@(music-pitches test) }
  { <>8 \row-staff-notes \test }




xform-pitches =
#(define-music-function (music) (ly:music?)
  (music-map
(lambda (elem)
  (if (memq 'note-event (ly:music-property elem 'types))
(let* ((pitch (ly:music-property elem 'pitch))
   (semitone (ly:pitch-semitones pitch))
   (index (modulo semitone (length rowrefs
  (ly:music-set-property! elem 'pitch
(ly:make-pitch 0 (list-ref rowrefs index) 0
  elem)
music)
  music)

<<
  { \test }
  { \xform-pitches \test }





-- Aaron Hill



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Kieren MacMillan
Hi Aaron,

> Perhaps the simplest option is to avoid ly:music and instead use splicing to 
> let the parser do the heavy lifting:

I assume you mean the "$@", which is the only thing in this code I don’t 
understand?

> Note that I refactored your nested maps into a single one.

Will the performance be improved, or only the compactness of the code?

Also: I notice that rests and skips are ignored:

%%%  SNIPPET BEGINS
\version "2.19.83"
\language "english"

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef, fs' s g r d'' cs' }

row-staff-notes =
#(define-music-function (mus) (ly:music?)
 #{ $@(map (lambda (pitch)
 (let* ((semitone (ly:pitch-semitones pitch))
(index (modulo semitone (length rowrefs
   (ly:make-pitch 0 (list-ref rowrefs index) 0)))
   (music-pitches mus)) #})

\layout {
  \context {
\Score
\omit Stem
\omit TimeSignature
  }
}

{ \cadenzaOn \row-staff-notes \test }
%%%  SNIPPET ENDS

This is intuitive/understandable to me (given the functions we’re using); and 
I’m glad they’re just ignored [rather than causing errors]. But how can I turn 
every rest or skip into a skip [of equivalent duration] in the output? My 
intuition tells me I should use an if statement… but I’m betting there’s a more 
automagic way.  =)

Thanks,
Kieren.


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




Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 7:29 am, Aaron Hill wrote:

Perhaps the simplest option is to avoid ly:music and instead use
splicing to let the parser do the heavy lifting:


Avoid ly:make-music that is.


-- Aaron Hill



Re: [Scheme coding] how to turn pitches into music

2020-01-25 Thread Aaron Hill

On 2020-01-25 6:42 am, Kieren MacMillan wrote:

Having previously used

#(display
  (map (lambda (n) (ly:make-pitch 0 n 0))
(map (lambda (l) (list-ref rowrefs l))
  (map (lambda (m) (modulo m 12))
(map ly:pitch-semitones (music-pitches test))

I know that the scheme function is returning a set of pitches, and
they are the correct ones [based on how I want to manipulate the
"test" music]. The errors I got when I tried to create a music
function led me to find ly:make-music, which eliminated the errors.
But now I can’t display the pitches. How do I fix the row-staff-notes
function so that it displays pitches on a staff?


Perhaps the simplest option is to avoid ly:music and instead use 
splicing to let the parser do the heavy lifting:



\version "2.19.83"
\language "english"

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)
test = { ef, fs' g d'' cs' }

row-staff-notes =
#(define-music-function (mus) (ly:music?)
  #{ $@(map (lambda (pitch)
  (let* ((semitone (ly:pitch-semitones pitch))
 (index (modulo semitone (length rowrefs
(ly:make-pitch 0 (list-ref rowrefs index) 0)))
(music-pitches mus)) #})

{ <>8 \row-staff-notes \test }


Note that I refactored your nested maps into a single one.


-- Aaron Hill



[Scheme coding] how to turn pitches into music

2020-01-25 Thread Kieren MacMillan
Hi all,

I’m continuing my Scheme learning journey. I can already feel the momentum 
building, so that’s a good thing!

Despite it perhaps not being the optimal thing to build while learning Scheme, 
I’m continuing to work with this dodecaphonic manipulation work from my 
Salzburg presentation. Right now, I’m trying to figure out a way to take some 
music, compare it to a reference row, and output the music in a transformed 
condition (the exact transformation being irrelevant to solving my current 
issue).

So far, I have this, which compiles without error:

%%%  SNIPPET BEGINS
\version "2.19.83"
\language "english"

rowrefs = #'(6 8 7 2 3 12 5 4 11 1 10 9)

test = { ef, fs' g d'' cs' }

row-staff-notes =
#(define-music-function (mus) (ly:music?)
   (ly:make-music
(map (lambda (n) (ly:make-pitch 0 n 0))
  (map (lambda (l) (list-ref rowrefs l))
(map (lambda (m) (modulo m 12))
  (map ly:pitch-semitones (music-pitches mus)))

\score {
  \row-staff-notes #test
}
%%%  SNIPPET ENDS

Having previously used

#(display
  (map (lambda (n) (ly:make-pitch 0 n 0))
(map (lambda (l) (list-ref rowrefs l))
  (map (lambda (m) (modulo m 12))
(map ly:pitch-semitones (music-pitches test))

I know that the scheme function is returning a set of pitches, and they are the 
correct ones [based on how I want to manipulate the "test" music]. The errors I 
got when I tried to create a music function led me to find ly:make-music, which 
eliminated the errors. But now I can’t display the pitches. How do I fix the 
row-staff-notes function so that it displays pitches on a staff?

Thanks,
Kieren.


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




Re: visualize-padding

2020-01-25 Thread Aaron Hill

On 2020-01-24 9:12 am, Paolo Prete wrote:

I'm trying to implement the work-around you suggested.
TupletNumber doesn't cause the discussed weird space.
However, this weird space happens as soon as I access the stencil (or 
any

property of it) of the TupletBracket grob
Then, even if I get the bracket's grob with (ly:grob-object number-grob
'bracket), I can't access its stencil, nor its y-extent through
this variable. Is this what you were suggesting or do I have to follow
another method?


Alas, my workaround required that you did not need to touch 
TupletBracket's stencil property at all.  Rather, switching to 
TupletNumber might have provided you a grob that would host the 
visualization more reliably.  But if you need to access TupletBracket's 
stencil from after-line-breaking, there is no getting around the issue.


In digging more deeply, the unexpected added space looks to come from 
accessing the TupletBracket's positions property; and since stencil 
depends on positions internally, querying the stencil triggers the 
behavior.  This property is concerned with the vertical placement of the 
ends of the bracket, and its computation involves checking a number of 
associated grobs (e.g. NoteColumns and Beams).  By querying positions 
too early in the layout process, this seems to unintentionally lock in 
bad values resulting in improper spacing.  And unfortunately, 
TupletBracket's after-line-breaking procedure gets invoked *before* its 
positions property would normally be queried, so my visualization hack 
interferes with the usual timing of things.


Since TupletBracket's stencil appears to be consulted fairly late in the 
game, you probably do not need to bother with after-line-breaking at 
all.  Instead, simply replace the normal stencil procedure 
(ly:tuplet-bracket::print) with a custom one, overlaying whatever you 
need.  In 2.19, there is grob-transformer, which makes this easy:



\version "2.19.83"

\paper {
  #(set-paper-size "a9landscape")
  top-margin = 0.75\cm line-width = 3.5\cm
  indent = 0 ragged-right = ##f tagline = ##f
}

visualize-stencil-extent-and-origin = #(define-music-function
  (grob-path) (symbol-list?)
  (define proc (grob-transformer 'stencil
(lambda (grob orig)
  (let* ((xex (ly:stencil-extent orig X))
 (yex (ly:stencil-extent orig Y)))
(ly:grob-set-property! grob 'layer 1000)
(grob-interpret-markup grob #{
  \markup
  \with-dimensions-from \stencil #orig
  \overlay {
\with-color #'(0.2 0.7 0.9)
\override #'(style . outline)
\override #`(thickness . 1.2)
\whiteout
\path #0.1 #`(
  (moveto ,(- (car xex) 1.5) ,(car yex))
  (lineto ,(+ (cdr xex) 1.5) ,(car yex))
  (moveto ,(- (car xex) 1.5) ,(cdr yex))
  (lineto ,(+ (cdr xex) 1.5) ,(cdr yex))
  (moveto ,(car xex) ,(- (car yex) 1.5))
  (lineto ,(car xex) ,(+ (cdr yex) 1.5))
  (moveto ,(cdr xex) ,(- (car yex) 1.5))
  (lineto ,(cdr xex) ,(+ (cdr yex) 1.5)))
\with-color #'(0.9 0.4 0.2)
\override #'(style . outline)
\override #`(thickness . 0.9)
\whiteout
\path #0.1 #`(
  (moveto -1.5 -1.5) (lineto 1.5 1.5)
  (moveto -1.5 1.5) (lineto 1.5 -1.5))
\override #'(style . outline)
\override #`(thickness . 0.6)
\whiteout
\stencil #orig
  } #} )
  #{ \override $grob-path .stencil = #proc #})

\fixed c' {
  \visualize-stencil-extent-and-origin TupletBracket
  \tuplet 3/2 { c2 f8 bes }
}



-- Aaron Hill

Re: key change at end of snippet

2020-01-25 Thread Werner LEMBERG
From: David Kastrup 
Subject: Re: key change at end of snippet
Date: Sat, 25 Jan 2020 09:41:45 +0100

> \relative c' {
>   \key d \major
>   d1
>   \key c \major
>   \grace s256
> }

Thanks for the suggestion!  I'm now trying Thomas's route.


Werner



Re: Syntax highlighting

2020-01-25 Thread Henning Hraban Ramm


> Am 2020-01-25 um 10:45 schrieb Urs Liska :
> 
> Am Samstag, den 25.01.2020, 17:48 +1000 schrieb Craig Dabelstein:
>> Hi everyone,
>> 
>> I've written a LilyPond syntax highlighter for pygments. It's not perfect 
>> but it's mostly working. Is there anyone out there who could test it?
>> 
>> https://github.com/craigdab/pygments/tree/LilyPond
> 
> Thank you for working on it.
> 
> How does one test it?
> First clone the repository and install pygments from there (its `setup.py`) I 
> suppose. The README suggests using `pip`, which surely wouldn't work, isn't 
> it?
> 
> I have installed Pygments through pip3, is there a way to avoid a conflict, 
> e.g. by *not* installing your pygments clone but directly invoke the proper 
> executable?

It would make sense to create a virtualenv, activate it and install Craig’s 
pygments there via setup.py


Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
https://www.fiee.net







Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread David Kastrup
Jonas Hahnfeld  writes:

> Am Samstag, den 25.01.2020, 10:37 +0100 schrieb David Kastrup:
>> Jonas Hahnfeld <
>> hah...@hahnjo.de
>> > writes:
>> 
>> > Am Samstag, den 25.01.2020, 10:21 +0100 schrieb David Kastrup:
>> > > Jonas Hahnfeld <
>> > > hah...@hahnjo.de
>> > > 
>> > > > writes:
>> > > > Am Freitag, den 24.01.2020, 16:45 -0500 schrieb Bric:
>> > > > > i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
>> > > > > 
>> > > > > 
>> > > > > -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
>> > > > > 
>> > > > > 
>> > > > > how can i make lilypond find the shared object?
>> > > > 
>> > > > I just checked and Ubuntu apparently doesn't look for libraries in
>> > > > /usr/local/lib (at least on my system). If you want it to, you might
>> > > > try export'ing LD_LIBRARY_PATH=/usr/local/lib in your shell. This
>> > > > *should* work without removing other versions of guile from your
>> > > > system.
>> > > 
>> > > I have my version of Guile-1.8 installed in a place where Ubuntu will
>> > > most certainly not bother looking unless told otherwise
>> > > 
>> > > guile-config is supposed to be supplying the required options for
>> > > compiling and linking to make it look in the installation place relevant
>> > > when guile-config was being installed.
>> > 
>> > The error message is not about linking, but happens during runtime.
>> 
>> But during linking the place to look for a library at runtime can be
>> embedded into the executable.
>> 
>> dak@lola:/usr/local/tmp/lilypond$ ldd `which lilypond`
>>  linux-vdso.so.1 (0x7ffd3b853000)
>>  libguile.so.17 => /usr/local/tmp/guile-1.8/lib/libguile.so.17 
>> (0x7f60c85d8000)
>> [...]
>> 
>> dak@lola:/usr/local/tmp/lilypond$ grep guile /etc/ld.so.conf.d/*
>> /etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf:/usr/local/tmp/guile-1.8/lib
>> 
>> Oh.  I did not put this manually there, so it likely ended up there with
>> 
>> sudo make install
>> 
>> dak@lola:/usr/local/tmp/lilypond$ ls -l
>> /etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf
>> -rw-r--r-- 1 root root 29 Aug  2  2017 
>> /etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf
>
> I don't see anything in guile-1.8.8 that would so. Libtool suggests it
> as one possibility, but I don't think it'll do so automatically.
>
> Anyway, I think that goes beyond the scope of the initial issue. The
> solution is to make the system find your dynamic libraries, with
> whatever method your prefer.

Maybe it got there via pkgconfig?  There is

dak@lola:/usr/local/tmp/guile$ git grep pkgconfig
ChangeLog-2008: (pkgconfigdir, pkgconfig_DATA): New.
Makefile.am:pkgconfigdir = $(libdir)/pkgconfig
Makefile.am:pkgconfig_DATA = guile-1.8.pc
doc/ref/autoconf.texi:@file{@var{prefix}/lib/pkgconfig/guile-1.8.pc}, which 
contains all the

and

dak@lola:/usr/local/tmp/guile$ locate guile-1.8.pc
/usr/local/tmp/guile/guile-1.8.pc
/usr/local/tmp/guile/guile-1.8.pc.in
/usr/local/tmp/guile-1.8/lib/pkgconfig/guile-1.8.pc

Not sure that means anything.

-- 
David Kastrup



Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread Jonas Hahnfeld
Am Samstag, den 25.01.2020, 10:37 +0100 schrieb David Kastrup:
> Jonas Hahnfeld <
> hah...@hahnjo.de
> > writes:
> 
> > Am Samstag, den 25.01.2020, 10:21 +0100 schrieb David Kastrup:
> > > Jonas Hahnfeld <
> > > hah...@hahnjo.de
> > > 
> > > > writes:
> > > > Am Freitag, den 24.01.2020, 16:45 -0500 schrieb Bric:
> > > > > i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
> > > > > 
> > > > > 
> > > > > -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
> > > > > 
> > > > > 
> > > > > how can i make lilypond find the shared object?
> > > > 
> > > > I just checked and Ubuntu apparently doesn't look for libraries in
> > > > /usr/local/lib (at least on my system). If you want it to, you might
> > > > try export'ing LD_LIBRARY_PATH=/usr/local/lib in your shell. This
> > > > *should* work without removing other versions of guile from your
> > > > system.
> > > 
> > > I have my version of Guile-1.8 installed in a place where Ubuntu will
> > > most certainly not bother looking unless told otherwise
> > > 
> > > guile-config is supposed to be supplying the required options for
> > > compiling and linking to make it look in the installation place relevant
> > > when guile-config was being installed.
> > 
> > The error message is not about linking, but happens during runtime.
> 
> But during linking the place to look for a library at runtime can be
> embedded into the executable.
> 
> dak@lola:/usr/local/tmp/lilypond$ ldd `which lilypond`
>   linux-vdso.so.1 (0x7ffd3b853000)
>   libguile.so.17 => /usr/local/tmp/guile-1.8/lib/libguile.so.17 
> (0x7f60c85d8000)
> [...]
> 
> dak@lola:/usr/local/tmp/lilypond$ grep guile /etc/ld.so.conf.d/*
> /etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf:/usr/local/tmp/guile-1.8/lib
> 
> Oh.  I did not put this manually there, so it likely ended up there with
> 
> sudo make install
> 
> dak@lola:/usr/local/tmp/lilypond$ ls -l 
> /etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf 
> -rw-r--r-- 1 root root 29 Aug  2  2017 
> /etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf

I don't see anything in guile-1.8.8 that would so. Libtool suggests it
as one possibility, but I don't think it'll do so automatically.

Anyway, I think that goes beyond the scope of the initial issue. The
solution is to make the system find your dynamic libraries, with
whatever method your prefer.

Jonas


signature.asc
Description: This is a digitally signed message part


Re: Syntax highlighting

2020-01-25 Thread Urs Liska
Am Samstag, den 25.01.2020, 17:48 +1000 schrieb Craig Dabelstein:
> Hi everyone,
> I've written a LilyPond syntax highlighter for pygments. It's not
> perfect but it's mostly working. Is there anyone out there who could
> test it?
> 
> https://github.com/craigdab/pygments/tree/LilyPond

Thank you for working on it.
How does one test it?First clone the repository and install pygments
from there (its `setup.py`) I suppose. The README suggests using `pip`,
which surely wouldn't work, isn't it?
I have installed Pygments through pip3, is there a way to avoid a
conflict, e.g. by *not* installing your pygments clone but directly
invoke the proper executable?
I suppose testing would be done through using the command line version
as described on https://pygments.org/docs/cmdline/ ?
BestUrs
> I'm sure there is lots that could be improved on it. It is running
> without errors, but it is failing the pull request tests and I don't
> know why. I'm not experienced enough to work it out.
> 
> Thanks everyone,
> 
> Craig
> 
> 
> 
> 


Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread David Kastrup
Jonas Hahnfeld  writes:

> Am Samstag, den 25.01.2020, 10:21 +0100 schrieb David Kastrup:
>> Jonas Hahnfeld <
>> hah...@hahnjo.de
>> > writes:
>> 
>> > Am Freitag, den 24.01.2020, 16:45 -0500 schrieb Bric:
>> > > i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
>> > > 
>> > > 
>> > > -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
>> > > 
>> > > 
>> > > how can i make lilypond find the shared object?
>> > 
>> > I just checked and Ubuntu apparently doesn't look for libraries in
>> > /usr/local/lib (at least on my system). If you want it to, you might
>> > try export'ing LD_LIBRARY_PATH=/usr/local/lib in your shell. This
>> > *should* work without removing other versions of guile from your
>> > system.
>> 
>> I have my version of Guile-1.8 installed in a place where Ubuntu will
>> most certainly not bother looking unless told otherwise
>> 
>> guile-config is supposed to be supplying the required options for
>> compiling and linking to make it look in the installation place relevant
>> when guile-config was being installed.
>
> The error message is not about linking, but happens during runtime.

But during linking the place to look for a library at runtime can be
embedded into the executable.

dak@lola:/usr/local/tmp/lilypond$ ldd `which lilypond`
linux-vdso.so.1 (0x7ffd3b853000)
libguile.so.17 => /usr/local/tmp/guile-1.8/lib/libguile.so.17 
(0x7f60c85d8000)
[...]

dak@lola:/usr/local/tmp/lilypond$ grep guile /etc/ld.so.conf.d/*
/etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf:/usr/local/tmp/guile-1.8/lib

Oh.  I did not put this manually there, so it likely ended up there with

sudo make install

dak@lola:/usr/local/tmp/lilypond$ ls -l 
/etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf 
-rw-r--r-- 1 root root 29 Aug  2  2017 
/etc/ld.so.conf.d/x86_64-linux-gnu_guile-1.8.conf

And some time ago it seems.

dak@lola:/usr/local/tmp/lilypond$ ls -l 
/usr/local/tmp/guile-1.8/bin/guile-config 
-rwxr-xr-x 1 root root 9136 Aug 14  2018 
/usr/local/tmp/guile-1.8/bin/guile-config

That one has been updated more recently.

> There are ways to make the linker add a library path for runtime
> (rpath), but it doesn't seem to kick in here. I had the same problem
> with Ubuntu the other day when I was testing my changes for Python 3.
> That's why I recommend using LD_LIBRARY_PATH instead of removing all
> other versions of Guile.

LD_LIBRARY_PATH is empty on my system.

>
> It it works for you, then I guess there is some setup somewhere, either
> LD_LIBRARY_PATH or a change in /etc/ld.so.conf or ... Just do an `ldd'
> on your executable and if the library is not in /usr/lib/ then
> something non-standard is going on.
>
> Jonas

-- 
David Kastrup



Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread Jonas Hahnfeld
Am Samstag, den 25.01.2020, 10:21 +0100 schrieb David Kastrup:
> Jonas Hahnfeld <
> hah...@hahnjo.de
> > writes:
> 
> > Am Freitag, den 24.01.2020, 16:45 -0500 schrieb Bric:
> > > i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
> > > 
> > > 
> > > -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
> > > 
> > > 
> > > how can i make lilypond find the shared object?
> > 
> > I just checked and Ubuntu apparently doesn't look for libraries in
> > /usr/local/lib (at least on my system). If you want it to, you might
> > try export'ing LD_LIBRARY_PATH=/usr/local/lib in your shell. This
> > *should* work without removing other versions of guile from your
> > system.
> 
> I have my version of Guile-1.8 installed in a place where Ubuntu will
> most certainly not bother looking unless told otherwise
> 
> guile-config is supposed to be supplying the required options for
> compiling and linking to make it look in the installation place relevant
> when guile-config was being installed.

The error message is not about linking, but happens during runtime.
There are ways to make the linker add a library path for runtime
(rpath), but it doesn't seem to kick in here. I had the same problem
with Ubuntu the other day when I was testing my changes for Python 3.
That's why I recommend using LD_LIBRARY_PATH instead of removing all
other versions of Guile.

It it works for you, then I guess there is some setup somewhere, either
LD_LIBRARY_PATH or a change in /etc/ld.so.conf or ... Just do an `ldd'
on your executable and if the library is not in /usr/lib/ then
something non-standard is going on.

Jonas


signature.asc
Description: This is a digitally signed message part


Re: key change at end of snippet

2020-01-25 Thread Werner LEMBERG
>> I have to typeset a snippet that is an excerpt of a longer piece,
>> and this snippet ends with a key change:
>>
>>   \relative c' {
>> \key d \major
>> d1
>> \key c \major
>>   }
>>
>> However, the staff stops right before the key change, see attached
>> image.  What can I do to avoid that?
>
> Try:
>
>  \relative c' {
>   \override Staff.StaffSymbol.break-align-symbols =
>   #'(time-signature key-cancellation key-signature staff-bar break-alignment)
> \key d \major
> d1
> \tweak X-extent #'(0.25 . 2.4)
> \key c \major
>   }
>
> The StaffSymbol being too short is a consequence of a bug-fix some
> time ago, though in this case the cure isn't nice either.
> Furthermore you need to add some padding to the right manually.

Very nice, thanks!  I didn't think of manipulating the X-extent.  Any
chance that this could be done in an official way as a bug fix to
LilyPond?  I don't think that the current behaviour is ever wanted...


Werner



Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread David Kastrup
Jonas Hahnfeld  writes:

> Am Freitag, den 24.01.2020, 16:45 -0500 schrieb Bric:
>> i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
>> 
>> 
>> -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
>> 
>> 
>> how can i make lilypond find the shared object?
>
> I just checked and Ubuntu apparently doesn't look for libraries in
> /usr/local/lib (at least on my system). If you want it to, you might
> try export'ing LD_LIBRARY_PATH=/usr/local/lib in your shell. This
> *should* work without removing other versions of guile from your
> system.

I have my version of Guile-1.8 installed in a place where Ubuntu will
most certainly not bother looking unless told otherwise

guile-config is supposed to be supplying the required options for
compiling and linking to make it look in the installation place relevant
when guile-config was being installed.

-- 
David Kastrup



Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread Jonas Hahnfeld
Am Freitag, den 24.01.2020, 16:45 -0500 schrieb Bric:
> i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
> 
> 
> 
> had to build guile-1.8.8, after which lilypond ./configure was happy, and 
> finished (posted about my guile struggles a few days ago) 
> 
> 
> 
> But "make" errors out with: 
> 
> 
> 
> cat Documentation/out/generate-documentation.log : 
> 
> 
> 
> /lilypond-2.19.83/out/bin/lilypond: error while loading shared 
> libraries: libguile.so.17: cannot open shared object file: No such file or 
> directory 
> 
> 
> i built guile to /usr/local/lib, and have a symlink with the above file name 
> lilypond can't find 
> 
> 
> 
>  ls -l /usr/local/lib/libguile.so.17* 
> 
> 
> 
> lrwxrwxrwx 1 root root 18 Jan 18 23:54 /usr/local/lib/libguile.so.17 -> 
> libguile.so.17.4.0 
> -rwxr-xr-x 1 root root 4607496 Jan 18 23:54 /usr/local/lib/libguile.so.17.4.0 
> 
> 
> guile-config link : 
> 
> 
> 
> -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
> 
> 
> how can i make lilypond find the shared object?

I just checked and Ubuntu apparently doesn't look for libraries in
/usr/local/lib (at least on my system). If you want it to, you might
try export'ing LD_LIBRARY_PATH=/usr/local/lib in your shell. This
*should* work without removing other versions of guile from your
system.

Jonas


signature.asc
Description: This is a digitally signed message part


Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread Thomas Morley
Am Fr., 24. Jan. 2020 um 22:51 Uhr schrieb David Kastrup :
>
> Bric  writes:
>
> > i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS
> >
> > had to build guile-1.8.8, after which lilypond ./configure was happy, and 
> > finished (posted
> > about my guile struggles a few days ago)
> >
> > But "make" errors out with:
> >
> > cat Documentation/out/generate-documentation.log :
> >
> > /lilypond-2.19.83/out/bin/lilypond: error while loading shared 
> > libraries:
> > libguile.so.17: cannot open shared object file: No such file or directory
> >
> > i built guile to /usr/local/lib, and have a symlink with the above file 
> > name lilypond can't find
> >
> >  ls -l /usr/local/lib/libguile.so.17*
> >
> > lrwxrwxrwx 1 root root 18 Jan 18 23:54 /usr/local/lib/libguile.so.17 -> 
> > libguile.so.17.4.0
> > -rwxr-xr-x 1 root root 4607496 Jan 18 23:54 
> > /usr/local/lib/libguile.so.17.4.0
> >
> > guile-config link :
> >
> > -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl
> >
> > how can i make lilypond find the shared object?
>
> I use
>
> ./configure GUILE=/usr/bin/guile 
> GUILE_CONFIG=/usr/local/tmp/guile-1.8/bin/guile-config

Bric, do you have other guile-versions around?
I made the experience that sometimes configure picks wrongly then,
although the double-checked pathes were ok.
In this case easiest may be to throw away other guiles and restart.
Or, sometimes I succeeded running ldconfig after ´sudo make install´

Cheers,
  Harm

>
> and that's basically all.  GUILE can be a 2.x Guile version (it is used
> for scripting), but GUILE_CONFIG needs to be the 1.8 build.
>
> --
> David Kastrup
>



Re: key change at end of snippet

2020-01-25 Thread David Kastrup
Werner LEMBERG  writes:

> I have to typeset a snippet that is an excerpt of a longer piece, and
> this snippet ends with a key change:
>
>   \relative c' {
> \key d \major
> d1
> \key c \major
>   }
>
> However, the staff stops right before the key change, see attached
> image.  What can I do to avoid that?
>
>
> Werner

\relative c' {
  \key d \major
  d1
  \key c \major
  \grace s256
}


-- 
David Kastrup


Re: building v2.19.83 - can't find libguile.so.17

2020-01-25 Thread David Kastrup
Bric  writes:

>  On January 24, 2020 at 4:50 PM David Kastrup < d...@gnu.org> wrote: 
>
>  Bric < b...@flight.us> writes: 
>
>  i am building lilypond-2.19.83 on Ubuntu 18.04.2 LTS 
>
>  had to build guile-1.8.8, after which lilypond ./configure was happy, and 
> finished
>  (posted 
>  about my guile struggles a few days ago) 
>
>  -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl 
>
>  how can i make lilypond find the shared object? 
>
>  I use 
>
>  ./configure GUILE=/usr/bin/guile 
> GUILE_CONFIG=/usr/local/tmp/guile-1.8/bin/guile-config 
>
>  and that's basically all. GUILE can be a 2.x Guile version (it is used 
>  for scripting), but GUILE_CONFIG needs to be the 1.8 build. 
>
> I tried your method and got the same error.  Can't find libguile.so.17 

Then likely building and installing guile did not complete.

-- 
David Kastrup



Re: key change at end of snippet

2020-01-25 Thread Thomas Morley
Am Sa., 25. Jan. 2020 um 06:31 Uhr schrieb Werner LEMBERG :
>
>
> I have to typeset a snippet that is an excerpt of a longer piece, and
> this snippet ends with a key change:
>
>   \relative c' {
> \key d \major
> d1
> \key c \major
>   }
>
> However, the staff stops right before the key change, see attached
> image.  What can I do to avoid that?
>
>
> Werner

Try:

 \relative c' {
  \override Staff.StaffSymbol.break-align-symbols =
  #'(time-signature key-cancellation key-signature staff-bar break-alignment)
\key d \major
d1
\tweak X-extent #'(0.25 . 2.4)
\key c \major
  }

The StaffSymbol being too short is a consequence of a bug-fix some
time ago, though in this case the cure isn't nice either.
Furthermore you need to add some padding to the right manually.

Cheers,
  Harm