Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-19 Thread foxfanfare
Aaron Hill wrote
> Would using a function help?

Thanks Aaron for your answer. I tried your solution but it crashes in my
situation. I think I understood where the problem is, it seems to be because
of the use of a variable, for instance:

 main.ly
\version "2.19.83"

fetch = #(define-scheme-function (pet) (string?)
   #{ \include #(string-join (list pet "ily") ".") #})

\fetch "kitten"
\fetch "puppy"


 kitten.ily
\version "2.19.83"
mytextI= "I like kittens."
\markup  \myTextI


 puppy.ily
\version "2.19.83"
myTextII = "I like puppies."
\markup \myTextII
 



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-19 Thread Aaron Hill

On 2019-10-19 3:58 am, foxfanfare wrote:

The idea I had was to do something like this:

Create a new file (for instance "links.ily"), which would contain:

\include "articulate.ly"
\include "configuration.ily"
\include "../../ily/liens.ily"
\include #(string-join (list "../../ily/global/global" num "ily" ) "." 
)
\include #(string-join (list "../../ily/pedales/pedales" num "ily" ) 
"." )
\include #(string-join (list "../../ily/dialogues/dialogues" num "ily" 
) "."

)
\include #(string-join (list "../../ily/dnotes/piano-orgue/notes.primo" 
num

"ily" ) "." )
\include #(string-join (list 
"../../ily/dnotes/piano-orgue/notes.secondo"

num "ily" ) "." )
\include "../../ily/instrumentation.ily"

And then in the ily score, I would simply do something like:

num = "01"
\include "links.ily"

\score {
...
}

This would allow me to not write again for all the 35 pieces the same
beginning.
I hope that makes now more sense!


Would using a function help?

 main.ly
\version "2.19.83"

fetch = #(define-scheme-function (pet) (string?)
  #{ \include #(string-join (list pet "ily") ".") #})

\fetch "kitten"
\fetch "puppy"


 kitten.ily
\version "2.19.83"
\markup "I like kittens."


 puppy.ily
\version "2.19.83"
\markup "I like puppies."



-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-19 Thread foxfanfare
David Kastrup wrote
> I don't get your point.  If you say that the assignment is not placed
> somewhere separate from the \include statement, it's a bit hard to see
> why you don't just roll the string in question into the \include
> statement in the first place.  The usual use case for an assignment like
> that is to be able to separate definition and use.

Maybe my objective was unclear. I am working on a quite huge project, a
musical theater made of 35 pieces. I also have to make different version of
the same work, piano solo, easy piano, for a small ensemble, and eventually
for an orchestra. I have decided to divide as much as possible everything in
separate files which could be included in the different versions (the
dialogues, the layout of the score, the notes, the pedals for the piano,
etc.).

In the end, when I create the ly file which will contain only one piece, I
will have that kind of beginning:

\include "articulate.ly"
\include "configuration.ily"
\include "../../ily/liens.ily"
\include "../../ily/global/global.01.ily"
\include "../../ily/pedales/pedales.01.ily"
\include "../../ily/dialogues/dialogues.01.ily"
\include "../../ily/notes/piano-orgue/notes.primo.01.ily"
\include "../../ily/notes/piano-orgue/notes.secondo.01.ily"
\include "../../ily/instrumentation.ily"

and after only the shortcuts which will generate my score, in my case,
something like:

\book {

  \titres-textes
  \paper {
bookTitleMarkup = \titres-forme
  }

  \score {
\keepWithTag #'(print piano-orgue I-tag)
\piano "1" \piece-I.primo
\header {
  piece = \piece-I.titre
  instrument = "primo"
}
  }
}

The idea I had was to do something like this:

Create a new file (for instance "links.ily"), which would contain:

\include "articulate.ly"
\include "configuration.ily"
\include "../../ily/liens.ily"
\include #(string-join (list "../../ily/global/global" num "ily" ) "." )
\include #(string-join (list "../../ily/pedales/pedales" num "ily" ) "." )
\include #(string-join (list "../../ily/dialogues/dialogues" num "ily" ) "."
)
\include #(string-join (list "../../ily/dnotes/piano-orgue/notes.primo" num
"ily" ) "." )
\include #(string-join (list "../../ily/dnotes/piano-orgue/notes.secondo"
num "ily" ) "." )
\include "../../ily/instrumentation.ily"

And then in the ily score, I would simply do something like:

num = "01"
\include "links.ily"

\score {
...
}

This would allow me to not write again for all the 35 pieces the same
beginning.
I hope that makes now more sense!




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-18 Thread Malte Meyn



Am 18.10.19 um 14:29 schrieb foxfanfare:

David Kastrup wrote

So you need to
put basically anything after the assignment to "num" before calling the
\include statement.


Thanks for your answer David, but I'm sorry I'm not following you here. What
should I call before the include statement exactly? Because the whole point
is that what comes after is referring to the file which had been include.


I use #'() in such cases. For me that’s the best “anything” because it’s 
more or less nothing ;)


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-18 Thread David Kastrup
foxfanfare  writes:

> David Kastrup wrote
>> So you need to
>> put basically anything after the assignment to "num" before calling the
>> \include statement.
>
> Thanks for your answer David, but I'm sorry I'm not following you here. What
> should I call before the include statement exactly?

Basically anything.  Another assignment, some music expression, even
something as senseless as

#(begin)

> Because the whole point is that what comes after is referring to the
> file which had been include.

I don't get your point.  If you say that the assignment is not placed
somewhere separate from the \include statement, it's a bit hard to see
why you don't just roll the string in question into the \include
statement in the first place.  The usual use case for an assignment like
that is to be able to separate definition and use.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-18 Thread foxfanfare
David Kastrup wrote
> So you need to
> put basically anything after the assignment to "num" before calling the
> \include statement.

Thanks for your answer David, but I'm sorry I'm not following you here. What
should I call before the include statement exactly? Because the whole point
is that what comes after is referring to the file which had been include.




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-18 Thread David Kastrup
foxfanfare  writes:

> Aaron Hill wrote
>> I would suggest using \bookOutputSuffix, but you can certainly use a 
>> little Scheme to concatenate the strings:
>
> Is it also possible to use that kind of code with \include ? I tried
> something like:
>
> num = "01"
>
> %\include "../../ily/global/global.01.ily"
> \include #(string-join (list "../../ily/global/global" num "ily" ) "." )
>
> The first one work but not the second. Am I doing something wrong here?

That's a tricky one.  The \include statement is evaluated before the
assignment to "num" is complete since LilyPond syntax allows things like

num = "01".oh

and the ."oh" might be provided by the included file.  So you need to
put basically anything after the assignment to "num" before calling the
\include statement.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-10-18 Thread foxfanfare
Aaron Hill wrote
> I would suggest using \bookOutputSuffix, but you can certainly use a 
> little Scheme to concatenate the strings:

Is it also possible to use that kind of code with \include ? I tried
something like:

num = "01"

%\include "../../ily/global/global.01.ily"
\include #(string-join (list "../../ily/global/global" num "ily" ) "." )

The first one work but not the second. Am I doing something wrong here?



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Set /bookOutputName to Conjunction of Variable and String

2019-09-09 Thread Aaron Hill

On 2019-09-09 6:16 am, sir.teddy.the.fi...@gmail.com wrote:

Hi all,

My score's title is set up in a variable called "title".

I'm trying to output a file for every instrument and thus would like to 
have

something like this

\version "2.19.83"
\book
{
\bookOutputName \title " - Clarinet"
}

for every instrument of my score.

But the code above outputs an error message, because it can't handle 
both a

variable and a plain string.

Is it possible to make this work somehow?


I would suggest using \bookOutputSuffix, but you can certainly use a 
little Scheme to concatenate the strings:



\version "2.19.83"

title = "Title"

\book {
  \bookOutputName \title
  \bookOutputSuffix "Suffix"
  { b'1 }
}

\book {
  \bookOutputName #(string-join (list title "Joined") "-")
  { b'1 }
}



-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Set /bookOutputName to Conjunction of Variable and String

2019-09-09 Thread sir.teddy.the.first
Hi all,

My score's title is set up in a variable called "title".

 

I'm trying to output a file for every instrument and thus would like to have
something like this

 

 

\version "2.19.83"

 

\book

{

\bookOutputName \title " - Clarinet"

 

.

}

 

for every instrument of my score.

But the code above outputs an error message, because it can't handle both a
variable and a plain string.

Is it possible to make this work somehow?

 

Thanks

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user