Re: Change color after a line break

2015-07-19 Thread Marc Hohl

Am 19.07.2015 um 10:04 schrieb David Kastrup:

Marc Hohl m...@hohlart.de writes:

[...]


This \applyContext is executed at Score level as no other contexts have
yet been created.


c4\pp\ d e f
\break \stopStaff
\applyContext #(override-color-for-all-grobs (x11-color 'red))


This \applyContext is executed at Voice level.  Try

\context Score \applyContext ...

here.  You want Score level rather than Staff level in order to also
catch stuff like marks, bar numbers and so on.  You might want to use
\context Staff for the first \applyContext, just to make sure that you
don't get it executed in some other context due to unrelated stuff.


\startStaff
\grace { g16[( a g fis]) } g1\ff\!
}


I merely copied the example from lsr, where no explicit contexts are 
given, but I think I understand ...


Addendum:

I am using the bleeding edge self-compiled lilypond version 2.19.24
and tried

#(define (override-color-for-all-grobs color)
   (lambda (context)
(let loop ((x all-grob-descriptions))
 (if (not (null? x))
  (let ((grob-name (caar x)))
   #{ \override #(list 'Staff grob-name 'color) = #color #}
   (loop (cdr x)))


Well, you indend this to be the same thing, but evaluating some music
expression and then throwing it away is not going to cause any visible
results.


Ah, the same mistake again – I had that before, and you corrected me in 
another thread. I *really* should be more careful.


  By the way, you can write


   #{ \override Staff . #grob-name . color = #color #}

instead in cases where an override music expression is actually needed.
Probably #{ \override Staff.#grob-name .color = #color #} would also
work but it seems nicer not to overdo the compression when putting
Scheme in the middle.


Ah, ok. I fiddled with the old Grob #'property syntax and ended with 
the list construct. Your proposal look quite better.





as well as the new overrideProperty command provided by David Kastrup
in one of the latest patch series:

#(define (override-color-for-all-grobs color)
   (lambda (context)
(let loop ((x all-grob-descriptions))
 (if (not (null? x))
  (let ((grob-name (caar x)))
(overrideProperty (list 'Score grob-name 'color) color)
   (loop (cdr x)))


No, overrideProperty is a real old thing (and also returns a music
expression which will use a different mechanism when interpreted).  What
I provided was propertyOverride (yes, that's a really fabulous naming
choice that will never cause anybody to confuse the two).


Ah, that's the culprit! I remembered that you provided (override ...)
at Scheme level and renamed the command shortly after that, but somehow
I confused overrideProperty and propertyOverride.



 Which again
is just another alias for what you wrote above, and as it is returning a
music expression, will not do the trick for you in the same way than the
other overrides.


Yes, I understand.


Now let's for exercise sake actually try going through a music
expression here.  If we do that, we cannot go through an \applyContext
hook since then no iterator will get to see our override any more.  We
could try creating Override stream events and sending them to the
context ourselves (that's how the respective iterators work) but that's
sort of pointless.  Instead, just let us create and use overrides
directly:

overrideColorForAll =
#(define-music-function (color) (color?)
#{ #@(map (lambda (dsc)
 #{ \override Score . #(car dsc) . color = #color
 #})
  all-grob-descriptions)
#})


Thanks a lot! Just to check that I have understood the underlying 
mechanism, I rewrote that according to


overrideColorForAll =
#(define-music-function (color) (color?)
#{ #@(map (lambda (dsc)
(propertyOverride (list 'Score (car dsc) 'color) color))
 all-grob-descriptions)
#})

which seems to do the trick as well without switching between Scheme and 
LilyPond whithin overrideColorForAll.




\relative c' {
\overrideColorForAll #(x11-color 'blue)
c4\pp\ d e f
\break \stopStaff
\overrideColorForAll #(x11-color 'red)
\startStaff
\grace { g16[( a g fis]) } g1\ff\!
}


Thanks for your detailed explanations!

Marc



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


Re: Repeated Spiral Line

2015-07-19 Thread Urs Liska


Am 19. Juli 2015 10:41:44 MESZ, schrieb Malte Meyn lilyp...@maltemeyn.de:
I don’t have a very clear idea but I know that the music font “Bravura”

has these and similar symbols. So you might consider using this font or

perhaps its LilyPond adaptation “Profondo”.

As LilyPond doesn't support these glyphs I doubt Abraham has integrated them in 
Profondo.



Links to Bravura/SMuFL:
http://www.smufl.org/fonts/ (the font)
http://www.smufl.org/files/smufl-1.18.pdf (see p. 250 ff. for these
symbols)
http://lilypondblog.org/2014/01/smufl-fonts-in-lilypond/ and
http://lilypondblog.org/2014/02/feta-and-bravura/ (two blog posts about

using SMuFL fonts in LilyPond)

Link to Profondo:
http://fonts.openlilylib.org/profondo/ (I’m not sure whether it
contains 
all the SMuFL symbols but you can easily try out the font to see it in 
action with “normal” music by downloading the font and including 
profondo.ily)

Am 19.07.2015 um 07:33 schrieb Nike Hedges:
 I want to write spiral (spring) lines which express to play each of
notes
 with rotating repeatedly.

 Like:
 [image: Inline image 1]
 An excerpt from Murail Mach 2.5

 A lot of contemporary pieces use such lines,
 but I couldn't find any information in LilyPond world so far.
 I only thought glissando could express them but no such style
available yet.

 Does anybody know how to write these?

 Thanks,
 Nike



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


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


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


Re: Change color after a line break

2015-07-19 Thread David Kastrup
Marc Hohl m...@hohlart.de writes:

 Thanks a lot! Just to check that I have understood the underlying
 mechanism, I rewrote that according to

 overrideColorForAll =
 #(define-music-function (color) (color?)
 #{ #@(map (lambda (dsc)
 (propertyOverride (list 'Score (car dsc) 'color) color))
  all-grob-descriptions)
 #})

 which seems to do the trick as well without switching between Scheme
 and LilyPond whithin overrideColorForAll.

If you want to avoid switching to LilyPond, you can of course replace
#{ #@... #} with (make-simultaneous-music ...).

Or to be completely nitpicky, (make-simultaneous-music (set-origin!...))
so that point-and-click/error information of the overrides will be
correct.  Which is sort of pointless for this particular application
since overrides are no clickable entities and the only conceivable error
is when `color' is not a color and then the music function would not
have accepted it in the first place.

-- 
David Kastrup

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


Re: Change color after a line break

2015-07-19 Thread David Kastrup
David Kastrup d...@gnu.org writes:

 Marc Hohl m...@hohlart.de writes:

 Thanks a lot! Just to check that I have understood the underlying
 mechanism, I rewrote that according to

 overrideColorForAll =
 #(define-music-function (color) (color?)
 #{ #@(map (lambda (dsc)
 (propertyOverride (list 'Score (car dsc) 'color) color))
  all-grob-descriptions)
 #})

 which seems to do the trick as well without switching between Scheme
 and LilyPond whithin overrideColorForAll.

 If you want to avoid switching to LilyPond, you can of course replace
 #{ #@... #} with (make-simultaneous-music ...).

make-sequential-music of course.  Doesn't usually make a difference, but
look at

{
  
\override NoteHead.color = #red
\override Stem.color = #red
  
  c'2 2
}

for a case where it _does_ make a difference.

-- 
David Kastrup

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


Re: Change color after a line break

2015-07-19 Thread David Kastrup
Marc Hohl m...@hohlart.de writes:

 Am 17.07.2015 um 18:59 schrieb Marc Hohl:
 Hi list,

 for strange reasons, I have to color complete lines in different colors.

 I found http://lsr.di.unimi.it/LSR/Item?id=443 which works
 great for complete scores, but if I call \applyContext ...
 after a line break, the color of the Staff lines does not change.
 I tried \stopStaff/\startStaff with no visible difference.

 How can I change the definition of override-color-for-all-grobs
 to make the second staff line completely red?

The definition is fine.  The application isn't.

 #(define (override-color-for-all-grobs color)
(lambda (context)
 (let loop ((x all-grob-descriptions))
  (if (not (null? x))
   (let ((grob-name (caar x)))
(display grob-name)
(ly:context-pushpop-property context grob-name 'color color)
(loop (cdr x)))

 \relative c' {
\applyContext #(override-color-for-all-grobs (x11-color 'blue))

This \applyContext is executed at Score level as no other contexts have
yet been created.

c4\pp\ d e f
\break \stopStaff
\applyContext #(override-color-for-all-grobs (x11-color 'red))

This \applyContext is executed at Voice level.  Try

\context Score \applyContext ...

here.  You want Score level rather than Staff level in order to also
catch stuff like marks, bar numbers and so on.  You might want to use
\context Staff for the first \applyContext, just to make sure that you
don't get it executed in some other context due to unrelated stuff.

\startStaff
\grace { g16[( a g fis]) } g1\ff\!
 }

 Addendum:

 I am using the bleeding edge self-compiled lilypond version 2.19.24
 and tried

 #(define (override-color-for-all-grobs color)
   (lambda (context)
(let loop ((x all-grob-descriptions))
 (if (not (null? x))
  (let ((grob-name (caar x)))
   #{ \override #(list 'Staff grob-name 'color) = #color #}
   (loop (cdr x)))

Well, you indend this to be the same thing, but evaluating some music
expression and then throwing it away is not going to cause any visible
results.  By the way, you can write

  #{ \override Staff . #grob-name . color = #color #}

instead in cases where an override music expression is actually needed.
Probably #{ \override Staff.#grob-name .color = #color #} would also
work but it seems nicer not to overdo the compression when putting
Scheme in the middle.

 as well as the new overrideProperty command provided by David Kastrup
 in one of the latest patch series:

 #(define (override-color-for-all-grobs color)
   (lambda (context)
(let loop ((x all-grob-descriptions))
 (if (not (null? x))
  (let ((grob-name (caar x)))
(overrideProperty (list 'Score grob-name 'color) color)
   (loop (cdr x)))

No, overrideProperty is a real old thing (and also returns a music
expression which will use a different mechanism when interpreted).  What
I provided was propertyOverride (yes, that's a really fabulous naming
choice that will never cause anybody to confuse the two).  Which again
is just another alias for what you wrote above, and as it is returning a
music expression, will not do the trick for you in the same way than the
other overrides.

Now let's for exercise sake actually try going through a music
expression here.  If we do that, we cannot go through an \applyContext
hook since then no iterator will get to see our override any more.  We
could try creating Override stream events and sending them to the
context ourselves (that's how the respective iterators work) but that's
sort of pointless.  Instead, just let us create and use overrides
directly:

overrideColorForAll =
#(define-music-function (color) (color?)
#{ #@(map (lambda (dsc)
#{ \override Score . #(car dsc) . color = #color
#})
 all-grob-descriptions)
#})

\relative c' {
   \overrideColorForAll #(x11-color 'blue)
   c4\pp\ d e f
   \break \stopStaff
   \overrideColorForAll #(x11-color 'red)
   \startStaff
   \grace { g16[( a g fis]) } g1\ff\!
}

-- 
David Kastrup

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


Re: Repeated Spiral Line

2015-07-19 Thread Malte Meyn
I don’t have a very clear idea but I know that the music font “Bravura” 
has these and similar symbols. So you might consider using this font or 
perhaps its LilyPond adaptation “Profondo”.


Links to Bravura/SMuFL:
http://www.smufl.org/fonts/ (the font)
http://www.smufl.org/files/smufl-1.18.pdf (see p. 250 ff. for these symbols)
http://lilypondblog.org/2014/01/smufl-fonts-in-lilypond/ and
http://lilypondblog.org/2014/02/feta-and-bravura/ (two blog posts about 
using SMuFL fonts in LilyPond)


Link to Profondo:
http://fonts.openlilylib.org/profondo/ (I’m not sure whether it contains 
all the SMuFL symbols but you can easily try out the font to see it in 
action with “normal” music by downloading the font and including 
profondo.ily)


Am 19.07.2015 um 07:33 schrieb Nike Hedges:

I want to write spiral (spring) lines which express to play each of notes
with rotating repeatedly.

Like:
[image: Inline image 1]
An excerpt from Murail Mach 2.5

A lot of contemporary pieces use such lines,
but I couldn't find any information in LilyPond world so far.
I only thought glissando could express them but no such style available yet.

Does anybody know how to write these?

Thanks,
Nike



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



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


Re: Change color after a line break

2015-07-19 Thread Marc Hohl

Am 17.07.2015 um 18:59 schrieb Marc Hohl:

Hi list,

for strange reasons, I have to color complete lines in different colors.

I found http://lsr.di.unimi.it/LSR/Item?id=443 which works
great for complete scores, but if I call \applyContext ...
after a line break, the color of the Staff lines does not change.
I tried \stopStaff/\startStaff with no visible difference.

How can I change the definition of override-color-for-all-grobs
to make the second staff line completely red?

Thanks in advance,

Marc

%% http://lsr.di.unimi.it/LSR/Item?id=443
%% see also
http://lilypond.org/doc/v2.18/Documentation/learning/visibility-and-color-of-objects


#(define (override-color-for-all-grobs color)
   (lambda (context)
(let loop ((x all-grob-descriptions))
 (if (not (null? x))
  (let ((grob-name (caar x)))
   (display grob-name)
   (ly:context-pushpop-property context grob-name 'color color)
   (loop (cdr x)))

\relative c' {
   \applyContext #(override-color-for-all-grobs (x11-color 'blue))
   c4\pp\ d e f
   \break \stopStaff
   \applyContext #(override-color-for-all-grobs (x11-color 'red))
   \startStaff
   \grace { g16[( a g fis]) } g1\ff\!
}


Addendum:

I am using the bleeding edge self-compiled lilypond version 2.19.24
and tried

#(define (override-color-for-all-grobs color)
  (lambda (context)
   (let loop ((x all-grob-descriptions))
(if (not (null? x))
 (let ((grob-name (caar x)))
  #{ \override #(list 'Staff grob-name 'color) = #color #}
  (loop (cdr x)))

as well as the new overrideProperty command provided by David Kastrup in 
one of the latest patch series:


#(define (override-color-for-all-grobs color)
  (lambda (context)
   (let loop ((x all-grob-descriptions))
(if (not (null? x))
 (let ((grob-name (caar x)))
   (overrideProperty (list 'Score grob-name 'color) color)
  (loop (cdr x)))

Marc



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


Re: Using force-hshift to create a cross-staff chord

2015-07-19 Thread Knute Snortum
Thanks Keith, that worked.  Should I copy this to the bug reporting list?


Knute Snortum
(via Gmail)

On Sat, Jul 18, 2015 at 6:19 PM, Keith OHara k-ohara5...@oco.net wrote:

 Knute Snortum ksnortum at gmail.com writes:

 
  I thought the answer would be to force-hshift the lower note but it
  doesn't seem to move.
 

 Annoyingly, LilyPond left-aligns the groups of clashing chords between
 different staves.  The code history says the reason was to left-align
\transpose c c''
\new Staff  { f4 g } \\ { g f } 
  \new Staff { c4 c } 
 This makes force-hshift often useless for making cross-staff chords.

 We should file a bug-report, to at least left-align before applying
 explicit force-hshifts

 For now, you could use a hidden voice
  ...
  a2 \new Voice{\voiceOne \once \hideNotes a4 } a4
  ...



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

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


Full measure rest for time 6/8

2015-07-19 Thread MING TSANG
Dear lilyponders:
http://lilybin.com/is7dml/1 

The following is the log file showing barcheck failed, but the pdf display OK.  
How to code full bar rest for time 6/8?Immanuel,Ming
log file...Starting 
lilypond-windows.exe 2.18.2 [test_full-bar-rest.ly]...Processing 
`K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly'Parsing...Interpreting 
music...K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly:11:20: warning: 
barcheck failed at: 3/8tt = {\global r8 |  R4. s4. | R4. s4. | r4. \tuplet 4/3 
{d'8 c'8 bf8 g8} a4. r4 \bar|.} %m30-34Preprocessing graphical 
objects...Finding the ideal number of pages...Fitting music on 1 page...Drawing 
systems...Layout output to `test_full-bar-rest.ps'...Converting to 
`./test_full-bar-rest.pdf'...Success: compilation successfully 
completedCompleted successfully in 1.4.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


TextSpanner + \mark?

2015-07-19 Thread James Harkins
Is there a way to use a textspanner with a \mark?

Rationale: accel. and rit. directions are frequently text spanners, but
in the score, they aren't printed in every part (as \mark items are not
printed in every part). Of course, in the parts, they must appear (as
\mark's do).

Currently (as far as I know), to get this, I have to \tag them and suppress
them from the score.

Is there a better way?

hjh


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


Re: Full measure rest for time 6/8

2015-07-19 Thread David Kastrup
MING TSANG tsan...@rogers.com writes:

 Dear lilyponders:
 http://lilybin.com/is7dml/1 

 The following is the log file showing barcheck failed, but the pdf
 display OK.  How to code full bar rest for time 6/8?

R2. or R8*6 or R4.*2

-- 
David Kastrup

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


Re: Full measure rest for time 6/8

2015-07-19 Thread Simon Albrecht
Excuse me, but how on earth did you get the idea of writing { R4. s4. } 
? It’s got to be R2. only, of course.
A ‘R’ rest is always interpreted like { | R | }, so there will be 
warnings if these barchecks fail.


Yours, Simon

Am 19.07.2015 um 15:37 schrieb MING TSANG:

Dear lilyponders:

http://lilybin.com/is7dml/1
Inline image
The following is the log file showing barcheck failed, but the pdf 
display OK.  How to code full bar rest for time 6/8?

Immanuel,
Ming

log file...
Starting lilypond-windows.exe 2.18.2 [test_full-bar-rest.ly]...
Processing `K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly'
Parsing...
Interpreting music...
K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly:11:20 
https://ca-mg6.mail.yahoo.com/neo/0: warning: barcheck failed at: 3/8

tt = {\global r8 |
R4. s4. | R4. s4. | r4. \tuplet 4/3 {d'8 c'8 bf8 g8} a4. r4 \bar|.} 
%m30-34

Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `test_full-bar-rest.ps'...
Converting to `./test_full-bar-rest.pdf'...
Success: compilation successfully completed
Completed successfully in 1.4.


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


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


Re: TextSpanner + \mark?

2015-07-19 Thread Simon Albrecht
Unfortunately no. See 
https://code.google.com/p/lilypond/issues/detail?id=3176.


Yours, Simon

Am 19.07.2015 um 15:43 schrieb James Harkins:

Is there a way to use a textspanner with a \mark?

Rationale: accel. and rit. directions are frequently text spanners, but
in the score, they aren't printed in every part (as \mark items are not
printed in every part). Of course, in the parts, they must appear (as
\mark's do).

Currently (as far as I know), to get this, I have to \tag them and suppress
them from the score.

Is there a better way?

hjh


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



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


Re: TextSpanner + \mark?

2015-07-19 Thread James Harkins
Simon Albrecht simon.albrecht at mail.de writes:

 Unfortunately no. See 
 https://code.google.com/p/lilypond/issues/detail?id=3176.

I had a feeling that was the answer. :(

It's not a huge deal for my current project, but it's certainly a weakness.

hjh


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


Re: un-bold font inside \tempo

2015-07-19 Thread Bruno Ruviaro
Thanks, Simon! That's great to know.

On Thu, Jul 16, 2015 at 11:41 PM, Simon Albrecht simon.albre...@mail.de
wrote:

  Hi Bruno,

 to avoid creating a new markup from scratch you can use LSR snippet no.
 869 http://lsr.di.unimi.it/LSR/Item?id=869
 http://lsr.di.unimi.it/LSR/Item?id=869 to modify the default. Example
 attached.

 Yours best,
 Simon


 Am 17.07.2015 um 01:19 schrieb Bruno Ruviaro:

  Hi all,

  This is my first post on this list, and my first week using Lilypond for
 a real project. Learning a lot in a compressed amount of time... ;-)

  I am trying to get metronome markings with ca. before the number, but
 without bold face characters. How can I cancel the bold face font inside a
 \tempo command?

 The snippet below shows what I've got so far. Bar 2 is what I'm getting by
 using \markup inside \tempo. Bar 3 shows what I would like to get. I'm
 happy to use Bar 3 solution if that's the only way, but I suppose there is
 a solution from inside \tempo?

 Thanks for any tips!

 Bruno

 % ===

 \version 2.18.2

 melody = \relative c'' {
   % regular
   \tempo 4=120
   % using markup inside tempo
   % characters are printed in bold face
   c4 d e f
\tempo \markup {
 \concat {
   \smaller \general-align #Y #DOWN \note #4 #1
= 
   \italic ca.
   \hspace #0.25
   120
 }
   }
   c d e f

   % not using tempo to avoid bold face
   c^\markup {
 \concat {
   \smaller \general-align #Y #DOWN \note #4 #1
= 
   \italic ca.
   \hspace #0.25
   120
 }
   }
   d e f
   c d e f
 }

 \score {
 \new Staff { \melody }
   \layout { }
 }




 ___
 lilypond-user mailing 
 listlilypond-user@gnu.orghttps://lists.gnu.org/mailman/listinfo/lilypond-user



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


Re: Full measure rest for time 6/8

2015-07-19 Thread MING TSANG
Simon,It is clear for me now. Thank you.  No hard feeling, not at 
all.Immanuel,Ming. 


 On Sunday, July 19, 2015 6:20 PM, Simon Albrecht simon.albre...@mail.de 
wrote:
   

  Am 20.07.2015 um 00:08 schrieb MING TSANG:
 
  Simon: I have been Using R1 before but not knowing how to use it for others I 
thought R4. s4. will make up a full measure of 6/8.  
 Which is correct :-) And the printed output does not differ, whether you use { 
R4. s4. } or { R2. }, since the MMR (MultiMeasureRest) is centered in the bar 
anyway. Also, with something like { R2.*4 }, it will often be necessary to 
print the rest multiple times, once in every measure that it spans.
 So the only issue about your coding is the bar checking that Lily 
automatically performs with R.
 
  I am learning by coming to the Lists for help.  
 Which is a good thing and I’m sorry if I’ve been too harsh.
 I hope it’s clear now.
 
 Immanuel,
 Simon
 
 
 On Sunday, July 19, 2015 9:46 AM, Simon Albrecht simon.albre...@mail.de 
wrote:
 
 
Excuse me, but how on earth did you get the idea of writing { R4. s4. } ? 
It’s got to be R2. only, of course.
 A ‘R’ rest is always interpreted like { | R | }, so there will be warnings if 
these barchecks fail.
 
 Yours, Simon
 
 Am 19.07.2015 um 15:37 schrieb MING TSANG:
  
   Dear lilyponders: 
  http://lilybin.com/is7dml/1 
  
 The following is the log file showing barcheck failed, but the pdf display OK. 
 How to code full bar rest for time 6/8? Immanuel, Ming 
  logfile... Starting 
lilypond-windows.exe 2.18.2 [test_full-bar-rest.ly]... Processing 
`K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly' Parsing... Interpreting 
music... K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly:11:20: warning: 
barcheck failed at: 3/8 tt = {\global r8 |   R4. s4. | R4. s4. | r4. \tuplet 
4/3 {d'8 c'8 bf8 g8} a4. r4 \bar|.} %m30-34 Preprocessing graphical 
objects... Finding the ideal number of pages... Fitting music on 1 page... 
Drawing systems... Layout output to `test_full-bar-rest.ps'... Converting to 
`./test_full-bar-rest.pdf'... Success: compilation successfully completed   
Completed successfully in 1.4.   
  
 ___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
   
 
  
 
 

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


Re: Tweaking in an engraver

2015-07-19 Thread Vaughan McAlley
On 20 July 2015 at 05:01, David Kastrup d...@gnu.org wrote:
 An engraver has the advantage that it is at the latest possible point in
 the pipeline.  But it might be too late to actually change pitches
 before other engravers get to see them.

From what Scheme-fiddling I’ve been doing, it seems that the results
of display-scheme-music are yet to be “folded” (my word). So something
like:


%%
\version 2.18.2

myMusic = \new Voice {
  
{ c'1 s }
{ s1 d' }   % equivalent (typographically) to { c'1 d' }
  
}

\displayMusic \myMusic

%%%

…will give (as it probably should) an expression with
'SimultaneousMusic. Is it possible to created a “folded” version in
Scheme, or is that done by the engravers later, when it would be too
late to fiddle with?

Vaughan

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


Re: Full measure rest for time 6/8

2015-07-19 Thread Simon Albrecht

Am 20.07.2015 um 00:08 schrieb MING TSANG:

Simon:
I have been Using R1 before but not knowing how to use it for others I 
thought R4. s4. will make up a full measure of 6/8.
Which is correct :-) And the printed output does not differ, whether you 
use { R4. s4. } or { R2. }, since the MMR (MultiMeasureRest) is centered 
in the bar anyway. Also, with something like { R2.*4 }, it will often be 
necessary to print the rest multiple times, once in every measure that 
it spans.
So the only issue about your coding is the bar checking that Lily 
automatically performs with R.

I am learning by coming to the Lists for help.

Which is a good thing and I’m sorry if I’ve been too harsh.
I hope it’s clear now.

Immanuel,
Simon

On Sunday, July 19, 2015 9:46 AM, Simon Albrecht 
simon.albre...@mail.de wrote:



Excuse me, but how on earth did you get the idea of writing { R4. s4. 
} ? It’s got to be R2. only, of course.
A ‘R’ rest is always interpreted like { | R | }, so there will be 
warnings if these barchecks fail.


Yours, Simon

Am 19.07.2015 um 15:37 schrieb MING TSANG:

Dear lilyponders:

http://lilybin.com/is7dml/1
Inline image
The following is the log file showing barcheck failed, but the pdf 
display OK.  How to code full bar rest for time 6/8?

Immanuel,
Ming

log file...
Starting lilypond-windows.exe 2.18.2 [test_full-bar-rest.ly]...
Processing `K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly'
Parsing...
Interpreting music...
K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly:11:20 
https://ca-mg6.mail.yahoo.com/neo/0: warning: barcheck failed at: 3/8

tt = {\global r8 |
R4. s4. | R4. s4. | r4. \tuplet 4/3 {d'8 c'8 bf8 g8} a4. r4 \bar|.} 
%m30-34

Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `test_full-bar-rest.ps'...
Converting to `./test_full-bar-rest.pdf'...
Success: compilation successfully completed
Completed successfully in 1.4.


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






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


Re: Full measure rest for time 6/8

2015-07-19 Thread MING TSANG
Thank you David. Appreciated your dedication to the goodness of 
lilypond.Immanuel,Ming. 


 On Sunday, July 19, 2015 9:45 AM, David Kastrup d...@gnu.org wrote:
   

 MING TSANG tsan...@rogers.com writes:

 Dear lilyponders:
 http://lilybin.com/is7dml/1 

 The following is the log file showing barcheck failed, but the pdf
 display OK.  How to code full bar rest for time 6/8?

R2. or R8*6 or R4.*2

-- 
David Kastrup

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


Re: Full measure rest for time 6/8

2015-07-19 Thread MING TSANG
Simon:I have been Using R1 before but not knowing how to use it for others I 
thought R4. s4. will make up a full measure of 6/8.I am learning by coming to 
the Lists for help. Thank you.Immanuel,Ming.  


 On Sunday, July 19, 2015 9:46 AM, Simon Albrecht simon.albre...@mail.de 
wrote:
   

  Excuse me, but how on earth did you get the idea of writing { R4. s4. } ? 
It’s got to be R2. only, of course.
 A ‘R’ rest is always interpreted like { | R | }, so there will be warnings if 
these barchecks fail.
 
 Yours, Simon
 
 Am 19.07.2015 um 15:37 schrieb MING TSANG:
  
  Dear lilyponders: 
  http://lilybin.com/is7dml/1 
  
 The following is the log file showing barcheck failed, but the pdf display OK. 
 How to code full bar rest for time 6/8? Immanuel, Ming 
  log file... Starting 
lilypond-windows.exe 2.18.2 [test_full-bar-rest.ly]... Processing 
`K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly' Parsing... Interpreting 
music... K:/LILY_POND/jesus-of-galilee/test_full-bar-rest.ly:11:20: warning: 
barcheck failed at: 3/8 tt = {\global r8 |   R4. s4. | R4. s4. | r4. \tuplet 
4/3 {d'8 c'8 bf8 g8} a4. r4 \bar|.} %m30-34 Preprocessing graphical 
objects... Finding the ideal number of pages... Fitting music on 1 page... 
Drawing systems... Layout output to `test_full-bar-rest.ps'... Converting to 
`./test_full-bar-rest.pdf'... Success: compilation successfully completed   
Completed successfully in 1.4.  
  
 ___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 

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


Re: Extend piano sustain pedal indication to end of bar

2015-07-19 Thread Andrew Bernard
Hi Keith,

By no means missing the point! Works fine. Thanks! I would never have thought 
it was so simple - I was expecting a hundred lines of Scheme code.

I seem to always miss that these various properties are often in other 
inherited interfaces, and so have trouble finding them in the manual.

Andrew



On 19 July 2015 at 15:03:27, Keith OHara (k-ohara5...@oco.net) wrote:


I might be missing the point, but 

\transpose c c' { 
\set Staff.pedalSustainStyle = #'bracket 
\override Staff.PianoPedalBracket.to-barline = ##t 
c4\sustainOn e g b 
g1\sustainOff } 

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


extra measure in verse of vocal music

2015-07-19 Thread Peter Hiltz
A particular song has four verses and a refrain. Verses 2 and 3 have one
extra measure about 5 measures before the refrain.

I am confused on how best to handle the issue. Any suggestions would be
appreciated.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Using force-hshift to create a cross-staff chord

2015-07-19 Thread Knute Snortum
I see that you submitted patch.  Thank you.


Knute Snortum
(via Gmail)

On Sun, Jul 19, 2015 at 6:13 AM, Knute Snortum ksnor...@gmail.com wrote:

 Thanks Keith, that worked.  Should I copy this to the bug reporting list?


 Knute Snortum
 (via Gmail)

 On Sat, Jul 18, 2015 at 6:19 PM, Keith OHara k-ohara5...@oco.net wrote:

 Knute Snortum ksnortum at gmail.com writes:

 
  I thought the answer would be to force-hshift the lower note but it
  doesn't seem to move.
 

 Annoyingly, LilyPond left-aligns the groups of clashing chords between
 different staves.  The code history says the reason was to left-align
\transpose c c''
\new Staff  { f4 g } \\ { g f } 
  \new Staff { c4 c } 
 This makes force-hshift often useless for making cross-staff chords.

 We should file a bug-report, to at least left-align before applying
 explicit force-hshifts

 For now, you could use a hidden voice
  ...
  a2 \new Voice{\voiceOne \once \hideNotes a4 } a4
  ...



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



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


Re: Tweaking in an engraver

2015-07-19 Thread Timothy Lanfear
Mistyped on my phone first time. 

I am after something like your solution. Part of my motivation was to learn how 
engravers work. I can follow up with more detail in a few days when I return 
home. 

Sent from my iPod

 On 19 Jul 2015, at 19:12, Peter Gentry peter.gen...@sunscales.co.uk wrote:
 
 The OP described wanting to tweak a note property depending on its pitch. Now 
 I may be missing something but do you need to create
 an engraver for this.
 
 

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


Re: TextSpanner + \mark?

2015-07-19 Thread David Kastrup
James Harkins jamshar...@qq.com writes:

 Is there a way to use a textspanner with a \mark?

 Rationale: accel. and rit. directions are frequently text spanners, but
 in the score, they aren't printed in every part (as \mark items are not
 printed in every part). Of course, in the parts, they must appear (as
 \mark's do).

 Currently (as far as I know), to get this, I have to \tag them and suppress
 them from the score.

 Is there a better way?

If you don't use textspanners for other stuff, you can remove the
respective engraver from Staff and add it to Score.

-- 
David Kastrup

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


RE: Tweaking in an engraver

2015-07-19 Thread Peter Gentry
The OP described wanting to tweak a note property depending on its pitch. Now I 
may be missing something but do you need to create
an engraver for this.

My instrumentranges.ly examines note pitch an based on a suplied criterion 
changes notehead colour and style - is this the sort of
thing you had in mind.

\version 2.19.15
% 
-
% include function file instrument_ranges.ly
% usuage include -- \include ./ranges/instrument_ranges.ly
% usuage call --   \naturalizeInstrumentRange instrument music
% this function will confine all pitches to the individual instruments range
% Note the ranges refer to music transposed for each instrument not the true 
pitches.
% use % for comment outside scheme function -  use ; inside scheme functions
% 
-

#(define (naturalize-instrument-range p instrument ) 
  (let ((o (ly:pitch-octave p))
  (a (* 4 (ly:pitch-alteration p)))
;; alteration, a, in quarter tone steps, for historical reasons
  (n (ly:pitch-notename p)))
(define np 0)
(define op (+ (+ (+ (* 14 o) ) (* n 2) ) (/ a 2)))


;; clarinet range e to f'  -1 2 0  to 1 3 0  (-11 to 20)
(cond
   ((equal? instrument clarinet )
   (if   ( op -38)  (begin (set! o (+ o 1))) )
(if   ( op -24)  (begin (set! o (+ o 1))) )
  (if   ( op -10)  (begin (set! o (+ o 1))) )
   (if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
)
; bass clarinet range eb to f'  -1 1 2  (-1 2 -2)  to 1 3 0 (-11 to 34)

   ((equal? instrument bass clarinet eb )
   (if   ( op -39)  (begin (set! o (+ o 1))) )
(if   ( op -25)  (begin (set! o (+ o 1))) )
(if   ( op -11)  (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
 )
; bass clarinet range c to f'  -1 1 2  (-1 2 -2)  to 1 3 0 (-14 to 34)

((equal? instrument bass clarinet c )
(if   ( op -42)  (begin (set! o (+ o 1))) )
(if   ( op -28)  (begin (set! o (+ o 1))) )
(if   ( op -14)  (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
)
;; flute range c to f'  0 0 0   to 1 3 0  (0 to 34)

((equal? instrument flute)
(if   ( op -28)  (begin (set! o (+ o 1))) )
(if   ( op -14)  (begin (set! o (+ o 1))) )
(if   ( op 0)  (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
) 
;; alto range d to f'  0 1 0   to 1 3 0

 ((equal? instrument alto)
   (if   ( op -28)  (begin (set! o (+ o 1))) )
(if   ( op -14)  (begin (set! o (+ o 1))) )
(if   ( op 0)   (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
) )

(ly:make-pitch o n (/ a 4)) 

))
 
% 
-
% a variable for the notehaed color on pitch change
% 
-

my-color = #(x11-color 'red)
 
% 
-
% this function rebuilds the music object optionally changing pitch and 
notehead color
% 
-
#(define (instrumentrange music instrument ) 
   (  ly:music? string? ) 
; extract the various portions of the music object
(let ((es (ly:music-property music 'elements))  
   (e   (ly:music-property music 'element)) 
   (p   (ly:music-property music 'pitch)))
 
; rebuild any 'elements unchanged
(if (pair? es)
   (ly:music-set-property! music 'elements
   (map (lambda (x) (instrumentrange x instrument)) es)))  

; rebuild any 'element unchanged
 (if (ly:music? e) (ly:music-set-property! music 'element
(instrumentrange e instrument )))

;rebuild the pitch and if a changed pitch add the color tweak
(if (ly:pitch? p)
  (let ((new-pitch (naturalize-instrument-range p instrument)))
  (ly:music-set-property! music 'pitch new-pitch)
  (if (and (not (equal? p new-pitch)) (color? my-color))
  (ly:music-set-property! music 'tweaks
  (acons
'color my-color
   (acons 'style 'harmonic
 (ly:music-property music 'tweaks)))

 music))
 
naturalizeInstrumentRange =
#(define-music-function (parser location  instrument m ) 
  ( string? ly:music? )  
  (instrumentrange m instrument ))
 
% 

Re: Repeated Spiral Line

2015-07-19 Thread tisimst
On Sunday, July 19, 2015, Urs Liska [via Lilypond] 
ml-node+s1069038n178808...@n5.nabble.com wrote:



 Am 19. Juli 2015 10:41:44 MESZ, schrieb Malte Meyn [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=178808i=0:
 I don’t have a very clear idea but I know that the music font “Bravura”
 
 has these and similar symbols. So you might consider using this font or
 
 perhaps its LilyPond adaptation “Profondo”.

 As LilyPond doesn't support these glyphs I doubt Abraham has integrated
 them in Profondo.


That's correct, but it is on my TODO list. For the time being, it's better
to use the original code that was created to use SMuFL fonts in LilyPond
(as shown previously in this thread at lilypondblog.org).

The nice thing is that you can use both Profondo (for native support of the
core set of glyphs) and the lily2smufl code to provide instant access to
every other glyph found in Bravura. It's a win-win, I think. This is part
of why I've hesitated to integrate the rest of the Bravura directly into
Profondo. I don't think it will provide that much more convenience than is
already available.

- Abraham


 Links to Bravura/SMuFL:
 http://www.smufl.org/fonts/ (the font)
 http://www.smufl.org/files/smufl-1.18.pdf (see p. 250 ff. for these
 symbols)
 http://lilypondblog.org/2014/01/smufl-fonts-in-lilypond/ and
 http://lilypondblog.org/2014/02/feta-and-bravura/ (two blog posts about
 
 using SMuFL fonts in LilyPond)
 
 Link to Profondo:
 http://fonts.openlilylib.org/profondo/ (I’m not sure whether it
 contains
 all the SMuFL symbols but you can easily try out the font to see it in
 action with “normal” music by downloading the font and including
 profondo.ily)
 
 Am 19.07.2015 um 07:33 schrieb Nike Hedges:
  I want to write spiral (spring) lines which express to play each of
 notes
  with rotating repeatedly.
 
  Like:
  [image: Inline image 1]
  An excerpt from Murail Mach 2.5
 
  A lot of contemporary pieces use such lines,
  but I couldn't find any information in LilyPond world so far.
  I only thought glissando could express them but no such style
 available yet.
 
  Does anybody know how to write these?
 
  Thanks,
  Nike
 
 
 
  ___
  lilypond-user mailing list
  [hidden email] http:///user/SendEmail.jtp?type=nodenode=178808i=1
  https://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
 ___
 lilypond-user mailing list
 [hidden email] http:///user/SendEmail.jtp?type=nodenode=178808i=2
 https://lists.gnu.org/mailman/listinfo/lilypond-user


 ___
 lilypond-user mailing list
 [hidden email] http:///user/SendEmail.jtp?type=nodenode=178808i=3
 https://lists.gnu.org/mailman/listinfo/lilypond-user


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://lilypond.1069038.n5.nabble.com/Repeated-Spiral-Line-tp178783p178808.html
  To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
 javascript:_e(%7B%7D,'cvml','ml-node%2bs1069038n...@n5.nabble.com');
 To unsubscribe from Lilypond, click here
 http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=
 .
 NAML
 http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Repeated-Spiral-Line-tp178783p178839.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: extra measure in verse of vocal music

2015-07-19 Thread tisimst
I definitely have lots of suggestions, but I wonder if you can provide a
minimal example showing what you are at and why it's not what you want?
That way I know if any of my suggestions are of any help. Thanks!

Also, have you read through the Learning and Notation manual's sections on
using lyrics? I think you'll find all the answers there based on what I
understand from your question.

- Abraham

On Sunday, July 19, 2015, Peter Hiltz [via Lilypond] 
ml-node+s1069038n178864...@n5.nabble.com wrote:

 A particular song has four verses and a refrain. Verses 2 and 3 have one
 extra measure about 5 measures before the refrain.

 I am confused on how best to handle the issue. Any suggestions would be
 appreciated.

 ___
 lilypond-user mailing list
 [hidden email] http:///user/SendEmail.jtp?type=nodenode=178864i=0
 https://lists.gnu.org/mailman/listinfo/lilypond-user


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://lilypond.1069038.n5.nabble.com/extra-measure-in-verse-of-vocal-music-tp178864.html
  To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
 javascript:_e(%7B%7D,'cvml','ml-node%2bs1069038n...@n5.nabble.com');
 To unsubscribe from Lilypond, click here
 http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=
 .
 NAML
 http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/extra-measure-in-verse-of-vocal-music-tp178864p178865.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: TextSpanner + \mark?

2015-07-19 Thread Dominic
Lack of easy tempo spanners is one of Lilypond's most prominent weaknesses. A
rall... spanner as a tempo mark for all players is absolutely standard
notation.

Attached is a template I arrived at a while ago with the help of some other
forum users, that solves the problem in most cases, and doesn't require
sacrificing the use of spanners elsewhere.

http://lilypond.1069038.n5.nabble.com/file/n178836/tempo-spanners.png 

tempo-spanners.ly
http://lilypond.1069038.n5.nabble.com/file/n178836/tempo-spanners.ly  



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/TextSpanner-mark-tp178824p178836.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: Tweaking in an engraver

2015-07-19 Thread Timothy Lanfear


Sent from my iPod

 On 19 Jul 2015, at 19:12, Peter Gentry peter.gen...@sunscales.co.uk wrote:
 
 The OP described wanting to tweak a note property depending on its pitch. Now 
 I may be missing something but do you need to create
 an engraver for this.
 
 My instrumentranges.ly examines note pitch an based on a suplied criterion 
 changes notehead colour and style - is this the sort of
 thing you had in mind.
 
 \version 2.19.15
 % 
 -
 % include function file instrument_ranges.ly
 % usuage include -- \include ./ranges/instrument_ranges.ly
 % usuage call --   \naturalizeInstrumentRange instrument music
 % this function will confine all pitches to the individual instruments range
 % Note the ranges refer to music transposed for each instrument not the true 
 pitches.
 % use % for comment outside scheme function -  use ; inside scheme functions
 % 
 -
 
 #(define (naturalize-instrument-range p instrument ) 
  (let ((o (ly:pitch-octave p))
  (a (* 4 (ly:pitch-alteration p)))
 ;; alteration, a, in quarter tone steps, for historical reasons
  (n (ly:pitch-notename p)))
 (define np 0)
 (define op (+ (+ (+ (* 14 o) ) (* n 2) ) (/ a 2)))
 
 
 ;; clarinet range e to f'  -1 2 0  to 1 3 0  (-11 to 20)
 (cond
   ((equal? instrument clarinet )
   (if   ( op -38)  (begin (set! o (+ o 1))) )
(if   ( op -24)  (begin (set! o (+ o 1))) )
  (if   ( op -10)  (begin (set! o (+ o 1))) )
   (if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
 )
 ; bass clarinet range eb to f'  -1 1 2  (-1 2 -2)  to 1 3 0 (-11 to 34)
 
   ((equal? instrument bass clarinet eb )
   (if   ( op -39)  (begin (set! o (+ o 1))) )
(if   ( op -25)  (begin (set! o (+ o 1))) )
(if   ( op -11)  (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
 )
 ; bass clarinet range c to f'  -1 1 2  (-1 2 -2)  to 1 3 0 (-14 to 34)
 
 ((equal? instrument bass clarinet c )
(if   ( op -42)  (begin (set! o (+ o 1))) )
(if   ( op -28)  (begin (set! o (+ o 1))) )
(if   ( op -14)  (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
 )
 ;; flute range c to f'  0 0 0   to 1 3 0  (0 to 34)
 
 ((equal? instrument flute)
(if   ( op -28)  (begin (set! o (+ o 1))) )
(if   ( op -14)  (begin (set! o (+ o 1))) )
(if   ( op 0)  (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
 ) 
 ;; alto range d to f'  0 1 0   to 1 3 0
 
 ((equal? instrument alto)
   (if   ( op -28)  (begin (set! o (+ o 1))) )
(if   ( op -14)  (begin (set! o (+ o 1))) )
(if   ( op 0)   (begin (set! o (+ o 1))) )
(if  (  op 62)  (begin (set! o (- o 1))) )
(if  (  op 48)  (begin (set! o (- o 1))) )
(if  (  op 34)  (begin (set! o (- o 1))) )
 ) )
 
 (ly:make-pitch o n (/ a 4)) 
 
 ))
 
 % 
 -
 % a variable for the notehaed color on pitch change
 % 
 -
 
 my-color = #(x11-color 'red)
 
 % 
 -
 % this function rebuilds the music object optionally changing pitch and 
 notehead color
 % 
 -
 #(define (instrumentrange music instrument ) 
   (  ly:music? string? ) 
 ; extract the various portions of the music object
 (let ((es (ly:music-property music 'elements))  
   (e   (ly:music-property music 'element)) 
   (p   (ly:music-property music 'pitch)))
 
 ; rebuild any 'elements unchanged
 (if (pair? es)
   (ly:music-set-property! music 'elements
   (map (lambda (x) (instrumentrange x instrument)) es)))  
 
 ; rebuild any 'element unchanged
 (if (ly:music? e) (ly:music-set-property! music 'element
(instrumentrange e instrument )))
 
 ;rebuild the pitch and if a changed pitch add the color tweak
 (if (ly:pitch? p)
  (let ((new-pitch (naturalize-instrument-range p instrument)))
  (ly:music-set-property! music 'pitch new-pitch)
  (if (and (not (equal? p new-pitch)) (color? my-color))
  (ly:music-set-property! music 'tweaks
  (acons
'color my-color
   (acons 'style 'harmonic
 (ly:music-property music 'tweaks)))
 
 music))
 
 

Re: Tweaking in an engraver

2015-07-19 Thread David Kastrup
Peter Gentry peter.gen...@sunscales.co.uk writes:

 My instrumentranges.ly examines note pitch an based on a suplied criterion 
 changes notehead colour and style - is this the sort of
 thing you had in mind.

 \version 2.19.15
 % 
 -
 % include function file instrument_ranges.ly
 % usuage include -- \include ./ranges/instrument_ranges.ly
 % usuage call --   \naturalizeInstrumentRange instrument music
 % this function will confine all pitches to the individual instruments range
 % Note the ranges refer to music transposed for each instrument not the true 
 pitches.
 % use % for comment outside scheme function -  use ; inside scheme functions
 % 
 -

 #(define (naturalize-instrument-range p instrument ) 
   (let ((o (ly:pitch-octave p))
   (a (* 4 (ly:pitch-alteration p)))
 ;; alteration, a, in quarter tone steps, for historical reasons
   (n (ly:pitch-notename p)))
 (define np 0)
 (define op (+ (+ (+ (* 14 o) ) (* n 2) ) (/ a 2)))

Uh, (define op (+ (* 14 o) (* n 2) (/ a 2)))


 ;; clarinet range e to f'  -1 2 0  to 1 3 0  (-11 to 20)
 (cond
((equal? instrument clarinet )
(if   ( op -38)  (begin (set! o (+ o 1))) )

Why `begin' here? (if ( op -38) (set! o (1+ o)))

 % this function rebuilds the music object optionally changing pitch and 
 notehead color
 % 
 -
 #(define (instrumentrange music instrument ) 
(  ly:music? string? ) 

Interesting.  This calls ly:music? on string? which unsurpringly returns
#f since string? is not a music expression.  #f is subsequently ignored.


-- 
David Kastrup

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


Re: Tweaking in an engraver

2015-07-19 Thread David Kastrup
Peter Gentry peter.gen...@sunscales.co.uk writes:

 The OP described wanting to tweak a note property depending on its
 pitch. Now I may be missing something but do you need to create an
 engraver for this.

Yes and no.  If you quote music in a different transposition and still
want stuff to work on it, you will not be able to solve this at the
music expression level.

As long as there is no danger of quoting or subsequent \relative or
\transpose or expansion of repeat chords or isolated durations...

An engraver has the advantage that it is at the latest possible point in
the pipeline.  But it might be too late to actually change pitches
before other engravers get to see them.

-- 
David Kastrup

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