Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-10 Thread Michael Hendry

 On 10 Mar 2015, at 02:14, Flaming Hakama by Elaine ela...@flaminghakama.com 
 wrote:
 
 
  BTW, I also tend to prepare lead sheets in F and A.  Of course, you may not 
  need this.  But if you are preparing a template, it might be helpful to 
  include other common transpositions.
 
 OK. The choice there is either to compile the file three times, adjusting 
 \PieceTranspose in the sequence c c then c f then c a, or to make two more 
 copies of the book-generating section, with  (e.g.) \PieceTransposeFourth and 
 \PieceTransposeSixth in between.
 
 This would make it all a bit unwieldy, and as I want to be able to share this 
 with novice LilyPond users, I don?t want the make the file too long or too 
 clever!
 
 Sorry if I was not clear.  I wasn't suggesting that you transpose every piece 
 to the keys of F and A, but rather to be able to produce lead sheets in those 
 common keys as well:
 
 HornTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose f, c  $m #})
 
 AClarinetTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose a, c $m #})

OK, I get you now.

I think such transpositions are sufficiently rare that they could safely be 
“left as an exercise for the reader”; putting them all in would generate a lot 
of unwanted parts.

If there were a conditional-compilation feature (as in “C”), like...

#DEFINE ALTOSAXPART
…
#IFDEF ALTOSAXPART
   (do the alto part here)
#ENDIF

…then the user could suppress (for example) then French Horn part using…

#UNDEF FRENCHHORNPART

…but I think that overcomplicates what is intended to be a quick and easy way 
for Lilypond novices to produce the standard set of leadsheets (for Concert, Bb 
and Eb instruments).

 
 
 Granted, A clarinet isn't too common for Jazz, but it can't hurt.  And as a 
 clarinettist, I couldn't avoid the suggestion!
 
  
  But below, instead of using \PieceTranspose everywhere (which kind of 
  defeats the purpose of doing something globally) I would suggest 
  transposing \TheChords and \TheHead and then using \TransposedChords and 
  \TransposedHead in the template:
 
 This comes to the same thing, but uses two extra variables.
 
 But I can see the advantage in doing this in terms of clarity if it comes 
 immediately after the definition of the PieceTranspose function.
 
 Besides that, I think that variables help if they clarify things.  In this 
 case, it provides an explicit name for the result of \PieceTranspose { 
 \TheHead } “  

Agreed, as do function calls - which I sometimes use knowing that only one call 
is planned, not just to modularise the code and make it easier to debug at the 
time, and also to understand what is going on when I come across the code some 
years later!

 
 This introduce twos additional variables, but results in six fewer function 
 calls.

It’s a matter of opinion which is clearer - we’re not talking about conserving 
every last byte of memory and squeezing out every unnecessary CPU cycle from 
the code.

 
 Also, if I understand your intentions here, users of this template will never 
 have to modify the score blocks, or these variables.  So, I don't see the 
 down side of introducing them.  If anything, they separate boilerplate code 
 (that doesn't have to be modified) from the piece-specific code (which does).
 
 If part of your point is to make use of \transpose less fraught, I think you 
 still have an issue, since 
 users of this template still have to modify \transpose c c within that 
 function.  Something that might be more friendly:
 
 originalKey = c 
 newKey = f 
 
 PieceTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose \originalKey \newKey $m #})
 That way, your users won't have to figure out which c in \transpose c c 
 $m to adjust.

Excellent.

But further on, I prefer...

\TrumpetTranspose \PieceTranspose \TheHead

…to…

\TrumpetTranspose \TransposedHead

…because it is clear that \TheHead as originally defined is being transposed 
twice.

No matter - whichever choice is made it will be in the “don’t touch if you 
don’t know what you’re doing” section.

I’ll do some road-testing on some of my jam-session colleagues, and get 
feedback.


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


Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-09 Thread Flaming Hakama by Elaine
 From: Michael Hendry hendry.mich...@gmail.com
 To: Davide Liessi davide.lie...@gmail.com
 Cc: Lilypond-User Mailing List lilypond-user@gnu.org
 Subject: Re: Subject: String Concatenation, and Use of Unicode characters
[sic]


  On 7 Mar 2015, at 11:22, Davide Liessi davide.lie...@gmail.com wrote:
 
  Il 03/03/15 07.56, Michael Hendry ha scritto:
  Forgive me for suggesting, but I suggest it improves mental health to
  think of transpose in the form:
 
 \transpose to from \musicExpression
 
  This is what I do, too: I usually think of transpose as `\transpose
to from` when tranposing instrumental parts from concert pitch to
transposed pitch, and as `\transpose from to` in all other cases.

Moments after writing this, I realized how ambiguous it to and from
are.
A more coherent way of thinking about using \transpose for transposing
instruments might be

\transpose sounding written \musicExpression

The gotcha here is to keep in mind that \transpose does not use relative
pitch.  Meaning, if you are used to using relative notiation, you might
expect the following to produce the same transposition:

\transpose c d \musicExpression
\transpose bes c \musicExpression

But they don't--the first goes up a whole step, the second one goes up a
minor seventh.  Personally, I find that the most confusing thing about
\transpose.

Maybe that's because I haven't graduated to any other kind of music entry
besides \relative?



  I used to think of the transposition in this way until I found a need
to
  transpose the whole piece to a different key (to accommodate a singer?s
  range, for example), and I found the two ways of looking at
  transposition tied my brain in knots.
 
  Indeed looking at the same command in two ways might be a bit
confusing, but I got used to it rather easily.

A corresponding way to think about transposing a piece would be

 \transpose current key new key \musicExpression

(With the same gotcha about not using relative pitch)


  Ideally, I?d like to define the whole-piece transposition at the top of
  the file, rather than editing the per-instrument transposition at the
  point of book production.
 
  You certainly do not need to change the individual transpositions in
order to transpose an entire piece: nothing stops you from transposing
music that has already been transposed, instead of editing each
`\transpose` command.

+1


 Here is the section of the template where various standard transpositions
are defined?

 % Transpose the whole piece

 PieceTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose c c $m #})

I'm not sure how this helps.  As written, this does nothing.  And if you
need to modify your function for each file (to enter the correct
transposition), how is it better than just using \transpose directly?  That
is what you end up having to do anyway--understand how \transpose works in
order to make the modification.

I could see it being helpful if it were able to take more expected input
(like up fourth, down minor 3rd or some other unambiguous input, and
then translate that to \transpose notation.

Generally, I agree that it is useful to have a function if you are going to
do the same thing multiple times.  (However, in this case I don't see the
purpose--in conjunction with my other comments, below, since I don't think
you should use this function more than twice per file.)




 % Adjust for various transposing instruments

 GuitarTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose e e' $m #})

 AltoTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose ees c'  $m #})

 TrumpetTranspose =
 #(define-music-function (parser location m)
(ly:music?)
#{ \transpose bes c' $m #})

Seems very helpful!

BTW, I also tend to prepare lead sheets in F and A.  Of course, you may not
need this.  But if you are preparing a template, it might be helpful to
include other common transpositions.

But below, instead of using \PiceTranspose everywhere (which kind of
defeats the purpose of doing something globally) I would suggest
transposing \TheChords and \TheHead and then using \TransposedChords and
\TransposedHead in the template:


TransposedChords = \PieceTranspose \TheChords
TransposedHead = \PieceTranspose \TheHead

#(define output-suffix Concert)
\book {
  \score {

  \TransposedChords
  \TransposedHead

\header {
  piece = \markup { \fontsize #-1 Concert }
}
  }
}

% Guitar version - transposed up an octave

#(define output-suffix guitar)
\book {
  \score {

  \GuitarTranspose { \TransposedChords }
  \GuitarTranspose { \TransposedHead }

\header {
  piece = \markup { \fontsize #-1 Guitar }
}
  }
}

% Trumpet version - transposed  up a tone

#(define output-suffix trumpet-Bb)
\book {
  \score {

  \TrumpetTranspose { \TransposedChords }
  \TrumpetTranspose { \TransposedHead

Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-09 Thread Michael Hendry

 On 9 Mar 2015, at 19:48, Flaming Hakama by Elaine ela...@flaminghakama.com 
 wrote:
 
  From: Michael Hendry hendry.mich...@gmail.com 
  mailto:hendry.mich...@gmail.com
  To: Davide Liessi davide.lie...@gmail.com mailto:davide.lie...@gmail.com
  Cc: Lilypond-User Mailing List lilypond-user@gnu.org 
  mailto:lilypond-user@gnu.org
  Subject: Re: Subject: String Concatenation, and Use of Unicode characters 
  [sic]
  
  
   On 7 Mar 2015, at 11:22, Davide Liessi davide.lie...@gmail.com 
   mailto:davide.lie...@gmail.com wrote:
  
   Il 03/03/15 07.56, Michael Hendry ha scritto:
   Forgive me for suggesting, but I suggest it improves mental health to
   think of transpose in the form:
  
  \transpose to from \musicExpression
  
   This is what I do, too: I usually think of transpose as `\transpose to 
   from` when tranposing instrumental parts from concert pitch to 
   transposed pitch, and as `\transpose from to` in all other cases.
  
 Moments after writing this, I realized how ambiguous it to and from are. 
 A more coherent way of thinking about using \transpose for transposing 
 instruments might be 
  
 \transpose sounding written \musicExpression
  
 The gotcha here is to keep in mind that \transpose does not use relative 
 pitch.  Meaning, if you are used to using relative notiation, you might 
 expect the following to produce the same transposition:
  
 \transpose c d \musicExpression

This one transposes up from c to d...

 \transpose bes c \musicExpression

…but because the scale goes up as c d e f g a b c’, this one transposes from 
bes (just below c’) down to c - a minor seventh DOWN.

  
 But they don't--the first goes up a whole step, the second one goes up a 
 minor seventh.  Personally, I find that the most confusing thing about 
 \transpose.
  
 Maybe that's because I haven't graduated to any other kind of music entry 
 besides \relative?
 
 
  
   I used to think of the transposition in this way until I found a need to
   transpose the whole piece to a different key (to accommodate a singer?s
   range, for example), and I found the two ways of looking at
   transposition tied my brain in knots.
  
   Indeed looking at the same command in two ways might be a bit confusing, 
   but I got used to it rather easily.
  
 A corresponding way to think about transposing a piece would be 
 
  \transpose current key new key \musicExpression
  
 (With the same gotcha about not using relative pitch)

Relative pitch (in the lilypond \relative sense) isn’t involved here, only the 
interval between “current key” and “new key” (which is an upward movement in 
the case of c to d, but downward in the case of bes to c).

 
 
   Ideally, I?d like to define the whole-piece transposition at the top of
   the file, rather than editing the per-instrument transposition at the
   point of book production.
  
   You certainly do not need to change the individual transpositions in 
   order to transpose an entire piece: nothing stops you from transposing 
   music that has already been transposed, instead of editing each 
   `\transpose` command.

In a simple version, I would write \TheHead and \TheChords in the target key, 
and transpose them at the \book stage for the various instruments. This has to 
be done in eight different places, and is prone to error.

This is why I defined functions for the individual instruments that need never 
be changed, and did the concert key transposition using \PieceTranspose - only 
one character to change!

  
 +1
 
 
  Here is the section of the template where various standard transpositions 
  are defined?
  
  % Transpose the whole piece
  
  PieceTranspose =
  #(define-music-function (parser location m)
 (ly:music?)
 #{ \transpose c c $m #})
 
 I'm not sure how this helps.  As written, this does nothing.  And if you need 
 to modify your function for each file (to enter the correct transposition), 
 how is it better than just using \transpose directly?  That is what you end 
 up having to do anyway--understand how \transpose works in order to make the 
 modification.

Indeed, it does do nothing as it stands, but it’s there so that all I have to 
do when I want to transpose the whole piece up a fifth is to change the “c c” 
part to “c g”. 

 
 I could see it being helpful if it were able to take more expected input 
 (like up fourth, down minor 3rd or some other unambiguous input, and then 
 translate that to \transpose notation.
 
 Generally, I agree that it is useful to have a function if you are going to 
 do the same thing multiple times.  (However, in this case I don't see the 
 purpose--in conjunction with my other comments, below, since I don't think 
 you should use this function more than twice per file.)

I do use the functions several times - once for each instrument.

 
 
 
  
  % Adjust for various transposing instruments
  
  GuitarTranspose =
  #(define-music-function (parser location m)
 (ly:music?)
 #{ \transpose e e' $m

Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-09 Thread Flaming Hakama by Elaine
  BTW, I also tend to prepare lead sheets in F and A.  Of course, you may
 not need this.  But if you are preparing a template, it might be helpful to
 include other common transpositions.

 OK. The choice there is either to compile the file three times, adjusting
 \PieceTranspose in the sequence c c then c f then c a, or to make two more
 copies of the book-generating section, with  (e.g.) \PieceTransposeFourth
 and \PieceTransposeSixth in between.

 This would make it all a bit unwieldy, and as I want to be able to share
 this with novice LilyPond users, I don?t want the make the file too long or
 too clever!


Sorry if I was not clear.  I wasn't suggesting that you transpose every
piece to the keys of F and A, but rather to be able to produce lead sheets
in those common keys as well:

HornTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose f, c  $m #})

AClarinetTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose a, c $m #})


Granted, A clarinet isn't too common for Jazz, but it can't hurt.  And as a
clarinettist, I couldn't avoid the suggestion!



  But below, instead of using \PieceTranspose everywhere (which kind of
 defeats the purpose of doing something globally) I would suggest
 transposing \TheChords and \TheHead and then using \TransposedChords and
 \TransposedHead in the template:

 This comes to the same thing, but uses two extra variables.

 But I can see the advantage in doing this in terms of clarity if it comes
 immediately after the definition of the PieceTranspose function.


Besides that, I think that variables help if they clarify things.  In this
case, it provides an explicit name for the result of \PieceTranspose {
\TheHead } 

This introduce twos additional variables, but results in six fewer function
calls.

Also, if I understand your intentions here, users of this template will
never have to modify the score blocks, or these variables.  So, I don't see
the down side of introducing them.  If anything, they separate boilerplate
code (that doesn't have to be modified) from the piece-specific code (which
does).

If part of your point is to make use of \transpose less fraught, I think
you still have an issue, since
users of this template still have to modify \transpose c c within that
function.  Something that might be more friendly:

originalKey = c
newKey = f

PieceTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose \originalKey \newKey $m #})

That way, your users won't have to figure out which c in \transpose c c
$m to adjust.


Glad to hear this discussion has been helpful.


David Elaine Alt
415 . 341 .4954   *Confusion is
highly underrated*
ela...@flaminghakama.com
self-immolation.info
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-07 Thread Michael Hendry

 On 7 Mar 2015, at 11:22, Davide Liessi davide.lie...@gmail.com wrote:
 
 Il 03/03/15 07.56, Michael Hendry ha scritto:
 Forgive me for suggesting, but I suggest it improves mental health to
 think of transpose in the form:
 
\transpose to from \musicExpression
 
 This is what I do, too: I usually think of transpose as `\transpose to 
 from` when tranposing instrumental parts from concert pitch to transposed 
 pitch, and as `\transpose from to` in all other cases.
 
 I used to think of the transposition in this way until I found a need to
 transpose the whole piece to a different key (to accommodate a singer’s
 range, for example), and I found the two ways of looking at
 transposition tied my brain in knots.
 
 Indeed looking at the same command in two ways might be a bit confusing, but 
 I got used to it rather easily.
 
 Ideally, I’d like to define the whole-piece transposition at the top of
 the file, rather than editing the per-instrument transposition at the
 point of book production.
 
 You certainly do not need to change the individual transpositions in order to 
 transpose an entire piece: nothing stops you from transposing music that has 
 already been transposed, instead of editing each `\transpose` command.
 
 When I need to transpose a piece I usually place `\transpose from to` 
 just before the music expression inside `\score`.
 Unless I need to change the octave of an instrument, this is sufficient.
 
 E.g. if I needed to transpose this piece one tone up...
 
 \score {
  
\new Staff \transpose bes, c \trumpetPartConcert
\new PianoStaff 
  \new Staff \pianoRight
  \new Staff \pianoLeft

  
  \layout { }
 }
 
 ... I would simply write
 
 \score {
  \transpose c d
  
\new Staff \transpose bes, c \trumpetPartConcert
\new PianoStaff 
  \new Staff \pianoRight
  \new Staff \pianoLeft

  
  \layout { }
 }
 
 Best wishes.
 Davide

Thanks, Davide.

I’m working on a template to share with other jazz musicians, especially 
students on the Jazz Course at St Andrews University, a few miles from here.

Here is the section of the template where various standard transpositions are 
defined…

% Transpose the whole piece

PieceTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose c c $m #})

% Adjust for various transposing instruments

GuitarTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose e e' $m #})

AltoTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose ees c'  $m #})

TrumpetTranspose =
#(define-music-function (parser location m)
   (ly:music?)
   #{ \transpose bes c' $m #})

…and here is where these functions are called…

#(define output-suffix Concert)
\book {
  \score {

  \PieceTranspose { \TheChords }
  \PieceTranspose { \TheHead }

\header {
  piece = \markup { \fontsize #-1 Concert }
}
  }
}

% Guitar version - transposed up an octave

#(define output-suffix guitar)
\book {
  \score {

  \GuitarTranspose \PieceTranspose { \TheChords }
  \GuitarTranspose \PieceTranspose { \TheHead }

\header {
  piece = \markup { \fontsize #-1 Guitar }
}
  }
}

% Trumpet version - transposed  up a tone

#(define output-suffix trumpet-Bb)
\book {
  \score {

  \TrumpetTranspose \PieceTranspose { \TheChords }
  \TrumpetTranspose \PieceTranspose { \TheHead }

\header {
  piece = \markup { \fontsize #-1 Trumpet in B \smallFlat }
}
  }
}

% Alto Sax version - transposed up a major sixth

#(define output-suffix alto-Eb)
\book {
  \score {

  \AltoTranspose \PieceTranspose { \TheChords }
  \AltoTranspose \PieceTranspose { \TheHead }

\header {
  piece = \markup { \fontsize #-1 Alto Sax in E \smallFlat }
}
  }
}

…the idea being that the code is reasonably self-documenting, and the user only 
has to define \TheChords and \TheHead and edit the title to get a set of parts 
in the necessary keys.

Only one line needs to be edited to change the key of the piece.

I’ve picked up a number of useful chunks of code from other list users, and I’m 
having to steer a middle course between heavy use of Scheme (which I struggle 
to follow) and a self-flagellating insistence on pure Lilypond!

I’m going to try this template out on a number of pieces I’ve already 
transcribed, and if all goes well, I’ll report back to the list with the 
complete .LY file.

Regards

Michael



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


Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-07 Thread Davide Liessi

Il 03/03/15 07.56, Michael Hendry ha scritto:

Forgive me for suggesting, but I suggest it improves mental health to
think of transpose in the form:

\transpose to from \musicExpression


This is what I do, too: I usually think of transpose as `\transpose to 
from` when tranposing instrumental parts from concert pitch to 
transposed pitch, and as `\transpose from to` in all other cases.



I used to think of the transposition in this way until I found a need to
transpose the whole piece to a different key (to accommodate a singer’s
range, for example), and I found the two ways of looking at
transposition tied my brain in knots.


Indeed looking at the same command in two ways might be a bit confusing, 
but I got used to it rather easily.



Ideally, I’d like to define the whole-piece transposition at the top of
the file, rather than editing the per-instrument transposition at the
point of book production.


You certainly do not need to change the individual transpositions in 
order to transpose an entire piece: nothing stops you from transposing 
music that has already been transposed, instead of editing each 
`\transpose` command.


When I need to transpose a piece I usually place `\transpose from 
to` just before the music expression inside `\score`.

Unless I need to change the octave of an instrument, this is sufficient.

E.g. if I needed to transpose this piece one tone up...

\score {
  
\new Staff \transpose bes, c \trumpetPartConcert
\new PianoStaff 
  \new Staff \pianoRight
  \new Staff \pianoLeft

  
  \layout { }
}

... I would simply write

\score {
  \transpose c d
  
\new Staff \transpose bes, c \trumpetPartConcert
\new PianoStaff 
  \new Staff \pianoRight
  \new Staff \pianoLeft

  
  \layout { }
}

Best wishes.
Davide

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


Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-03 Thread tisimst
Michael,

Sorry to pipe in so late in this conversation, but have you seen what's 
going on at http://fonts.openlilylib.org? Your LilyJAZZ code, etc. is 
from the original files, but I've taken them a step further, making it 
easier to change music fonts.You might want to update your LilyJAZZ 
stuff from there. 

Let me know if I can help in any other way.

Happy Engraving,
Abraham

On Mon, Mar 2, 2015 at 11:57 PM, Michael Hendry [via Lilypond] 
ml-node+s1069038n172524...@n5.nabble.com wrote:
 
 On 3 Mar 2015, at 05:58, Flaming Hakama by Elaine [hidden email] 
 wrote:
 
 %{
 
  Date: Mon, 2 Mar 2015 16:40:27 +
  From: Michael Hendry [hidden email]
  Subject: String Concatenation, and Use of Unicode characters
  
  Typically, I want PDF output in three files, (Concert pitch, Bb 
 and Eb), and I would like to modularise this as much as possible.
 
 You will enjoy
 #(define output-suffix Instrument”)
 
 Certainly did! Thanks.
 
 
 
  2. The LilyJazzText font uses small capitals instead of lower case
   letters, so using ?Eb? produces a capital E followed by a small
   capital B. On my Mac I know how to produce a flat sign, and 
 LilyPond
   will use the flat sign from another font, but I?d like to be able 
 to
   define a flat sign as a variable, and append it to the piece 
 markup
   when creating the books for trumpet and alto.
 
 There is something called \flat.  I took out the references to 
 LilyJAZZ just to demonstrate, it should work regardless of font and 
 I didn't have the .ily file handy.
 
 That certainly helped. I’m being fussy now, but there’s 
 unnecessary white-space between the “E” and the “b”. Also, I 
 want the “Alto Sax in Eb” in a smaller font, and the \flat is 
 bigger than I want it.
 
 
 
 
 Forgive me for suggesting, but I suggest it improves mental health 
 to think of transpose in the form: 
 
 \transpose to from \musicExpression
 
 I used to think of the transposition in this way until I found a need 
 to transpose the whole piece to a different key (to accommodate a 
 singer’s range, for example), and I found the two ways of looking 
 at transposition tied my brain in knots.
 
 Ideally, I’d like to define the whole-piece transposition at the 
 top of the file, rather than editing the per-instrument transposition 
 at the point of book production.
 
 
 So, Bb and Eb parts would be:
 
 \transpose bes, c \trumpetPartConcert
 \transpose es, c \altoPartConcert
 
 instead of the cryptic: 
 
 \transpose c d' \trumpetPartConcert
 \transpose c a' \altoPartConcert
 
 
 Also, I took out references to \jazzOn since it didn't compile.
 
 
  
  Thanks in advance,
  
  Michael Hendry
 
 Sure, I hope this helps.
 
 Very much so.
 
 I’ve attached my modified version of your code, along with the 
 necessary include files and an example of the output. I like the 
 informal look of the Jazz fonts, but I can still be obsessional about 
 font-size mismatches!
 
 Michael
 
 
 
 
 
 
 
 ___ 
 lilypond-user mailing list 
 [hidden email] 
 https://lists.gnu.org/mailman/listinfo/lilypond-user
 
  Trial.ly (1K) Download Attachment
  LilyJAZZ.ily (27K) Download Attachment
  AccordsJazzDefs.ly (9K) Download Attachment
  Trial-trumpet-Bb.pdf (38K) Download Attachment
 
 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://lilypond.1069038.n5.nabble.com/Subject-String-Concatenation-and-Use-of-Unicode-characters-sic-tp172522p172524.html
 To start a new topic under User, email 
 ml-node+s1069038n...@n5.nabble.com 
 To unsubscribe from Lilypond, click here.
 NAML




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Subject-String-Concatenation-and-Use-of-Unicode-characters-sic-tp172522p172531.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: String Concatenation, and Use of Unicode characters

2015-03-02 Thread Michael Hendry
Begin forwarded message:From: Michael Hendry hendry.mich...@gmail.comSubject: Re: String Concatenation, and Use of Unicode charactersDate: 2 March 2015 22:16:34 GMTTo: thomasmorle...@gmail.comBrilliant!My only reservation is that I’ll have to treat your code as a black box, as I’m not (likely ever to be) up to speed in Scheme!I use Frescobaldi as a front-end to LilyPond, and find the Music View that presents the PDF files very helpful in picking up errors as I type. For some reason I haven’t been able to work out, this doesn’t happen with your code.I’ve attached the include files I use, in case they’re of interest.Many thanks,Michael

Generic.ly
Description: Binary data


LilyJAZZ.ily
Description: Binary data


AccordsJazzDefs.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-02 Thread Michael Hendry
On 3 Mar 2015, at 05:58, Flaming Hakama by Elaine ela...@flaminghakama.com wrote:%{ Date: Mon, 2 Mar 2015 16:40:27 + From: Michael Hendry hendry.mich...@gmail.com Subject: String Concatenation, and Use of Unicode characters Typically, I want PDF output in three files, (Concert pitch, Bb and Eb), and I would like to modularise this as much as possible.You will enjoy#(define output-suffix "Instrument”)Certainly did! Thanks. 2. The LilyJazzText font uses small capitals instead of lower case letters, so using ?Eb? produces a capital E followed by a small capital B. On my Mac I know how to produce a flat sign, and LilyPond will use the flat sign from another font, but I?d like to be able to define a flat sign as a variable, and append it to the piece markup when creating the books for trumpet and alto.There is something called \flat. I took out the references to LilyJAZZ just to demonstrate, it should work regardless of font and I didn't have the .ily file handy.That certainly helped. I’m being fussy now, but there’s unnecessary white-space between the “E” and the “b”. Also, I want the “Alto Sax in Eb” in a smaller font, and the \flat is bigger than I want it.Forgive me for suggesting, but I suggest it improves mental health to think of transpose in the form:  \transpose "to" "from" \musicExpressionI used to think of the transposition in this way until I found a need to transpose the whole piece to a different key (to accommodate a singer’s range, for example), and I found the two ways of looking at transposition tied my brain in knots.Ideally, I’d like to define the whole-piece transposition at the top of the file, rather than editing the per-instrument transposition at the point of book production.So, Bb and Eb parts would be:  \transpose bes, c \trumpetPartConcert  \transpose es, c \altoPartConcertinstead of the cryptic:  \transpose c d' \trumpetPartConcert  \transpose c a' \altoPartConcertAlso, I took out references to \jazzOn since it didn't compile. Thanks in advance, Michael HendrySure, I hope this helps.Very much so.I’ve attached my modified version of your code, along with the necessary include files and an example of the output. I like the informal look of the Jazz fonts, but I can still be obsessional about font-size mismatches!Michael

Trial.ly
Description: Binary data


LilyJAZZ.ily
Description: Binary data


AccordsJazzDefs.ly
Description: Binary data


Trial-trumpet-Bb.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Subject: String Concatenation, and Use of Unicode characters [sic]

2015-03-02 Thread Flaming Hakama by Elaine
%{

 Date: Mon, 2 Mar 2015 16:40:27 +
 From: Michael Hendry hendry.mich...@gmail.com
 Subject: String Concatenation, and Use of Unicode characters

 Typically, I want PDF output in three files, (Concert pitch, Bb and Eb),
and I would like to modularise this as much as possible.

You will enjoy
#(define output-suffix Instrument)


 2. The LilyJazzText font uses small capitals instead of lower case
  letters, so using ?Eb? produces a capital E followed by a small
  capital B. On my Mac I know how to produce a flat sign, and LilyPond
  will use the flat sign from another font, but I?d like to be able to
  define a flat sign as a variable, and append it to the piece markup
  when creating the books for trumpet and alto.

There is something called \flat.  I took out the references to LilyJAZZ
just to demonstrate, it should work regardless of font and I didn't have
the .ily file handy.



Forgive me for suggesting, but I suggest it improves mental health to think
of transpose in the form:

\transpose to from \musicExpression

So, Bb and Eb parts would be:

\transpose bes, c \trumpetPartConcert
\transpose es, c \altoPartConcert

instead of the cryptic:

\transpose c d' \trumpetPartConcert
\transpose c a' \altoPartConcert


Also, I took out references to \jazzOn since it didn't compile.



 Thanks in advance,

 Michael Hendry

Sure, I hope this helps.


David Elaine Alt
415 . 341 .4954   Confusion is
highly underrated
ela...@flaminghakama.com
self-immolation.info
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

%}




\version 2.18.0

% \include LilyJAZZ.ily
% \include AccordsJazzDefs.ly

% output-suffix will use the .ly file's base name, so no need to define one
% BaseFileName = Generic

\header {
  title =   \markup { Generic }
}

TheHead =  \relative c' {
  \set Score.markFormatter = #format-mark-box-letters
  \clef treble \key c \major \numericTimeSignature \time 4/4
 c d e f
}

TheChords =  \chords { c1 }

#(define output-suffix guitar-Concert)
\book {

  \new Score
  
\transpose c c {\TheChords}
\new Staff
\transpose c c {\TheHead}
  
  \header {piece = \markup { Guitar }}
}

#(define output-suffix trumpet-Bb)
\book {
  \new Score
  
\transpose bes, c {\TheChords}
\new Staff
\transpose bes, c {\TheHead}
  
  \header {piece = \markup {Trumpet in B \flat }}
}

#(define output-suffix alto-Eb)
\book {
  \new Score
  
\transpose es, c {\TheChords}
\new Staff \transpose es, c {\TheHead}
  
  \header {piece = \markup { Alto Sax in E \flat}}
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: String Concatenation, and Use of Unicode characters

2015-03-02 Thread Thomas Morley
2015-03-02 17:40 GMT+01:00 Michael Hendry hendry.mich...@gmail.com:
 I’m an amateur jazz guitarist, and although I usually play from Realbook 
 leadsheets I occasionally need to produce my own.

 Typically, I want PDF output in three files, (Concert pitch, Bb and Eb), and 
 I would like to modularise this as much as possible.

 The .ly code which follows shows what I’m trying to do, but there are a 
 couple of problems I would like help with.

 1. I’d like to define a variable (\BaseFileName) which is the name of the 
 song, and have this variable picked up for the title in the header, and when 
 I’m creating the three PDF files with the relevant instrument names appended.

 e.g. Generic (guitar).pdf”, “Generic (trumpet).pdf” and “Generic (alto).pdf”.


 2. The LilyJazzText font uses small capitals instead of lower case letters, 
 so using “Eb” produces a capital E followed by a small capital B. On my Mac I 
 know how to produce a flat sign, and LilyPond will use the flat sign from 
 another font, but I’d like to be able to define a flat sign as a variable, 
 and append it to the piece markup when creating the books for trumpet and 
 alto.

 Thanks in advance,

 Michael Hendry


 

 \version 2.18.0

 \include LilyJAZZ.ily
 \include AccordsJazzDefs.ly

 BaseFileName = Generic
 FlatSign = 

 \header {
   title =   \markup {\fontsize #3   \override #'(font-name . 
 LilyJAZZText) Generic }
 }

 TheHead =  \relative c' {
   \set Score.markFormatter = #format-mark-box-letters
   \clef treble \key c \major \numericTimeSignature \time 4/4
  {c d e f}

 }

 TheChords =  \chords {
 c1
 }

 % I’d like the code from here on to be generic, and produce concert, Bb and 
 Eb versions from the variables defined above.

 \book {

   \bookOutputName  Generic (guitar)” % I WANT TO CONSTRUCT THIS STRING BY 
 APPENDING “ (guitar)” to BaseFileName
   \new Score
   
 \transpose c c {\TheChords}
 \new Staff
 \jazzOn \transpose c c {\TheHead}
   
   \header {piece = \markup {\fontsize #-1 \override #'(font-name . 
 LilyJazzText) Guitar}}
 }

 \book {
   \bookOutputName Generic (tpt)” % I WANT TO CONSTRUCT THIS STRING BY 
 APPENDING “ (tpt)” to BaseFileName
   \new Score
   
 \transpose c d' {\TheChords}
 \new Staff
 \jazzOn \transpose c d' {\TheHead}
   
   \header {piece = \markup {\fontsize #-1 \override #'(font-name . 
 LilyJazzText) Trumpet in Bb”}} % I WANT TO USE VARIABLE FOR FLAT SIGN 
 HERE...
 }


 \book {
   \bookOutputName Generic (alto)” % I WANT TO CONSTRUCT THIS STRING BY 
 APPENDING “ (alto)” to BaseFileName
   \new Score
   
 \transpose c a {\TheChords}
 \new Staff \jazzOn \transpose c a {\TheHead}
   
   \header {piece = \markup {\fontsize #-1 \override #'(font-name . 
 LilyJazzText) Alto Sax in Eb”}} % …AND AGAIN HERE



How about the quite generic code below?
nb %%uncomment


\version 2.18.0

%% uncomment
%
%\include LilyJAZZ.ily
%\include AccordsJazzDefs.ly
%
BaseFileName = Generic

FlatSign =
  \markup {
\hspace #0.1
\raise #0.4
\fontsize #-3
\flat
  }

\header {
  title =
\markup {
  \fontsize #3
  \override #'(font-name . LilyJAZZText)
  \BaseFileName
}
}

TheHead =  \relative c' {
  \set Score.markFormatter = #format-mark-box-letters
  \clef treble \key c \major \numericTimeSignature \time 4/4
  c d e f

}

TheChords = \chords {
  c1
}

#(define (scores instruments pitches)
   (map
 (lambda (p n)
 #{
   \score {
  
\new ChordNames
\transpose c $p \TheChords
\new Staff
%% uncomment:
%\jazzOn
\transpose c $p \TheHead
  
  \header {
piece =
  \markup {
\fontsize #-1 \override #'(font-name . LilyJazzText) $n
  }
  }
  %% for testing:
  %\layout { \override ChordNames.ChordName.color = #red }
   }
 #})
 (event-chord-pitches pitches)
 (map
   (lambda (i)
 (let ((instr (string-split i #\tab)))
 (if (string-null? (last instr))
 #{ \markup $(car instr) #}
 #{ \markup \concat { $(car instr) \FlatSign } #})))
   instruments)))

writebooks =
#(define-void-function (parser location instr-nms pitches) (list? ly:music?)
 (let* ((instrument-names
  (map
(lambda (i)
  (car (string-split i #\tab)))
instr-nms))
(file-names
  (map
(lambda (i)
  (let ((instr (string-split i #\Space)))
  (format #f ~a (~a) BaseFileName (string-downcase (car instr)
instrument-names)))
 (for-each
   (lambda (score name)
 (let* ((my-new-book
  (ly:make-book
$defaultpaper
$defaultheader
score)))
   (ly:score-set-header! score (ly:score-header score))
   

String Concatenation, and Use of Unicode characters

2015-03-02 Thread Michael Hendry
I’m an amateur jazz guitarist, and although I usually play from Realbook 
leadsheets I occasionally need to produce my own.

Typically, I want PDF output in three files, (Concert pitch, Bb and Eb), and I 
would like to modularise this as much as possible.

The .ly code which follows shows what I’m trying to do, but there are a couple 
of problems I would like help with.

1. I’d like to define a variable (\BaseFileName) which is the name of the song, 
and have this variable picked up for the title in the header, and when I’m 
creating the three PDF files with the relevant instrument names appended.

e.g. Generic (guitar).pdf”, “Generic (trumpet).pdf” and “Generic (alto).pdf”.


2. The LilyJazzText font uses small capitals instead of lower case letters, so 
using “Eb” produces a capital E followed by a small capital B. On my Mac I know 
how to produce a flat sign, and LilyPond will use the flat sign from another 
font, but I’d like to be able to define a flat sign as a variable, and append 
it to the piece markup when creating the books for trumpet and alto.

Thanks in advance,

Michael Hendry




\version 2.18.0

\include LilyJAZZ.ily
\include AccordsJazzDefs.ly

BaseFileName = Generic
FlatSign = 

\header {
  title =   \markup {\fontsize #3   \override #'(font-name . 
LilyJAZZText) Generic }
}

TheHead =  \relative c' {
  \set Score.markFormatter = #format-mark-box-letters
  \clef treble \key c \major \numericTimeSignature \time 4/4
 {c d e f}

}

TheChords =  \chords {
c1
}

% I’d like the code from here on to be generic, and produce concert, Bb and Eb 
versions from the variables defined above.

\book {

  \bookOutputName  Generic (guitar)” % I WANT TO CONSTRUCT THIS STRING BY 
APPENDING “ (guitar)” to BaseFileName
  \new Score
  
\transpose c c {\TheChords}
\new Staff
\jazzOn \transpose c c {\TheHead}
  
  \header {piece = \markup {\fontsize #-1 \override #'(font-name . 
LilyJazzText) Guitar}}
}

\book {
  \bookOutputName Generic (tpt)” % I WANT TO CONSTRUCT THIS STRING BY 
APPENDING “ (tpt)” to BaseFileName
  \new Score
  
\transpose c d' {\TheChords}
\new Staff
\jazzOn \transpose c d' {\TheHead}
  
  \header {piece = \markup {\fontsize #-1 \override #'(font-name . 
LilyJazzText) Trumpet in Bb”}} % I WANT TO USE VARIABLE FOR FLAT SIGN HERE...
}


\book {
  \bookOutputName Generic (alto)” % I WANT TO CONSTRUCT THIS STRING BY 
APPENDING “ (alto)” to BaseFileName
  \new Score
  
\transpose c a {\TheChords}
\new Staff \jazzOn \transpose c a {\TheHead}
  
  \header {piece = \markup {\fontsize #-1 \override #'(font-name . 
LilyJazzText) Alto Sax in Eb”}} % …AND AGAIN HERE
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: String Concatenation, and Use of Unicode characters

2015-03-02 Thread Klaus Blum
Hi Michael, 

for your second issue, this might be helpful:
\concat { Alto Sax in E \fontsize #-5 \raise #0.9 \musicglyph
#accidentals.flat }

Could you provide your source file and also the include files as a download
or attachment? I tried to copy-paste from your post, but some signs got
messed up...

Cheers, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/String-Concatenation-and-Use-of-Unicode-characters-tp172504p172505.html
Sent from the User mailing list archive at Nabble.com.

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


Re: String Concatenation, and Use of Unicode characters

2015-03-02 Thread H. S. Teoh
On Mon, Mar 02, 2015 at 04:40:27PM +, Michael Hendry wrote:
[...]
 2. The LilyJazzText font uses small capitals instead of lower case
 letters, so using “Eb” produces a capital E followed by a small
 capital B. On my Mac I know how to produce a flat sign, and LilyPond
 will use the flat sign from another font, but I’d like to be able to
 define a flat sign as a variable, and append it to the piece markup
 when creating the books for trumpet and alto.
[...]

Couldn't you just use \flat to get the flat sign from the Feta font? Or
do you want to substitute that with a lowercase 'b' in some cases?


T

-- 
Кто везде - тот нигде.

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


Re: String Concatenation, and Use of Unicode characters

2015-03-02 Thread Klaus Blum
Hi again, 

for your first issue, try:

\bookOutputName  #(string-append BaseFileName  (alto))


hope this helps, 
Klaus




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/String-Concatenation-and-Use-of-Unicode-characters-tp172504p172508.html
Sent from the User mailing list archive at Nabble.com.

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