Re: Help with espressivo adjustments

2013-04-13 Thread Janek Warchoł
This excellent!  it's premium material for extending manual - could
you post it as a patch?  If you don't have time to texinfo it, let's
at least add an issue to the tracker.

Janek

2013/4/13 Thomas Morley :
> 2013/4/12 SoundsFromSound :
>> Thomas:
>>
>> That works beautifully!
>>
>> When you get a free moment, could you please break down that code for me
>> piece by piece so I can understand how I may be able to edit it in the
>> future, if need be (for further adjustments / size changes)?
>>
>> Thank you again,
>>
>> Ben
>
> Ok, I'll try, though, please remember I'm not a programmer. My
> explanations may be not complete.
>
> I decided to develope the code in step by step manner.
> (You'll notice that in the end the code is changed a bit, compared
> with my previous post.)
>
> I) PROBLEM
> With { f\espressivo } the "espressivo"-sign (i.e. every small hairpin)
> should become longer, but not higher.
>
> II) possible SOLUTIONS
> a) create a new stencil
> b) scale the default-stencil in direction of X-axis
>
> III) THOUGHTS about II)
> Solution a) is doable. But will result in a higher coding effort.
> Solution b) is cheaper. It's disadvantage is that it will not print
> acceptable results in all cases.
> (Although you may not know this before you've tried :) )
> Result: choose solution b)
>
> IV) CODING
> i) If you want to manipulate the default-stencil you have to find/get it.
> Looking in the IR
> http://lilypond.org/doc/v2.17/Documentation/internals/script
> shows:
>   stencil (stencil):
>   ly:script-interface::print
>
> Let us test if it is correct.
> To be sure that I affect the correct grob, I often use colors. There
> is a predefined function, which does so:
> From IR
> http://lilypond.org/doc/v2.17/Documentation/internals/scheme-functions
>   Function: ly:stencil-in-color stc r g b
>   Put stc in a different color.
>
> This will result in:
>
> colorDefaultStencil =
> \once \override Script #'stencil =
>   ;; `lambda´ starts a procedure, it's argument is `grob´
>   #(lambda (grob)
>  ;; In `let´ local variables are defined.
>  (let ((stil (ly:script-interface::print grob)))
>  ;; The procedure returns the colored default-stencil:
>  (ly:stencil-in-color
>stil
>   1 0 0)))
>
>  { \colorDefaultStencil f''\espressivo }
>
> Fine, works.
>
> ii) Wanting to get a scaled stencil, we have to use
>   Function: ly:stencil-scale stil x y
>   Scale stil using the horizontal and vertical scaling factors x and y.
> from the same IR-chapter.
>
> Resulting in:
>
> scaleColorDefaultStencil =
> \once \override Script #'stencil =
>   #(lambda (grob)
>  (let ((stil (ly:script-interface::print grob)))
>  (ly:stencil-in-color
>(ly:stencil-scale
>  stil
>  ;; 1 is the neutrat element with ly:stencil-scale
>  ;; i.e. scaling with: 1 1 (for x- and y-axis) returns a not (visible)
>  ;; changed stencil.
>  2 1)
>   1 0 0)))
>
>  { \scaleColorDefaultStencil f''\espressivo }
>
> Well, apart from the color that seems to be the desired output.
>
> iii) Though, there are some problems.
>
> Look at:
>
>  { \scaleColorDefaultStencil _\espressivo ^\fermata }
>
> a) The fermata is scaled, too.
> b) Typing the command before and \espressivo after the note(s) is annoying.
>
> Solution for both: use tweak!
>
>  {
>  
>  -\tweak #'stencil
>  #(lambda (grob)
>   (let ((stil (ly:script-interface::print grob)))
>   (ly:stencil-in-color
> (ly:stencil-scale
>   stil
>   2 1)
>1 0 0)))
>  _\espressivo ^\fermata
>  }
>
> Does what we want, though, typing this isn't nice.
>
> Ok, let's define a variable and use it with the tweak.
>
> With some copy/paste we get:
>
> #(define longer-script  ;;[1]
>   (lambda (grob)
>   (let ((stil (ly:script-interface::print grob)))
>   (ly:stencil-in-color
> (ly:stencil-scale stil 2 1)
> 1 0 0
>
>  {
>  
>  -\tweak #'stencil #longer-script
>  _\espressivo ^\fermata
>  }
>
> Works fine, though the scaling values are hard-coded and there might
> be the possibility to avoid typing of
>-\tweak #'stencil #longer-script
>
> First, let's introduce some variables in `longer-script´ for scaling
> in x- and y-axis:
>
> #(define (longer-script x y)
>   (lambda (grob)
>   (let ((stil (ly:script-interface::print grob)))
>   (ly:stencil-in-color
> (ly:stencil-scale stil x y)
> 1 0 0
>
> Second, to reduce typing-effort we define an event-function:
>
> scaleScript =
> #(define-event-function (parser location x-val y-val)(number? number?)
> #{
> \tweak #'stencil #(longer-script x-val y-val)
> \espressivo
> #})
>
> { _\scaleScript #2 #1 ^\fermata }
>
> Works as expected, fine!
>
> 

Re: Help with espressivo adjustments

2013-04-13 Thread luis jure

on 2013-04-13 at 02:23 Thomas Morley wrote:

> Ok, I'll try, though, please remember I'm not a programmer. My
> explanations may be not complete.

excellent tutorial, thank you. i found it very instructive.


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


Re: Help with espressivo adjustments

2013-04-13 Thread Marc Hohl

Am 13.04.2013 14:09, schrieb luis jure:


on 2013-04-13 at 02:23 Thomas Morley wrote:


Ok, I'll try, though, please remember I'm not a programmer. My
explanations may be not complete.


excellent tutorial, thank you. i found it very instructive.


+1

Kudos!

Marc



___
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


how do I change enharmonic spellings produced by the /transpose function?

2013-04-13 Thread robert edge
I write music that is not strictly tonal, and years ago I adopted the
convention of always using the same enharmonic spellings.  So my chromatic
scale goes: c cis d ees e f fis g aes a bes b.  I never write something like
an A sharp or a G flat.

Of course Lilypond doesn't know about my silly ideas and \transpose gives me
all sorts of g sharps and d sharps in my tenor sax charts, for instance.

My current workflow is transposing the chart using \transpose, using the
\displayLilyMusic function, pasting the output back in to the source file
and then making the changes using search and replace in EMACS.  

I'd like to automate this process, I've got a lot of charts.  

Anyone have any ideas on how to do this, or where I can find some code that
does something similar I might be able to adapt?

thanks


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


Re: how do I change enharmonic spellings produced by the /transpose function?

2013-04-13 Thread Janek Warchoł
2013/4/13 robert edge :
> I write music that is not strictly tonal, and years ago I adopted the
> convention of always using the same enharmonic spellings.  So my chromatic
> scale goes: c cis d ees e f fis g aes a bes b.  I never write something like
> an A sharp or a G flat.
>
> Anyone have any ideas on how to do this, or where I can find some code that
> does something similar I might be able to adapt?

Here's a function doing a related thing ("naturalize pitches"), it may
be helpful:
http://lsr.dsi.unimi.it/LSR/Item?id=266

hth,
Janek

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


Re: how do I change enharmonic spellings produced by the /transpose function?

2013-04-13 Thread David Kastrup
robert edge  writes:

> I write music that is not strictly tonal, and years ago I adopted the
> convention of always using the same enharmonic spellings.  So my
> chromatic scale goes: c cis d ees e f fis g aes a bes b.  I never
> write something like an A sharp or a G flat.
>
> Of course Lilypond doesn't know about my silly ideas and \transpose
> gives me all sorts of g sharps and d sharps in my tenor sax charts,
> for instance.
>
> My current workflow is transposing the chart using \transpose, using
> the \displayLilyMusic function, pasting the output back in to the
> source file and then making the changes using search and replace in
> EMACS.
>
> I'd like to automate this process, I've got a lot of charts.  
>
> Anyone have any ideas on how to do this, or where I can find some code
> that does something similar I might be able to adapt?

How about the following:

myScale =
#(event-chord-pitches #{  #})

chromaScale =
#(define-music-function (parser location music) (ly:music?)
   (for-some-music
 (lambda (m)
   (and (ly:pitch? (ly:music-property m 'pitch))
(let* ((s (ly:pitch-semitones (ly:music-property m 'pitch)))
   (oct (floor (/ s 12)))
   (step (modulo s 12))
   (p (list-ref myScale step)))
  (set! (ly:music-property m 'pitch)
(ly:make-pitch oct
   (ly:pitch-notename p)
   (ly:pitch-alteration p
 #t))
 music)
  music)

\chromaScale \relative c' { c des es fes ceses }

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


Re: how do I change enharmonic spellings produced by the /transpose function?

2013-04-13 Thread robert edge
Thanks, works great!


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


warning in midi

2013-04-13 Thread MING TSANG
Hi, lily users:

I added crescendo to a song and I got the warning message. The PDF output 
correctly.  What can I do to eliminated the warning message.

Thanks for your help.
Ming

C:/Users/Gladys Tsang/Documents/My 
Dropbox/Lyndon/LiLy/this-is-the-day/this-is-the-day_transpose-AG_ED.ly:24:19: 
warning: (De)crescendo with unspecified starting volume in MIDI.
r2 \times 2/3{ a4
^\< d4 e4^\! } | fs2.^\f e8 d8 | e4.^- a,8 a2~^\> | a4^\! fs4^\mf b4 b4 | \bk   
% 17-20 ___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: warning in midi

2013-04-13 Thread Eluze
MING TSANG wrote
> I added crescendo to a song and I got the warning message. The PDF output
> correctly.  What can I do to eliminated the warning message.
> 
> 
> C:/Users/Gladys Tsang/Documents/My
> Dropbox/Lyndon/LiLy/this-is-the-day/this-is-the-day_transpose-AG_ED.ly:24:19:
> warning: (De)crescendo with unspecified starting volume in MIDI.
> r2 \times 2/3{ a4
> ^\< d4 e4^\! } | fs2.^\f e8 d8 | e4.^- a,8 a2~^\> | a4^\! fs4^\mf b4 b4 |
> \bk   % 17-20 

please post the full code which compiles and shows the error/warning
also add the version you are using!

Eluze



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/warning-in-midi-tp144400p144402.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: warning in midi

2013-04-13 Thread MING TSANG
MING TSANG wrote
>I added crescendo to a song and I got the warning message. The PDF output 
>>correctly.  What can I do to eliminated the warning message. > > 
>>C:/Users/Gladys Tsang/Documents/My 
>>Dropbox/Lyndon/LiLy/this-is-the-day/this-is-the-day_transpose-AG_ED.ly:24:19: 
>>warning: (De)crescendo with unspecified starting volume in MIDI. >r2 \times 
>2/3{ a4 >^\< d4 e4^\! } | fs2.^\f e8 d8 | e4.^- a,8 a2~^\> | a4^\! fs4^\mf b4 
>b4 | >\bk   % 17-20  please post the full code which compiles and shows the 
>error/warning
also add the version you are using! Eluze

Hi, Eluze:  

Here is the full code. The error log is copy below.

Thanks,
Ming.

Starting lilypond.exe 2.16.2 [this-is-the-day_transpose-AG_ED.ly]...
Processing `C:/Users/Gladys Tsang/Documents/My 
Dropbox/Lyndon/LiLy/this-is-the-day/this-is-the-day_transpose-AG_ED.ly'
Parsing...
Interpreting music...[8][16]
Preprocessing graphical objects...
Interpreting music...
C:/Users/Gladys Tsang/Documents/My 
Dropbox/Lyndon/LiLy/this-is-the-day/this-is-the-day_transpose-AG_ED.ly:62:20: 
warning: (De)crescendo with unspecified starting volume in MIDI.
r2 \times 2/3 {fs4
_\< a4 fs4_\!} | a2_\f( b4) b8 b8 | b4._- cs8 cs2_\>~ | cs4_\! a4_\mf fs4 fs4 | 
% 17-20
MIDI output to `this-is-the-day_transpose-AG_ED.mid'...
Finding the ideal number of pages...
Fitting music on 1 or 2 pages...
Drawing systems...
Layout output to `this-is-the-day_transpose-AG_ED.ps'...
Converting to `./this-is-the-day_transpose-AG_ED.pdf'...
Success: compilation successfully completed
Completed successfully in 41.7".\version "2.16.2" 
\language "english"
\include "include_lyndon-specific.ly"
ti="This is the Day"  %title
  st = "Psalm "   %subtitle
  sst = ""
  sy=0   \include "include_paper-header-footer-filename-footnote.ly" 
\header {}
#(set-global-staff-size 18.0)   %default 25
global = {
  \key a \major
  \numericTimeSignature
  \time 2/2
   \tempo "Brightly " 2=60 
}

soprano =  \relative c' { 
  \global
  \override Score.BarNumber #'stencil = #(make-stencil-circler 0.1 0.25 ly:text-interface::print)
  r1 r1 r1 r1 |\bk
  cs2\mf e4. a8 | d,1 | r4 cs4 e4 a8 a8 | b4. cs8 e,2 |\bk		% 05-08
  r2 \times 2/3{ e4 a4 b4 } | d2. cs8 a8 | b4. fs8 fs2 | r1 |\bk 	% 09-12
  cs2\mf e4. a8 | d,1 | r4 cs4 e4 a8 a8 | \times 2/3{ d4 cs4 b4~ } b4. r8 |\bk 	% 13-16
  r2 \times 2/3{ a4^\< d4 e4^\! } | fs2.^\f e8 d8 | e4.^- a,8 a2~^\> | a4^\! fs4^\mf b4 b4 | \bk 	% 17-20
  %\transpose e d 
  \key e\major b1 | r1  | %\time 3/2 r2 r2 r2|\bk		% 21-23
  %r1 r2 | \time 2/2 r1 |\bk 	% 24-25
  %r1  | \time 3/4 r2. |\bk 	% 26-28
  %\time 3/2 gs4. fs \time 3/2 gs4 b4 a2 | \time 2/2 gs4. fs8 gs4 b4 | \time 3/2 ds4. e8 cs2 b4 a4 |\bk		% 29-31
  \label #'lastPage 
}

alto =  \relative c' {
  \global
  s1 s1 s1 s1		% 01-04
  s1 s1 s1 s1		% 05-08
  s1 s1 s1 s1		% 09-12
  cs2 e4. a8 | d,1 | r4 cs4 e4 a8 a8 | \times 2/3{ g!4 g4 g4~ } g4. r8 |		% 13-16
  r2 \times 2/3  {a4 fs4 a4}  | fs2( gs?4) gs8 gs8 | gs4._- e8 e2~ | e4 e4 e4 ds4 |	% 17-20 
  \key e\major e1 | r1 |	% 21-22
}

tenor =  \relative c { 
  \global
  r1 r1 r1 r1 |		% 01-04
  r1 r1 r1 r1 |		% 05-08
  r1 r1 r1 r1 |		% 09-12
  cs2 e4. a8 | d,1 | r4 cs4 e4 a8 a8 | \times 2/3{ b4 cs4 d4~ } d4. r8 | 	% 13-16
  r2 \times 2/3{ d4 d4 d4 } | d2. d8 d8 | cs4.^- cs8 cs2~ | cs4 cs4 gs4 a4 |		% 17-20
  %\transpose e d
  \key e\major   gs1 | r2 r4 fs4 | %\time 3/2 gs4. fs8 gs4 b4 a2 |	% 21- 23  
  %e4. ds8 e4 gs4 b2 | \time 2/2 e,4. ds8 e4 gs4 |\bk	% 24-25
  %\times 2/3{ ds'4 cs4 b4 } cs2 | a4. gs8 a4 cs4 | \times 3/4 a2 r4 | 		% 26-28
}

bass =  \relative c {
  \global
  s1 s1 s1 s1 	% 01-04
  s1 s1 s1 s1 	% 05-08
  s1 s1 s1 s1 	% 09-12
  cs2 e4. a8 | d,1 | r4 cs4 e4 a8 a8 | \times 2/3 {a4 a4 a4~} a4. r8 | 		% 13-16
  r2 \times 2/3 {fs4_\< a4 fs4_\!} | a2_\f( b4) b8 b8 | b4._- cs8 cs2_\>~ | cs4_\! a4_\mf fs4 fs4 |	% 17-20
  \key e\major e1 | r2 r4 fs4 | 	% 21-22
}

verse = \lyricmode { 
  This is the day. the day which the Lord hath made 
  we will re -- joice and be glad in it.
  This is the day, the day which the  Lord hath made;
  we will re -- joice and be glad in it. this is the 
  day 
  
  Praise him sun and moon; praise him, all ye stars and light,  let them
  praise the Name of the Lord; For
  he shall give his an -- gels charge o -- ver thee;
}
verseTenor = \lyricmode {
 % O praise the Lord of heav'n
 % praise  him in the height. Praise him, all ye
 % an -- gels of his; praise him, all his host.
}

%{
rehearsalMidi = #
(define-music-function
 (parser location name midiInstrument lyrics) (string? string? ly:music?)
 #{
   \unfoldRepeats <<
 \new Staff = "soprano" \new Voice = "soprano" { s1*0\f \soprano }
 \new Staff = "alto" \new Voice = "alto" { s1*0\f \alto }
 \new Staff = "tenor" \new Voice = "tenor" { s1*0\f \tenor }
 \new Staff = "bass" \new Voice = "bass" { s1*0\f \bass }
 \context Staff = $name {
   \set Score.midiMinimumVolume = #0.5
   \set Score.midiMaximumVolume = #0.5
   \set Score.tempoWholesPerMinute

sustain pedals way below staff

2013-04-13 Thread Derek
Hi I was wondering if anyone had a clue for fixing this. I have a vocal piano
score with the sustain pedal in its own group pedal ={} and I am getting
this crazy issue.
  Is this just
lilypond fitting the staves to the page as best as it sees fit or is there
anyway i can cram it up closer to the notes?
thanks



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/sustain-pedals-way-below-staff-tp144406.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: sustain pedals way below staff

2013-04-13 Thread Derek
Nevermind i think I sorted it wiht \override VerticalAxisGroup etc etc



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/sustain-pedals-way-below-staff-tp144406p144407.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: sustain pedals way below staff

2013-04-13 Thread David Kastrup
Derek  writes:

> Hi I was wondering if anyone had a clue for fixing this. I have a
> vocal piano
> score with the sustain pedal in its own group pedal ={} and I am getting
> this crazy issue.
>   Is this just
> lilypond fitting the staves to the page as best as it sees fit or is there
> anyway i can cram it up closer to the notes?

Looks like you are doing something wrong.  But then it's hard to tell
with the amount of information you are volunteering.

-- 
David Kastrup


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


Re: sustain pedals way below staff

2013-04-13 Thread Derek
Sorry the score is just too complicated to post an example piano with tenor
and baritone. As the piano score has a lot of double voice type stuff {}//{}
I couldn't seem to get the sustain pedal to behave so I put it in its own
voice. Sorry if my terminology is off here. I used the vertical thingy I
posted above and it moved the pedal sustain on and off stmbols right up to
the notes so it is sorted. I don't know if it is a legitimate use of the
code but it sorted the problem. 



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/sustain-pedals-way-below-staff-tp144406p144410.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