Re: Double clef (canon)

2014-10-11 Thread Thomas Morley
Hi Andrea,

2014-10-11 6:18 GMT+02:00 Jayaratna :
> Hello Harm,
>
> I am going to hack your code further to adapt it to my usual mensural
> layout. But it works. I need time to understand everything you've made but
> definitely thank you. As far as I got it, you defined a commando for adding
> a clef next to the original, and another one to add the cleff after the
> breve rest.

Yep

> Reading your comments I have to say that still the layout of mensural music
> is quite poor. I usually increase the notehead sizes, but breves and longae
> become too big. I also increase the stem thickness. I don't feel spacing to
> be too bad, though, but I neved had to type scores, luckily, just parts.

I think fewer people are using ancient Notation styles.
As a natural consequence issues will be reported less often or stay undetected.
I'd be interested in your personal setup for writing mensural music.
Could you post your usual overrides/layout and an example?
Maybe we can improve LilyPonds capabilities in this area.
(I'll be completely offline this weekend, though)

> By the way this canon is by Thomas Morley, which feels funny regarding your
> nickname.

:D
Well I'm very bad in finding alias-names. At the time this name was
needed to create I had to deal with music from Thomas Morley.
So I thought, why not? At least he is less well known than others...

> Thank you so much,
> Andrea

Glad I could help.

Cheers,
  Harm

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


Re: Double clef (canon)

2014-10-11 Thread Pierre Perol-Schneider
Hi Harm, hi Andrea,

2014-10-10 22:45 GMT+02:00 Thomas Morley :


>
>   %% in MensuralStaff the BarLines are made transparent,
>   %% causing some unequal spacing, though even omitting the
>   %% stencil does not work sufficient.
>   %% No clue to workaround atm
>   \omit BarLine
>

 How about \remove "Bar_engraver" instead of \omit BarLine ?

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


Re: \lyricsto and \tag problems

2014-10-11 Thread David Kastrup
Noeck  writes:

> Hi,
>
> this is the usual way I write a song (melody with lyrics):
>
> \version "2.18.2"
>
> <<
>   \new Staff \new Voice = sop { c' d' e' f' }
>   \new Lyrics \lyricsto sop \keepWithTag "A" \lyricmode {
> An \tag "A" example \tag "B" text
>   }
>>>
>
> (The melody is usually a variable and the \lyricmode { … }, too.)
>
> It compiles nicely with LP 2.18.2.

More by accident than anything else.  \lyricsto is a
\lyricmode-introducing command and so it needs to be followed by some
music enclosed with matched braces.

What happens if it isn't?  Take a look at the output from the following
minimal addition (2.16 syntax because I don't have 2.18 available
currently):

\version "2.16.2"

\displayMusic <<
  \new Staff \new Voice = sop { c' d' e' f' }
  \new Lyrics \lyricsto sop \keepWithTag #'A \lyricmode {
An \tag #'A example \tag #'B text
  } g a
>>

In the graphical output, the "g" is conspicuously absent.  Looking at
the console output, it becomes clear that this because it occurs in a
Voice context but ends up being a lyric event: since the parser was not
able to work with matched braces concerning the argument of \lyricsto,
it reverted to using lookahead while still being in \lyricmode.  Once it
considered g while being in lyricmode, the characterization stuck.

This is not really something convert-ly can hope to fix since it would
have the same problem of figuring out just where an argument _not_
enclosed by braces is supposed to end.

So this never worked reliably before.  And that could not really be
fixed.  So instead, LilyPond treats \lyricsto exactly like other
mode-changing commands.

Changing some construct from "worked most of the time as expected" to
"refuses to work" does not look like an improvement.  At least, people
are more likely to remember that \lyricsto by itself is invoking
\lyricmode and save typing in that manner.  Your use case could be
rewritten as

\new Lyrics \keepWithTag A \lyricsto sop { an \tag A example \tag B text }

which is shorted than before but uses a different order of elements.

-- 
David Kastrup


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


Re: How does map-some-music work?

2014-10-11 Thread David Kastrup
Jay Vara  writes:

> I am trying to display all the names that appear in a piece of music 
> (NoteEvent etc.) using map-some-music. It the function musShow is only 
> printing the top level name. What am I missing here?
>
> 
> \version "2.18.2"
> #(define (showMus music) (display-scheme-music (ly:music-property music 
> 'name "Not Defined")))
>
> musShow = #(define-music-function (parser location myx ) (ly:music?)
> (map-some-music
>  (lambda (evt)  (showMus evt )) myx)
> #{ #})
>
>
> music =  {c ~ c}
>
>
> \musShow #music
> %%%

The return value of map-some-music is interpreted.  Anything but #f
stops recursion.  A music expression replaces the original.  Since you
don't want to change the original music, you probably rather want
for-some-music, and then you'll still need to supply a return value
indicating whether you want to recurse or not.

-- 
David Kastrup


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


Re: ly:pitch and string

2014-10-11 Thread David Kastrup
Simon Albrecht  writes:

> Hello,
>
> consider the following setup:
> %%
> \version "2.19.12"
>
> newTonic = d
>
> newTonicString = "d"
>
> \bookOutputSuffix #(string-append "in-" newTonicString)
>
> \score { \transpose c \newTonic { c' } }
>
> %%
>
> For easy handling of different transpositions the ‘destination pitch’
> is stored in a variable. It is of type ly:pitch?.
> At the same time, I want to flag the output file with the key to which
> the music has been transposed, and for this I need the destination
> pitch notename as a string.
> I’d like to avoid having to synchronise newTonic and newTonicString
> manually, but I’ve been unable to find a convenient way to convert one
> into the other. Can anybody help?

(use-modules (scm display-lily))
newTonicString = #(value->lily-string newTonic parser)

Note that the conversion requires the availability of "parser" since it
depends on the current value of the note name language.

-- 
David Kastrup


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


Re: Automatic ottava handling

2014-10-11 Thread David Nalesnik
Hi,

On Wed, Oct 8, 2014 at 9:48 AM, David Bellows  wrote:

> >Here's a preliminary experiment.  It will add an automatic \ottava 1
> before passages where notes have at least a specified number of ledger
> lines.
>
>
The attached function will work with more complex music expressions.

The only problem here is with the handling of chords.  Right now, the
function either ignores them or attempts to add the ottava within the
EventChord expression (which causes an error).  This shouldn't be too hard
to fix, though it will take some thought.

Hope this proves useful!

David
\version "2.19.10"

#(define (ledger-line-no middle-C-pos p)
   "Returns the number of ledger-lines a pitch @var{p} will have with
middle C position @var{middle-C-pos} expressed as staff-steps from the
middle staff line."
   (let* ((ps (ly:pitch-steps p))
  (mid-staff-steps (- middle-C-pos))
  (top-line (+ mid-staff-steps 4))
  (bottom-line (- mid-staff-steps 4))
  (above? (> ps top-line))
  (below? (< ps bottom-line))
  (steps-outside-staff
   (cond
(below? (- ps bottom-line))
(above? (- ps top-line))
(else 0
 (truncate (/ steps-outside-staff 2


octavate =
#(define-music-function (parser location threshold mus)
   (integer? ly:music?)
   "Create an ottava for notes which have at least @var{threshold} ledger lines"
   (let ((e (ly:music-property mus 'element))
 (elts (ly:music-property mus 'elements)))
 
 (define (build-new-elts mus-expr new-expr start-loco? start-ottava?)
   (if (null? mus-expr)
   ;; ensure that ottava does not extend past a localized
   ;; use of \octavate
   (append new-expr
 (list (make-music 'OttavaMusic 'ottava-number 0)))
   (let ((p (ly:music-property (car mus-expr) 'pitch)))
 (cond
  ((not (ly:pitch? p))
   (build-new-elts
(cdr mus-expr)
(append new-expr (list (car mus-expr)))
#t #t))
  ((and (ly:pitch? p)
start-ottava?
(>= (ledger-line-no -6 p) threshold))
   (build-new-elts
(cdr mus-expr)
(append
 new-expr
 (list (make-music 'OttavaMusic 'ottava-number 1))
 (list (car mus-expr)))
#t #f))
  ((and (ly:pitch? p)
start-loco?
(< (ledger-line-no -6 p) threshold))
   (build-new-elts
(cdr mus-expr)
(append
 new-expr
 (list (make-music 'OttavaMusic 'ottava-number 0))
 (list (car mus-expr)))
#f #t))
  (else 
   (build-new-elts
(cdr mus-expr)
(append new-expr (list (car mus-expr)))
#t #t))
 
 (define (recurse music)
   (let ((elts (ly:music-property music 'elements))
 (e (ly:music-property music 'element)))
 (if (ly:music? e)
 (recurse e))
 (if (pair? elts)
 (if (any (lambda (elt) (music-is-of-type? elt 'note-event)) elts)
 (set! (ly:music-property music 'elements)
   (build-new-elts elts '() #t #t))
 (map recurse elts)
 
 (recurse mus)
 
 mus))

%%% EXAMPLE 

music = \relative c''' {
  \repeat volta 2 {
a8 b c d e f g a
  }
}

musictwo = \new PianoStaff <<
  \new Staff { \music R1 }
  \new Staff { \unfoldRepeats \transpose c e { \music } }
>>

{
  \octavate #5 \music
  \octavate #4 \music
  \octavate #3 \music
  \octavate #2 \music
}

{
  \octavate #3 \musictwo
}___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Guide to set up Lilypond mode for Emacs on OS X

2014-10-11 Thread Antonio Gervasoni
Dear Lilypond users:

I have written a guide on how to set up the Lilypond mode for Emacs on OS
X. For this, I have created two posts on my blog. If anyone needs this
information, here are the links:

Setting Up Lilypond & Emacs on OS X for Visually Impaired Musicians - Part I

Setting Up Lilypond & Emacs on OS X for Visually Impaired Musicians - Part
II 

I'd only like to add that this wouldn't have been possible without the help
of Hwaen Ch'uqi and Jacques Menu.

I hope other users might find this guide useful.

Best regards,

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


relative music inside music functions explodes when used twice

2014-10-11 Thread Janek Warchoł
Hi,

i have a function that takes music as an argument and uses it twice - each
time with a different tag appended, so that later on i can decide what to
output:

voiceDivisi =
#(define-music-function (parser location m1 m2) (ly:music? ly:music?)
   #{
 \tag divI \context Voice = "divI" { #m1 }
 \tag divII \context Voice = "divII" { #m2 }
 \tag together \context Voice = "both" << #m1 #m2 >>
   #})

The problem is that when used with relative mode, the output gets crazy:

music = \relative c' {
  \voiceDivisi {
c4 d e f
  }
  {
e4 f g a
  }
}

\new Staff \keepWithTag divI \music
\new Staff \keepWithTag divII \music
\new Staff \keepWithTag together \music

(see attachment)

I have checked that the problem disappears when the function uses the
arguments (m1 and m2) only once.  Is this a bug?  Can i work around it, or
maybe i should be doing this in an altogether different way?

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


Re: ly:pitch and string

2014-10-11 Thread Simon Albrecht

Hello David,

thanks, that’s exactly the kind of brief and elegant solution I was 
hoping for.


Yours,
Simon

Am 11.10.2014 um 16:52 schrieb David Kastrup:

Simon Albrecht  writes:


Hello,

consider the following setup:
%%
\version "2.19.12"

newTonic = d

newTonicString = "d"

\bookOutputSuffix #(string-append "in-" newTonicString)

\score { \transpose c \newTonic { c' } }

%%

For easy handling of different transpositions the ‘destination pitch’
is stored in a variable. It is of type ly:pitch?.
At the same time, I want to flag the output file with the key to which
the music has been transposed, and for this I need the destination
pitch notename as a string.
I’d like to avoid having to synchronise newTonic and newTonicString
manually, but I’ve been unable to find a convenient way to convert one
into the other. Can anybody help?

(use-modules (scm display-lily))
newTonicString = #(value->lily-string newTonic parser)

Note that the conversion requires the availability of "parser" since it
depends on the current value of the note name language.




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


Re: relative music inside music functions explodes when used twice

2014-10-11 Thread Paul Morris
Janek Warchoł wrote
> The problem is that when used with relative mode, the output gets crazy:

Hi Janek, you just need to use $m1 instead of #m1 in your function.
http://lilypond.org/doc/v2.18/Documentation/extending/scheme-function-definitions
HTH,
-Paul

\version "2.18.2"

voiceDivisi =
#(define-music-function (parser location m1 m2) (ly:music? ly:music?)
   #{
 \tag divI \context Voice = "divI" { $m1 }
 \tag divII \context Voice = "divII" { $m2 }
 \tag together \context Voice = "both" << $m1 $m2 >>
   #})

% The problem is that when used with relative mode, the output gets crazy:

music = \relative c' {
  \voiceDivisi {
c4 d e f
  }
  {
e4 f g a
  }
}

\new Staff \keepWithTag divI \music
\new Staff \keepWithTag divII \music
\new Staff \keepWithTag together \music



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/relative-music-inside-music-functions-explodes-when-used-twice-tp167420p167422.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: relative music inside music functions explodes when used twice

2014-10-11 Thread David Kastrup
Janek Warchoł  writes:

> Hi,
>
> i have a function that takes music as an argument and uses it twice - each
> time with a different tag appended, so that later on i can decide what to
> output:
>
> voiceDivisi =
> #(define-music-function (parser location m1 m2) (ly:music? ly:music?)
>#{
>  \tag divI \context Voice = "divI" { #m1 }
>  \tag divII \context Voice = "divII" { #m2 }
>  \tag together \context Voice = "both" << #m1 #m2 >>
>#})
>
> The problem is that when used with relative mode, the output gets crazy:
>
> music = \relative c' {
>   \voiceDivisi {
> c4 d e f
>   }
>   {
> e4 f g a
>   }
> }
>
> \new Staff \keepWithTag divI \music
> \new Staff \keepWithTag divII \music
> \new Staff \keepWithTag together \music
>
> (see attachment)
>
> I have checked that the problem disappears when the function uses the
> arguments (m1 and m2) only once.  Is this a bug?

No.

http://www.lilypond.org/doc/v2.19/Documentation/extending/adding-articulation-to-notes-_0028example_0029>

In an earlier example, we constructed music by repeating a given
music argument. In that case, at least one repetition had to be a
copy of its own. If it weren’t, strange things may happen. For
example, if you use \relative or \transpose on the resulting music
containing the same elements multiple times, those will be subjected
to relativation or transposition multiple times. If you assign them
to a music variable, the curse is broken since referencing ‘\name’
will again create a copy which does not retain the identity of the
repeated elements.

> Can i work around it, or maybe i should be doing this in an altogether
> different way?

Use ly:music-deep-copy on one of the copies.  Better both.  Or write $x
instead of #x in order to get such a copy.

-- 
David Kastrup


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


Re: ly:pitch and string

2014-10-11 Thread Paul Morris
Simon Albrecht-2 wrote
> well, now I did try and make a function for german note names, which 
> discerns major and minor also. Actually it works – the transposition is 
> applied correctly and there are no unexpected messages – but at testing 
> there seemed to be a memory problem: from some point onwards, the 
> newTonicString was always "eses" regardless of the input. Perhaps the 
> computer and I ought to go to sleep. (what a mad sentence that is…)
> And thanks again for your input, Paul.

Hi Simon, I see David has showed a better way.  In the meantime, with a few
edits, I got your function working, so just for good measure, here it is.
Cheers,
-Paul

%%
\version "2.19.12"
\language "deutsch"

pitch-to-key-string-german =
#(define-scheme-function
  (parser location p mode)
  (ly:pitch? string?)
  (let*
   ((major? (equal? mode "major"))
(nn (ly:pitch-notename p))
(nn-string (if major?
   (list-ref '("C" "D" "E" "F" "G" "A" "H") nn)
   (list-ref '("c" "d" "e" "f" "g" "a" "h") nn)))
(alt (ly:pitch-alteration p))
(alt-num (+ 2 (* 2 (ly:pitch-alteration p
(alt-string (list-ref '("eses" "es" "" "is" "isis") alt-num))
;pitch without octave
(na (cons nn alt))
;helper functions for exceptions in german note naming
(test (lambda (n a) (equal? na (cons n a
(exc (lambda (ma mi) (if major? ma mi

   (string-append nn-string
 (cond
  ((test 2 -1) (exc "Eses" "eses"))
  ((test 2 -1/2) (exc "Es" "es"))
  ((test 5 -1) (exc "Asas" "asas"))
  ((test 5 -1/2) (exc "As" "as"))
  ((test 6 -1/2) (exc "B" "b"))
  (else alt-string)

newTonic = disis'

newTonicString = \pitch-to-key-string-german \newTonic "major"

% for testing:
#(display (string-append "in-" newTonicString))

\bookOutputSuffix #(string-append "in-" newTonicString)

\score { \transpose c \newTonic { c' } }

%%



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/ly-pitch-and-string-tp167397p167425.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: Automatic ottava handling

2014-10-11 Thread David Bellows
>The attached function will work with more complex music expressions.

Nicely done! I really like the greater flexibility achieved based on using
ledger lines. Fortunately in this project I don't use chords so that's not
a problem, less fortunately is that I need it for the bassa as well. But I
will look over the code and see if I can't figure it out for myself.

Thanks!

On Sat, Oct 11, 2014 at 7:57 AM, David Nalesnik 
wrote:

> Hi,
>
> On Wed, Oct 8, 2014 at 9:48 AM, David Bellows 
> wrote:
>
>> >Here's a preliminary experiment.  It will add an automatic \ottava 1
>> before passages where notes have at least a specified number of ledger
>> lines.
>>
>>
> The attached function will work with more complex music expressions.
>
> The only problem here is with the handling of chords.  Right now, the
> function either ignores them or attempts to add the ottava within the
> EventChord expression (which causes an error).  This shouldn't be too hard
> to fix, though it will take some thought.
>
> Hope this proves useful!
>
> David
>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Automatic ottava handling

2014-10-11 Thread David Nalesnik
Hi David,

On Sat, Oct 11, 2014 at 4:45 PM, David Bellows 
wrote:

> >The attached function will work with more complex music expressions.
>
> Nicely done! I really like the greater flexibility achieved based on using
> ledger lines. Fortunately in this project I don't use chords so that's not
> a problem
>
>
Well, in any case the attached now works with chords :)

The rule is that an ottava is only applied if all of the notes within the
chord have at least a certain number of ledger lines.

I'm thinking there ought to be some sort of resistance-to-change factor
which overrules the strict this-many-ledger-lines-gets-an-ottava rule.
Otherwise, if you hop between chords and single notes, you can get more
ottavas than is comfortable to read.

The code for build-new-elts needs to be refactored a bit.

less fortunately is that I need it for the bassa as well. But I will look
> over the code and see if I can't figure it out for myself.
>

Yes, you could insert an expression into build-new-elts which would look at
the number of ledger lines and insert a (list (makeMusic 'OttavaMusic
'ottava-number -1)) to create the 8va bassa.  Of course, you'd need one to
shut it off with (list (makeMusic 'OttavaMusic 'ottava-number 0)).

This will all be better once this thing has the ability to detect the
current clef.  It looks like that's possible, because calling \clef ...
adds a 'PropertySet event to the mix, and 'clefMiddleCPosition (which the
ledger-line counter is designed to work with) is available.

Detecting the clef would be useful for 8va bassa, because it's never used
with treble clef (as I remember from Gardner Read).

Anyway, hope this is helpful.

--David

P.S.  It's now \ottavate instead of \octavate
\version "2.19.10"

\header {
  tagline = ##f
}

#(define (ledger-line-no middle-C-pos p)
   "Returns the number of ledger-lines a pitch @var{p} will have with
middle C position @var{middle-C-pos} expressed as staff-steps from the
middle staff line."
   (let* ((ps (ly:pitch-steps p))
  (mid-staff-steps (- middle-C-pos))
  (top-line (+ mid-staff-steps 4))
  (bottom-line (- mid-staff-steps 4))
  (above? (> ps top-line))
  (below? (< ps bottom-line))
  (steps-outside-staff
   (cond
(below? (- ps bottom-line))
(above? (- ps top-line))
(else 0
 (truncate (/ steps-outside-staff 2


ottavate =
#(define-music-function (parser location threshold mus)
   (integer? ly:music?)
   "Create an ottava for notes which have at least @var{threshold} ledger lines"
   (let ((up-an-octave (list (make-music 'OttavaMusic 'ottava-number 1)))
 (loco (list (make-music 'OttavaMusic 'ottava-number 0
 
 (define (build-new-elts mus-expr new-expr start-loco? start-ottava?)
   (if (null? mus-expr)
   ;; ensure that ottava does not extend past a localized
   ;; use of \octavate
   (append new-expr loco)
  
   (cond
((music-is-of-type? (car mus-expr) 'event-chord)
 (cond
  ((and
start-ottava?
(every (lambda (p)
 (>= (ledger-line-no -6 (ly:music-property p 'pitch)) threshold))
  (ly:music-property (car mus-expr) 'elements)))
   (build-new-elts
(cdr mus-expr)
(append
 new-expr
 up-an-octave
 (list (car mus-expr)))
#t #f))
  ((and 
start-loco?
(any (lambda (p)
   (< (ledger-line-no -6 (ly:music-property p 'pitch)) threshold))
  (ly:music-property (car mus-expr) 'elements)))
   (build-new-elts
(cdr mus-expr)
(append
 new-expr
 loco
 (list (car mus-expr)))
#f #t))
  (else (build-new-elts
 (cdr mus-expr)
 (append new-expr (list (car mus-expr)))
 #t #t

((music-is-of-type? (car mus-expr) 'note-event)
 (let ((p (ly:music-property (car mus-expr) 'pitch)))
   (cond
((and (ly:pitch? p)
  start-ottava?
  (>= (ledger-line-no -6 p) threshold))
 (build-new-elts
  (cdr mus-expr)
  (append
   new-expr
   up-an-octave
   (list (car mus-expr)))
  #t #f))
((and (ly:pitch? p)
  start-loco?
  (< (ledger-line-no -6 p) threshold))
 (build-new-elts
  (cdr mus-expr)
  (append
   new-expr
   loco
   (list (car mus-expr)))
  #f #t))
(else
 

Re: Automatic ottava handling

2014-10-11 Thread David Nalesnik
On Sat, Oct 11, 2014 at 5:38 PM, David Nalesnik
>
>
> This will all be better once this thing has the ability to detect the
> current clef.  It looks like that's possible, because calling \clef ...
> adds a 'PropertySet event to the mix, and 'clefMiddleCPosition (which the
> ledger-line counter is designed to work with) is available.
>
>
OK, we've got clefs!

I'll look into fixing up build-new-elts so there won't be so much
duplication of code.  Then it will be a lot cleaner to deals with bassas,
I'm too tired to even think about that now.

Best,
David
\version "2.19.10"

\header {
  tagline = ##f
}

#(define (ledger-line-no middle-C-pos p)
   "Returns the number of ledger-lines a pitch @var{p} will have with
middle C position @var{middle-C-pos} expressed as staff-steps from the
middle staff line."
   (let* ((ps (ly:pitch-steps p))
  (mid-staff-steps (- middle-C-pos))
  (top-line (+ mid-staff-steps 4))
  (bottom-line (- mid-staff-steps 4))
  (above? (> ps top-line))
  (below? (< ps bottom-line))
  (steps-outside-staff
   (cond
(below? (- ps bottom-line))
(above? (- ps top-line))
(else 0
 (truncate (/ steps-outside-staff 2

#(define (find-clefMiddleCPosition mus)
   (let ((clef-pos -6)) ; treble is default
 (for-some-music
  (lambda (x)
(let ((n (ly:music-property x 'symbol)))
  (and (eq? n 'middleCClefPosition)
   (set! clef-pos (ly:music-property x 'value)
  mus)
 clef-pos))

ottavate =
#(define-music-function (parser location threshold mus)
   (integer? ly:music?)
   "Create an ottava for notes which have at least @var{threshold} ledger lines"
   (let ((up-an-octave (list (make-music 'OttavaMusic 'ottava-number 1)))
 (loco (list (make-music 'OttavaMusic 'ottava-number 0
 
 (define (build-new-elts mus-expr new-expr start-loco? start-ottava? clef-pos)
   (if (null? mus-expr)
   ;; ensure that ottava does not extend past a localized
   ;; use of \ottavate
   (append new-expr loco)
   
   (begin
;; find value for 'clefMiddleCPosition
(if (eq? (ly:music-property (car mus-expr) 'name) 'ContextSpeccedMusic)
(set! clef-pos (find-clefMiddleCPosition (car mus-expr

(cond
 ((music-is-of-type? (car mus-expr) 'event-chord)
  (cond
   ((and
 start-ottava?
 (every (lambda (p)
  (>= (ledger-line-no clef-pos (ly:music-property p 'pitch)) threshold))
   (ly:music-property (car mus-expr) 'elements)))
(build-new-elts
 (cdr mus-expr)
 (append
  new-expr
  up-an-octave
  (list (car mus-expr)))
 #t #f clef-pos))
   ((and 
 start-loco?
 (any (lambda (p)
(< (ledger-line-no clef-pos (ly:music-property p 'pitch)) threshold))
   (ly:music-property (car mus-expr) 'elements)))
(build-new-elts
 (cdr mus-expr)
 (append
  new-expr
  loco
  (list (car mus-expr)))
 #f #t clef-pos))
   (else (build-new-elts
  (cdr mus-expr)
  (append new-expr (list (car mus-expr)))
  #t #t clef-pos

 ((music-is-of-type? (car mus-expr) 'note-event)
  (let ((p (ly:music-property (car mus-expr) 'pitch)))
(cond
 ((and (ly:pitch? p)
   start-ottava?
   (>= (ledger-line-no clef-pos p) threshold))
  (build-new-elts
   (cdr mus-expr)
   (append
new-expr
up-an-octave
(list (car mus-expr)))
   #t #f clef-pos))
 ((and (ly:pitch? p)
   start-loco?
   (< (ledger-line-no clef-pos p) threshold))
  (build-new-elts
   (cdr mus-expr)
   (append
new-expr
loco
(list (car mus-expr)))
   #f #t clef-pos))
 (else
  (build-new-elts
   (cdr mus-expr)
   (append new-expr (list (car mus-expr)))
   #t #t clef-pos)

 (else 
  (build-new-elts
   (cdr mus-expr)
   (append new-expr (list (car mus-expr)))
   #t #t clef-pos))
   
 (define (recurse music)
   (let ((elts (ly:music-property music 'elements))
 (e (ly:music-property music 'element)))
   

recorder diagram and some woodwind-diagram bugs

2014-10-11 Thread erik flister
hi there-
sorry for cross posting to all the lists, i'd rather not subscribe and
this post seems to apply to all three.

attached is a recorder diagram patch, would love for feedback and for
it to be incorporated.  hopefully it's ok it's not actually in patch
format, it just drops into display-woodwind-diagrams.scm (of course a
corresponding entry needs to be added to
woodwind-data-assembly-instructions in that file as well).

my biggest problems:

- 1h (half-covered) works for eg 'flute two', but on my recorder thumb
(T) it doesn't work -- it just shows fully covered.

- why are partial covers shown as shaded, then there is no distinction
w/trills (ie 1h and 1hT are identical)?

i don't know scheme, so i was mainly pattern-matching from existing
diagrams.  some issues i had while trying to figure this out:

- what is the purpose of the baked-in cc/lh/rh grouping?

- i can't find doc for draw-instructions rules -- seems to determine
whether keys are hidden unless specified -- i didn't want that
behavior, but was stuck unexpectedly getting it for a while.

- difference between identity and return-1 -- they sound identical to
me (when xy-scaling), but gave different results.

- the style used encourages a lot of duplicated code -- it needs to be
refactored so that keys are defined as simple declarative structures
(with properties like name, group, position, complexity, stencil,
textual-representation) and graphical/textual-commands derived
therefrom.

- similarly, key positions should be described in relative terms --
most stuff is absolute w/brittle hardcoding.

- explicit support for when there is no text-override (key name
instead of graphical stencil) available.  i tripped across a
previously reported bug that doesn't seem to have made it to the issue
list even though it's a crash:
(http://lists.gnu.org/archive/html/lilypond-user/2014-09/msg00405.html):

  c^
  \markup \override #'(graphical . #f) {
  \woodwind-diagram
#'tin-whistle
#'()
  }

C:/Program Files (x86)/LilyPond/usr/share/lilypond/current/scm/display-woodwind-
diagrams.scm:1977:20: In procedure = in expression (= 0 (assoc-get node draw-ins
tructions)):
C:/Program Files (x86)/LilyPond/usr/share/lilypond/current/scm/display-woodwind-
diagrams.scm:1977:20: Wrong type: #f

also broken for saxophone (a different error tho), but works for piccolo.
for tin-whistle, seems to be from use of CENTRAL-COLUMN-HOLE-H-LIST
instead of CENTRAL-COLUMN-HOLE-LIST.

- when using \override #'(graphical . #f) (is there a way to call this
"textual"?) with an empty keylist, should show all possible text
stencils (as it currently does for graphical).  also, how are partial
coverings/trills handled in this case?

- would be nice if i didn't have to edit display-woodwind-diagrams.scm
and instead could just \include my raw .scm file from a .ly file.

thanks!
-erik
;;; Recorder assembly instructions

(define make-hidden-key-addresses (make-key-symbols 'hidden))

(define recorder-change-points
  ((make-named-spreadsheet '(recorder)) '()))

(define (remove-last x) (reverse (cdr (reverse x

(define recorder-rh-B-key-stencil (variable-column-circle-stencil 0.55))
(define recorder-rh-L-key-stencil (variable-column-circle-stencil 0.35))

(define (generate-recorder-family-entry recorder-name)
  (let*
  ((change-points
(get-named-spreadsheet-column recorder-name recorder-change-points)))
`(,recorder-name
  . ((keys
  . ((hidden
  . ((midline
  . ((offset . (0.0 . 0.0))
 (stencil . ,midline-stencil)
 (text? . #f)
 (complexity . basic)))
 (r3
  . ((offset . (0.0 . 1.0))
 (stencil . ,column-circle-stencil)
 (text? . #f)
 (complexity . basic)))
 (r4
  . ((offset . (0.0 . 0.0))
 (stencil . ,column-circle-stencil)
 (text? . #f)
 (complexity . basic)
 (central-column
  . ((one
  . ((offset . ,(assoc-get 'one CENTRAL-COLUMN-HOLE-PLACEMENTS))
 (stencil . ,column-circle-stencil)
 (text? . #f)
 (complexity . trill)))
 (two
  . ((offset . ,(assoc-get 'two CENTRAL-COLUMN-HOLE-PLACEMENTS))
 (stencil . ,column-circle-stencil)
 (text? . #f)
 (complexity . trill)))
 (three
  . ((offset . ,(assoc-get 'three CENTRAL-COLUMN-HOLE-PLACEMENTS))
 (stencil . ,column-circle-stencil)
 (text? . #f)
 (complexity . trill)))
 (four
  . ((offset . ,(assoc-get 'four CENTRAL-COLUMN-HOLE-PLACEMENTS))
 (stencil . ,column-circle-stencil)
 (text?

Re: Feedback Request for Music Fonts

2014-10-11 Thread Abraham Lee

Noeck,

On Fri, Oct 10, 2014 at 6:14 PM, Noeck  wrote:


- Polskie Wydawnictwo Muzyc music font
As you are often asking for scores with a nice font, I recently found
scores printed by the Polish publisher Polskie Wydawnictwo Muzyc 
(PWM).

This is the only scan, I found in the same style:
http://javanese.imslp.info/files/imglnks/usimg/2/23/IMSLP06555-Cantabile.pdf
I don’t need it really. But it looks good in my opinion.


Thanks for sharing this. I haven't ventured out too far from the main 
German publishers.



- Stylesheets
You offer some stylesheets on the fonts website as a zip file. What do
you think about including them in the openlilylib git repo?


That was the original intent. I just haven't gotten around to doing it 
yet, but I still hope to.



- Stylesheets and text fonts
The stylesheets could incorporate overrides for the text fonts, too. 
The
tuplet numbers in Profondo could be bold, for example. That leads me 
to

two more questions:
  1) Can the tuplet numbers and other numbers be written in the same
 font as the music font? Does your machinery allow to take these
 numbers from Bravura for example and put it in a normal text 
font?


By default, the tuplet numbers come from whatever is set to be the 
\roman font. However, you can do something like "\override 
TupletNumber.font-encoding = #fetaText" to get the effect you want by 
using the music numerals instead! These will be bold, but not 
italicized because they aren't part of the font. Some programs can 
artificially embolden or italicize a font that doesn't actually have 
one of those variants, but not the Pango libraries. If a bold, italic, 
or bold-italic font doesn't exist, Pango reverts to the closest variant 
instead (if one exists).



  2) Do you or does anyone know text fonts similar to the ones used in
 many old scores, like here:

http://javanese.imslp.info/files/imglnks/usimg/7/7f/IMSLP00115-Chopin_-_Ballade_No1.pdf
 with the characteristic narrow letters and a remarkably big
 difference in the width of horizontal and vertical lines
 (black and thick vertical lines and very thin horizontal lines)?
 I would be interested in any font shape (regular, bold, italic).

Cheers,
Joram


I've often looked for some nice fonts like those. A nice one I've found 
is called "OldStandardTT". It's free and supports an extensive 
character set including Latin, Greek, and Cyrillic:


http://www.fontsquirrel.com/fonts/old-standard-TT

I'm actually working on a few right now that have a similar feel as 
those found in the Chopin score, but I can't say when they'll be done 
and ready for prime-time.


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

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


Re: Contemporary Music Notation

2014-10-11 Thread SoundsFromSound
Urs Liska wrote
> Am 09.10.2014 06:31, schrieb Marco Bagolin:
>> The notation contemporary music is so diverse, I know.
>> I wonder if actually Lilypond has commands for drawing graphic 
>> symbols, as line circle, curve, square, circle, etc...
> 
> A nice thing about LilyPond's approach is that once you have invented 
> something you can make it available as a command so it can easily be 
> reused. You can also make such commands process arguments so they can be 
> versatile and context-dependent.
> As an example have a look at the attached image. This is what someone on 
> the list (Piaras Hoban) came up with when I asked for a function to 
> write a stemmed glissando notation. The underlying function is quite 
> complicated but you can use it by simply writing
> 
> \stemmedGlissando #'(15 . #f) c'4
> 
> to tell LilyPond that the next glissando will have 15 stems and no (the 
> #f) trailing grace note to indicate the target note.
> 
> Stemmed-glissando.png (34K)
> ;

Urs,

Is there more information on that stemmed gliss function? I'd be interested
to read more on that for LilyPond. Thanks!

Ben




-
composer | sound designer 
LilyPond Tutorials (for beginners) --> http://bit.ly/bcl-lilypond
--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Contemporary-Music-Notation-tp167324p167437.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