Re: Get value of Scheme function to display as a markup in Lilypond

2021-11-23 Thread David Nalesnik
Hi,

On Tue, Nov 23, 2021 at 5:36 PM Dimitris Marinakis 
wrote:

> Thank you both for the information.
>
> I wasn't aware of the formatted output to be honest.
>
> \markup #(format #f "result = ~a" (dostuff 47))
>
>
> This line of code doesn't make any sense to me currently but when I get
> into more complex stuff I'll try to understand it. Right now I'm trying to
> build up a sensibility for basic programming principles because this is my
> first attempt at programming. Lilypond is so important to me that I need to
> be able to craft some solutions by myself.
>
> Best,
> Dimitris
>

There’s a lot of useful information - including the usage of format - in
the Guile 1.8 manual:
https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/index.html

David N.


> On Wed, Nov 24, 2021 at 1:08 AM Aaron Hill 
> wrote:
>
>> On 2021-11-23 2:56 pm, Dimitris Marinakis wrote:
>> > Finally got to learn a bit of Scheme. I've made decent progress within
>> > the
>> > Scheme sandbox. Now I'm trying to integrate a few things within
>> > Lilypond.
>> >
>> > Let's say I have this function:
>> > #(define (dostuff x) (+ x 5))
>> >
>> > What would be the equivalent of #(display (dostuff 2)) but inside a
>> > Lilypond markup?
>> > So that if my Lilypond music code looks like that, I'll get the correct
>> > value from that function.
>> > {
>> > c^\markuptitle (placeholder) #2
>> > }
>> >
>> > I don't want the x argument to be displayed in the markup but rather
>> > the
>> > result of the function.
>> >
>> > It's OK if this has to be broken into multiple steps.
>>
>> One option is to format the output you want as a string and then include
>> that in \markup:
>>
>> 
>> #(define (dostuff x) (+ x 5))
>> \markup #(format #f "result = ~a" (dostuff 47))
>> 
>>
>> If you just need the value, you could use number->string.  But for
>> anything fancier, the formatted printing functionality is quite powerful
>> and worth learning:
>>
>> 
>> \markup #(format #f "~{~a fish~^, ~}." '(one two red blue))
>> 
>>
>>
>> -- Aaron Hill
>>
>


Re: Question about the header structure of the very first page of the score

2021-11-23 Thread Paolo Prete
Thank you, I'll surely proceed in this way.

On Tue, Nov 23, 2021 at 2:46 AM Mark Probert  wrote:

>
> Hi, Paolo.
>
> Here is a version that could work in that way, with modification. It
> shows one way to achieve the result by ignoring the headers and doing
> it all in text with associated font changes:
>
>
[...]


Re: Get value of Scheme function to display as a markup in Lilypond

2021-11-23 Thread Dimitris Marinakis
Thank you both for the information.

I wasn't aware of the formatted output to be honest.

\markup #(format #f "result = ~a" (dostuff 47))


This line of code doesn't make any sense to me currently but when I get
into more complex stuff I'll try to understand it. Right now I'm trying to
build up a sensibility for basic programming principles because this is my
first attempt at programming. Lilypond is so important to me that I need to
be able to craft some solutions by myself.

Best,
Dimitris

On Wed, Nov 24, 2021 at 1:08 AM Aaron Hill  wrote:

> On 2021-11-23 2:56 pm, Dimitris Marinakis wrote:
> > Finally got to learn a bit of Scheme. I've made decent progress within
> > the
> > Scheme sandbox. Now I'm trying to integrate a few things within
> > Lilypond.
> >
> > Let's say I have this function:
> > #(define (dostuff x) (+ x 5))
> >
> > What would be the equivalent of #(display (dostuff 2)) but inside a
> > Lilypond markup?
> > So that if my Lilypond music code looks like that, I'll get the correct
> > value from that function.
> > {
> > c^\markuptitle (placeholder) #2
> > }
> >
> > I don't want the x argument to be displayed in the markup but rather
> > the
> > result of the function.
> >
> > It's OK if this has to be broken into multiple steps.
>
> One option is to format the output you want as a string and then include
> that in \markup:
>
> 
> #(define (dostuff x) (+ x 5))
> \markup #(format #f "result = ~a" (dostuff 47))
> 
>
> If you just need the value, you could use number->string.  But for
> anything fancier, the formatted printing functionality is quite powerful
> and worth learning:
>
> 
> \markup #(format #f "~{~a fish~^, ~}." '(one two red blue))
> 
>
>
> -- Aaron Hill
>


Re: Get value of Scheme function to display as a markup in Lilypond

2021-11-23 Thread Aaron Hill

On 2021-11-23 2:56 pm, Dimitris Marinakis wrote:
Finally got to learn a bit of Scheme. I've made decent progress within 
the
Scheme sandbox. Now I'm trying to integrate a few things within 
Lilypond.


Let's say I have this function:
#(define (dostuff x) (+ x 5))

What would be the equivalent of #(display (dostuff 2)) but inside a
Lilypond markup?
So that if my Lilypond music code looks like that, I'll get the correct
value from that function.
{
c^\markuptitle (placeholder) #2
}

I don't want the x argument to be displayed in the markup but rather 
the

result of the function.

It's OK if this has to be broken into multiple steps.


One option is to format the output you want as a string and then include 
that in \markup:



#(define (dostuff x) (+ x 5))
\markup #(format #f "result = ~a" (dostuff 47))


If you just need the value, you could use number->string.  But for 
anything fancier, the formatted printing functionality is quite powerful 
and worth learning:



\markup #(format #f "~{~a fish~^, ~}." '(one two red blue))



-- Aaron Hill



Re: alternate in middle of repeat

2021-11-23 Thread Valentin Petzel
Hello Kees,

Look here: http://lilypond.org/doc/v2.23/Documentation/changes/
This is a new feature in the current Lilypond development version.

Cheers,
Valentin

Am Dienstag, 23. November 2021, 21:25:47 CET schrieb Kees van den Doel:
> I have a \repeat volta 2 { music}, but a few bars inside "music" are
> different the second time through.
> Is there a way to do something like this:
> \repeat volta 2 { A \alternative {{a1}{a2}} B}
> Written out fully Aa1BAa2B.

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


Re: Get value of Scheme function to display as a markup in Lilypond

2021-11-23 Thread Valentin Petzel
Hello Dimitris,

Basically you need to turn the output into a form markup takes, that is either 
a markup or a string. In your case the return would be a number, so you’d want 
to call
\markup #(number->string (dostuff x))

Cheers,
Valentin

Am Dienstag, 23. November 2021, 23:56:51 CET schrieb Dimitris Marinakis:
> Finally got to learn a bit of Scheme. I've made decent progress within the
> Scheme sandbox. Now I'm trying to integrate a few things within Lilypond.
> 
> Let's say I have this function:
> #(define (dostuff x) (+ x 5))
> 
> What would be the equivalent of #(display (dostuff 2)) but inside a
> Lilypond markup?
> So that if my Lilypond music code looks like that, I'll get the correct
> value from that function.
> {
> c^\markuptitle (placeholder) #2
> }
> 
> I don't want the x argument to be displayed in the markup but rather the
> result of the function.
> 
> It's OK if this has to be broken into multiple steps.

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


Get value of Scheme function to display as a markup in Lilypond

2021-11-23 Thread Dimitris Marinakis
Finally got to learn a bit of Scheme. I've made decent progress within the
Scheme sandbox. Now I'm trying to integrate a few things within Lilypond.

Let's say I have this function:
#(define (dostuff x) (+ x 5))

What would be the equivalent of #(display (dostuff 2)) but inside a
Lilypond markup?
So that if my Lilypond music code looks like that, I'll get the correct
value from that function.
{
c^\markuptitle (placeholder) #2
}

I don't want the x argument to be displayed in the markup but rather the
result of the function.

It's OK if this has to be broken into multiple steps.


Re: alternate in middle of repeat

2021-11-23 Thread David Wright
On Tue 23 Nov 2021 at 12:25:47 (-0800), Kees van den Doel wrote:
> I have a \repeat volta 2 { music}, but a few bars inside "music" are
> different the second time through.
> Is there a way to do something like this:
> \repeat volta 2 { A \alternative {{a1}{a2}} B}
> Written out fully Aa1BAa2B.

If it suits, you could try and adapt the attached.

Cheers,
David.
\version "2.19.44"
\language english

#(set-global-staff-size 18)
\header { tagline = ##f }

global = {
  \key ef \major
  \time 6/4
  s1.
  \time 4/4
  s1
  \time 6/4
  s1.
}

globalm = {
  \allowVoltaHook "|"
  \key ef \major
  \time 6/4
  s1. \noBreak
  \time 4/4
  \set Score.repeatCommands = #'((volta "1."))
  s1 \noBreak % alternative 1
  \set Score.repeatCommands = #'((volta #f) (volta "2."))
  s1 \noBreak % alternative 2
  \set Score.repeatCommands = #'((volta #f))
  \time 6/4
  s1.
}

align = \relative {
  bf'2. bf4 g af
  c4 bf8 af g4 g
  af2. bf4 c g
}

soprano = \relative {
  bf'2. bf4 g af
  <<
{ c8 bf4 af8 g4 g }
\new Staff = ossia \with {
  \remove "Time_signature_engraver"
  alignAboveContext = #"main"
  \magnifyStaff #2/3
  firstClef = ##f
} <<
  \new Voice = alt { \omit Staff.KeySignature \key ef \major c4 bf8 af g4 g 
}
  %%\new Lyrics \lyricsto alt { one with the brood -- ing sea, }
>>
  >>
  af2. bf4 c g
}


sopranom = \relative {
  bf'2. bf4 g af
  c8 bf4 af8 g4 g % alternative 1
  c4 bf8 af g4 g % alternative 2
  af2. bf4 c g
}

texti = \lyricmode {
  wall,
  When blind moths flut -- ter by door and " " _ _ _ _ tree,
  Then comes the
}

textii = \lyricmode {
  rath,
  When night is " " _ _ _ _ one with the brood -- ing sea,
  Then comes the
}

texta = \lyricmode {
  wall,
  When blind moths flut -- ter by door and tree,
  Then comes the
}

textb = \lyricmode {
  rath,
  When night is one with the brood -- ing sea,
  Then comes the
}

textc = \lyricmode {
  _ _ _ _ one with the brood -- ing
}

\score {
  \new Staff <<
\clef treble \globalm
\new Voice = sop { \sopranom }
\new Lyrics \lyricsto sop { \texti }
\new Lyrics \lyricsto sop { \textii }
  >>
  \layout {
indent = 0
\context {
  \Staff
  \omit TimeSignature
}
  }
}

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

\score {
  \new Staff = main <<
\clef treble \global
\new NullVoice = ali { \align }
\new Lyrics \with { alignAboveContext = main } \lyricsto ali { \override 
LyricText.font-size = #-2 \textc }
\new Voice = sop { \soprano }
\new Lyrics \lyricsto sop { \texta }
\new Lyrics \lyricsto sop { \textb }
  >>
  \layout {
indent = 0
\context {
  \Staff
  \omit TimeSignature
}
  }
}


alt.pdf
Description: Adobe PDF document


Re: alternate in middle of repeat

2021-11-23 Thread Hans Aikema


> On 23 Nov 2021, at 21:27, Kees van den Doel  wrote:
> 
> 
> I have a \repeat volta 2 { music}, but a few bars inside "music" are 
> different the second time through.
> Is there a way to do something like this:
> \repeat volta 2 { A \alternative {{a1}{a2}} B} 
> Written out fully Aa1BAa2B.

For a shorter notation on paper... don't think so, never seen any notation 
using mid-repeat alternatives.

For less repetition of music in your source you could use

partB = { B }

defined as a variable and the actual music changed to

\repeat volta 2 { A } \alternative { { a1 \partB } { a2 \partB } }
or
\repeat volta 2 { A } \alternative { { a1 \partB } { a2 } } \partB


HTH


alternate in middle of repeat

2021-11-23 Thread Kees van den Doel
I have a \repeat volta 2 { music}, but a few bars inside "music" are
different the second time through.
Is there a way to do something like this:
\repeat volta 2 { A \alternative {{a1}{a2}} B}
Written out fully Aa1BAa2B.


Re: Version 2.22.1 problem

2021-11-23 Thread Anders Eriksson

Hello,

I'm sorry but I have not the possibility to connect remotely!

The error message say that you (the installation program) has gotten a 
write error when it tries to write these files to the disk.


The probable cause is that some other program has opened the files and 
locked them.


Anti-virus is one of these programs. But you tried to disable you 
anti-virus and got the same error.
Do you have any other programs that scans files e.g. for malware, or 
indexing.


Try to start Windows in safe mode and install lilypond.
https://support.microsoft.com/en-us/topic/how-to-easily-enter-safe-mode-in-windows-8-one-click-series-a18b7c2d-2297-7401-7f4a-ebbc0f6fb992

// Anders

On 2021-11-23 17:27, Leonid Hrabovsky wrote:
Hello gentlemen, who of you has the good will to help me remotely 
(through AnyDesk) with installing on Windows-8 version 2.22.1? All my 
own attempts failed - the error is /libexpat-1.dll & libffi-6.dll/ 
files missing.


/*Леонід - Leonid
*/



On Mon, Nov 22, 2021 at 1:25 PM Brian Barker 
 wrote:


At 11:54 22/11/2021 -0500, you wrote:
>Brian, in fact, I added "an" only in my letter, for "run as
>administrator" is real text.

Good-oh! The distinction I was making is that sometimes, even if you
are logged in with an administrator account, you also need to use the
"Run as administrator" facility to make everything work properly.

Brian Barker



Re: Version 2.22.1 problem

2021-11-23 Thread Leonid Hrabovsky
Hello gentlemen, who of you has the good will to help me remotely (through
AnyDesk) with installing on Windows-8 version 2.22.1? All my own attempts
failed - the error is *libexpat-1.dll & libffi-6.dll* files missing.


*Леонід - Leonid*


On Mon, Nov 22, 2021 at 1:25 PM Brian Barker 
wrote:

> At 11:54 22/11/2021 -0500, you wrote:
> >Brian, in fact, I added "an" only in my letter, for "run as
> >administrator" is real text.
>
> Good-oh! The distinction I was making is that sometimes, even if you
> are logged in with an administrator account, you also need to use the
> "Run as administrator" facility to make everything work properly.
>
> Brian Barker
>
>


Re: Box around MeasureCounter

2021-11-23 Thread David Kastrup
Aaron Hill  writes:

> On 2021-11-22 11:24 am, Rajesh Baskar wrote:
>> I had another question. The MeasureCounter boxify function does not
>> work if we change the staff to Rhythmic staff.
>
> You need to scope the grob to the appropriate context.  \boxifying
> something within Staff only affects Staff.  If you need it to work for
> RhythmicStaff, just be more specific:
>
> 
> \new Voice {
>   \boxify RhythmicStaff.MeasureCounter
>   ...
> }
>
> %% ...or... %%
>
> \new RhythmicStaff
> \with { \boxify MeasureCounter }
> { ... }
>
> %% ...or... %%
>
> \layout {
>   \context {
> \RhythmicStaff
> \boxify MeasureCounter
>   }
> }
> 

You can also do this less specifically:

\layout {
  \boxify Staff.MeasureCounter
}

should affect all contexts that respond to an _alias_ of "Staff" which
includes RhythmicStaff .

-- 
David Kastrup



Re: print log content to a pdf

2021-11-23 Thread ming tsang
On Sun, Nov 21, 2021 at 10:02 PM David Wright 
wrote:

> On Sun 21 Nov 2021 at 16:01:43 (-0500), ming tsang wrote:
>
> > The following lilypond code
> >
> > #(ly:font-config-display-fonts)
> >
> > generate a log output.
> >
> > Is it possible to generate a pdf by lilypond?
>
> $ lilypond your-fontname-generator-code.ly > fontslist
> $ edit fontslist (because there's other stuff in the file)
> $ paps fontslist --header | ps2pdf - fontslist.pdf
>
> AFAICT LP typesets /music/ into PDF files, but not its log output.
>
> Cheers,
> David.
>

Thank you for the info and work around.
-- 
ming (lyndon) tsang