Re: automatic beaming of tuplets only - is this possible ?

2017-11-20 Thread Urs Liska


Am 21. November 2017 07:14:01 MEZ schrieb Eby Mani :
>Hi All, I couldn't find how achieve the following, i tried fiddling
>with \set Timing and \overrideTimeSignatureSettings related commands
>for beaming.
>
>1, Automatically replace tuplet bracket with a slur.
>
>2, Automatically break beaming of tuplets of value 16. If no tuplet,
>then the beaming should default.
>e.g. by default lilypond beams tuplets {c16 d e} and f8 together. What
>i want is the f8 should not be beamed together with tuplet. And if
>there is { c16 d32 e f16 } in a tuplet, it should be beamed together.
>
>Is point number 2 possible without manual beam breaks ?.
>

Not yet. We have just started a discussion about how tuplets should affect 
beaming and the subdivision of secondary beams.
Hopefully this will be fixed in the foreseeable future.
Which leads to ...

>
>I'm on lilypond 2.16.2 on ubuntu 

This is *really* outdated. 2.18 has been the stable release for years now, and 
you should switch at least to that version.

Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

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


Re: [OT] Linux Users

2017-11-20 Thread Henning Hraban Ramm
Am 2017-11-20 um 09:53 schrieb David Kastrup :

> Sure.  It's part of the cost of using TeX as a programming language.
> All the important and/or costly things when running plain TeX are
> executed in Pascal and the respective data kept there.
> 
> But LaTeX does a lot of programming in TeX macros (just take a look at
> the difference for \"A or even Ä in some input encoding), and PDFTeX has
> to deal with a lot more font data and structure than just the metrics in
> the TFM file, and the respective libraries have not been written by
> Knuth.

But LuaTeX again does away with a lot of the TeX programming, esp. regarding 
font handling (luaotfload for LaTeX, extracted from ConTeXt).

With big documents, LuajitTeX is worth a look; depending on obscure 
circumstances, it’s mostly faster than "normal" LuaTeX. Don’t know how to 
invoke it with LaTeX, though (luajitlatex?).

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


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


Re: Scheme help? snippet for movement page headers

2017-11-20 Thread Werner LEMBERG

> Oh ugh, Nabble wrapped my lines and now it's all ugly. :(

One of the reasons to avoid source code lines longer than, say 78
characters...


Werner

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


Re: repeat index

2017-11-20 Thread Gianmaria Lari
That's exactly what I was thinking. Thank you David!

And yes, yesterday I found this part of the manual and I start reading it.

Thanks a lot for your help!
g.

On 20 November 2017 at 23:01, David Kastrup  wrote:

> Gianmaria Lari  writes:
>
> > On 20 November 2017 at 15:18, David Kastrup  wrote:
> >
> >> Gianmaria Lari  writes:
> >>
> >> > On 20 November 2017 at 12:00, David Kastrup  wrote:
> >> >
> >> >> Gianmaria Lari  writes:
> >>
> >> >> > Is there any (simple) way to rewrite it in a more concise way like
> >> >> > this for example?
> >> >> >
> >> >> >   \repeat unfold 7 {
> >> >> > \modalTranspose c "c+index" \scale \pattern
> >> >> >   }
> >> >>
> >> >> What is simple?
> >> >>
> >> >> \version "2.18.0"
> >> >>
> >> >> scale = {c d e f g a b}
> >> >> pattern = {c d e f}
> >> >>
> >> >> \fixed c' {
> >> >>   #@(map
> >> >>   (lambda (p)
> >> >> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern
> #})
> >> >>   (iota 8))
> >> >> }
> >> >
> >> > Thank you David, it works perfectly!
> >> >
> >> > Is there any way to encapsulate it in a function to avoid to write
> >> > all the code any time I need it?
> >>
> >> What is "all the code"?  I really have no idea what makes you consider
> >> something simple (and your "explanation" below does not help at all
> >> since it is tantamount to "simple depends on the viewer's metrics").
> >> I also have no idea what part of the above you consider "it" to be
> >> encapsulated and what you consider variable.
> >
> > I'm sorry I have not been clear. If you have a look to the following
> source
> > you'll see that the same code is repeated three times (only the variable
> > 'pattern' changes).
> >
> > \version "2.18.0"
> > scale = {c d e f g a b}
> >
> > pattern = {c d e f}
> > \fixed c' {
> >   #@(map
> >   (lambda (p)
> > #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
> >   (iota 8))
> > }
> >
> > pattern = {f e d c}
> > \fixed c' {
> >   #@(map
> >   (lambda (p)
> > #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
> >   (iota 8))
> > }
> >
> > pattern = {a c e g}
> > \fixed c' {
> >   #@(map
> >   (lambda (p)
> > #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
> >   (iota 8))
> > }
> >
> >
> > I was wondering if it was possible to to avoid this redundancy.
>
> whatever =
> #(define-music-function (pattern) (ly:music?)
>   #{ \fixed c' {
>#@(map
>(lambda (p)
>  #{ \modalTranspose c #(ly:make-pitch -1 p) \scale #pattern #})
>(iota 8))
>  } #})
>
> \whatever {c d e f}
> \whatever {f e d c}
> \whatever {a c e g}
>
> It might make sense to read up on the basics of music functions in the
> notation reference.  Simple substitution functions like the above should
> be more or less covered and adding
>
> ... =
> #(define-music-function (pattern) (ly:music?)
>   #{ ... #})
>
> around some LilyPond code is not exactly rocket science.  For that
> reason my question about what you consider simple and what not.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Scheme help? snippet for movement page headers

2017-11-20 Thread Shevek
Oh ugh, Nabble wrapped my lines and now it's all ugly. :(



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

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


Re: Scheme help? snippet for movement page headers

2017-11-20 Thread Shevek
Here is a cleaner, updated version of the snippet. It now gives the stencil
the extent of the longest table of contents entry. Not ideal, but close
enough for practical use. Also added comments and cleaned up variable names.

\version "2.18.2"

#(define-markup-command (current-toc-section layout props)
   ()
   (ly:stencil-add (let* ((titles (map cddr (toc-items)))
  (sorted-titles (stable-sort titles (lambda (item1
item2)
   (<= (length
item1) (length item2)
  (biggest-title (interpret-markup layout props
(caar sorted-titles)))
  (x-extent (ly:stencil-extent biggest-title X))
  (y-extent (ly:stencil-extent biggest-title Y))
  )
 (ly:make-stencil
  `(delay-stencil-evaluation
,(delay (ly:stencil-expr
 (let* ((table (ly:output-def-lookup layout
'label-page-table))
(curr-page (chain-assoc-get
'page:page-number props))
;; TOC entries should be at the
beginning of sections/movements.
;; If a section starts mid-page, the
page header will show the new section.
;; To make it show the title
belonging to the first system of the page,
;; Change >= to <= and put TOC
entries at the END of sections.
;; That breaks the actual TOC,
however.
(labels-up-to-curr (filter (lambda
(item) (>= curr-page (cdr item))) table))
(most-recent-toc-page (apply max
(map cdr labels-up-to-curr)))
;; If there are multiple toc items
on the same page, behavior may be undefined.
(most-recent-label (filter (lambda
(item) (eq? (cdr item) most-recent-toc-page)) labels-up-to-curr))
(title-of-curr-label (cadr
(assoc-get (caar most-recent-label) (toc-items
(curr-markup (interpret-markup
layout props
   title-of-curr-label))
;; How do we get the true extent
outside of the delayed evaluation?
;(x-ext (ly:stencil-extent
curr-markup X))
;(y-ext (ly:stencil-extent
curr-markup Y))
)
   ;(set! x-extent x-ext)
   ;(set! y-extent y-ext)
   curr-markup
   
  ;; Currently, we just use the extent of the longest
toc entry for all of them
  x-extent
  y-extent
  ))
 ))

%% Uncomment below to test
% \paper {
%   evenHeaderMarkup = \markup \current-toc-section
%   oddHeaderMarkup = \markup { "foo" \current-toc-section "bar" }
% }
% 
% \score {
%   \new Staff {
% \tocItem "Title 1"
% s1
% \pageBreak
% s1
% 
%   }
% }
% 
% \score {
%   \new Staff {
% \tocItem "Title 2 is long"
% s1
% \pageBreak
% s1
% 
%   }
% }



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

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


Re: Scheme help? snippet for movement page headers

2017-11-20 Thread Shevek
Hi Timothy,

Where are you defining #'header:piece, inside or outside a \score block? To
clarify, I'm talking about using \fromproperty with score-level headers.

Saul



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

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


Re: Clarinet fingerings

2017-11-20 Thread Paul Scott
A quick comment, not the answer to your question:

You have given the correct fingering for Bb for the F major scale but you
have called it b4 which would be a B natural quarter note.  In LilyPond,
unlike Finale, the key signature does not affect the note.  You must
say bes or its equivalent in whatever language file you include.
For example Bb would be "bf" if you include "english.ly'

Many of us have learned this hard way,

Hope that helps,

Paul

On Mon, Nov 20, 2017 at 05:50:01PM -0700, Greg wrote:
> I am new to Lilypond and am slowly trying to learn to use it. I have
> rediscovered learning the clarinet and my teacher has asked me to start with
> the G major and F major scales. I'm pretty much a novice with little
> knowledge (thus far) of the deeper aspects and subtleties of musical
> notation, but I'm working on it. I thought learning Lilypond would a) help
> me create whatever scales I need - initially with the fingerings, to set me
> on the right path and b) immerse me in the details, so I'd learn faster. I
> have managed to construct what I think is the F major scale (see below) but
> you'll also see that the clarinet fingerings are not showing up.  E is doing
> something but its diagram is different for a reason I don't understand and
> none of the other fingerings are showing on the vanilla clarinet key
> diagrams? Can anyone pont to what's going on, please?
> 
> Many thanks
> 
> Greg
> 
> (Frescobaldi: 2.19.0
> Python: 3.4.6
> python-ly: 0.9.4
> Qt: 4.8.6
> PyQt: 4.11.4
> sip: 4.16.9
> poppler: 0.43.0
> python-poppler-qt: 0.24.0
> OS: Linux-4.4.92-18.36-default-x86_64-with-SuSE-42.2-x86_64)
> 
> My .ly code follows:
> 
> 
> \language "english"
> 
> #(print-keys-verbose 'clarinet (current-error-port)) 
>   \time 4/4
>   \relative f {
>   \key f \major
>   \textLengthOn
> f4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one two three four five six))
q>(lh . (thumb))
>(rh . (four))
>   }
> g4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one two three four five six))
>(lh . (thumb)))
>   }
> a4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one two three four five))
>(lh . (thumb)))
>   }
> b4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one two three four))
>(lh . (thumb)))
>   }
> c4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one two three))
>(lh . (thumb)))
>   }
> d^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet 
> #'((cc . (one two))
>(lh . (thumb)))
>   }
> e4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one))
>(lh . (thumb)))
>   }
> f4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'((cc . (one)))
>   }
> g4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> a4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> b4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> c4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> d4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> e4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> f4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> g4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> a4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> b4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
> c4^\markup
>   \override #'(size . 0.5){
>   \woodwind-diagram
> #'clarinet
> #'()
>   }
>   }
> 
> 
> 
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 


___
lilypond-user mailing list
lilypond-user@gnu.org

Re: Scheme help? snippet for movement page headers

2017-11-20 Thread Timothy Lanfear

On 20/11/17 08:45, Shevek wrote:

Hi all,

It would be quite nice to be able to use \fromproperty #'header:piece in
oddHeaderMarkup and evenHeaderMarkup, so that the title of the current
movement will display in the page header. Unfortunately, after investigating
the Lilypond source code, I can't see how to make that work, because it
requires the markup command knowing the top system of the current page and
what score it belongs to. That information isn't included in either the
layout or props argument to a markup function.

This works for me. I have a piece with several parts and several pieces 
per part. I print the piece in the odd page header and the part in the 
even page header, except for the first page of the part where I print a 
full title block.


\version "2.19.80"

\paper {
  oddHeaderMarkup = \markup \column {
    \fill-line {
  \null
  \on-the-fly #not-part-first-page \normalsize \fromproperty 
#'header:piece
  \on-the-fly #print-page-number-check-first \number \teeny 
\fromproperty #'page:page-number-string

    }
    \null
  }
  evenHeaderMarkup = \markup \column {
    \fill-line {
  \on-the-fly #print-page-number-check-first \number \teeny 
\fromproperty #'page:page-number-string
  \on-the-fly #print-page-number-check-first \normalsize 
\fromproperty #'header:part

  \null
    }
    \null
  }

}

--
Timothy Lanfear, Bristol, UK.


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


Clarinet fingerings

2017-11-20 Thread Greg
I am new to Lilypond and am slowly trying to learn to use it. I have
rediscovered learning the clarinet and my teacher has asked me to start with
the G major and F major scales. I'm pretty much a novice with little
knowledge (thus far) of the deeper aspects and subtleties of musical
notation, but I'm working on it. I thought learning Lilypond would a) help
me create whatever scales I need - initially with the fingerings, to set me
on the right path and b) immerse me in the details, so I'd learn faster. I
have managed to construct what I think is the F major scale (see below) but
you'll also see that the clarinet fingerings are not showing up.  E is doing
something but its diagram is different for a reason I don't understand and
none of the other fingerings are showing on the vanilla clarinet key
diagrams? Can anyone pont to what's going on, please?

Many thanks

Greg

(Frescobaldi: 2.19.0
Python: 3.4.6
python-ly: 0.9.4
Qt: 4.8.6
PyQt: 4.11.4
sip: 4.16.9
poppler: 0.43.0
python-poppler-qt: 0.24.0
OS: Linux-4.4.92-18.36-default-x86_64-with-SuSE-42.2-x86_64)

My .ly code follows:


\language "english"

#(print-keys-verbose 'clarinet (current-error-port)) 
  \time 4/4
  \relative f {
  \key f \major
  \textLengthOn
f4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one two three four five six))
   (lh . (thumb))
   (rh . (four))
  }
g4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one two three four five six))
   (lh . (thumb)))
  }
a4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one two three four five))
   (lh . (thumb)))
  }
b4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one two three four))
   (lh . (thumb)))
  }
c4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one two three))
   (lh . (thumb)))
  }
d^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet 
#'((cc . (one two))
   (lh . (thumb)))
  }
e4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one))
   (lh . (thumb)))
  }
f4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'((cc . (one)))
  }
g4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
a4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
b4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
c4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
d4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
e4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
f4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
g4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
a4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
b4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
c4^\markup
  \override #'(size . 0.5){
  \woodwind-diagram
#'clarinet
#'()
  }
  }



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

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


Re: repeat index

2017-11-20 Thread David Kastrup
Gianmaria Lari  writes:

> On 20 November 2017 at 15:18, David Kastrup  wrote:
>
>> Gianmaria Lari  writes:
>>
>> > On 20 November 2017 at 12:00, David Kastrup  wrote:
>> >
>> >> Gianmaria Lari  writes:
>>
>> >> > Is there any (simple) way to rewrite it in a more concise way like
>> >> > this for example?
>> >> >
>> >> >   \repeat unfold 7 {
>> >> > \modalTranspose c "c+index" \scale \pattern
>> >> >   }
>> >>
>> >> What is simple?
>> >>
>> >> \version "2.18.0"
>> >>
>> >> scale = {c d e f g a b}
>> >> pattern = {c d e f}
>> >>
>> >> \fixed c' {
>> >>   #@(map
>> >>   (lambda (p)
>> >> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
>> >>   (iota 8))
>> >> }
>> >
>> > Thank you David, it works perfectly!
>> >
>> > Is there any way to encapsulate it in a function to avoid to write
>> > all the code any time I need it?
>>
>> What is "all the code"?  I really have no idea what makes you consider
>> something simple (and your "explanation" below does not help at all
>> since it is tantamount to "simple depends on the viewer's metrics").
>> I also have no idea what part of the above you consider "it" to be
>> encapsulated and what you consider variable.
>
> I'm sorry I have not been clear. If you have a look to the following source
> you'll see that the same code is repeated three times (only the variable
> 'pattern' changes).
>
> \version "2.18.0"
> scale = {c d e f g a b}
>
> pattern = {c d e f}
> \fixed c' {
>   #@(map
>   (lambda (p)
> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
>   (iota 8))
> }
>
> pattern = {f e d c}
> \fixed c' {
>   #@(map
>   (lambda (p)
> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
>   (iota 8))
> }
>
> pattern = {a c e g}
> \fixed c' {
>   #@(map
>   (lambda (p)
> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
>   (iota 8))
> }
>
>
> I was wondering if it was possible to to avoid this redundancy.

whatever =
#(define-music-function (pattern) (ly:music?)
  #{ \fixed c' {
   #@(map
   (lambda (p)
 #{ \modalTranspose c #(ly:make-pitch -1 p) \scale #pattern #})
   (iota 8))
 } #})

\whatever {c d e f}
\whatever {f e d c}
\whatever {a c e g}

It might make sense to read up on the basics of music functions in the
notation reference.  Simple substitution functions like the above should
be more or less covered and adding

... =
#(define-music-function (pattern) (ly:music?)
  #{ ... #})

around some LilyPond code is not exactly rocket science.  For that
reason my question about what you consider simple and what not.

-- 
David Kastrup

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


Re: repeat index

2017-11-20 Thread Gianmaria Lari
On 20 November 2017 at 15:18, David Kastrup  wrote:

> Gianmaria Lari  writes:
>
> > On 20 November 2017 at 12:00, David Kastrup  wrote:
> >
> >> Gianmaria Lari  writes:
>
> >> > Is there any (simple) way to rewrite it in a more concise way like
> >> > this for example?
> >> >
> >> >   \repeat unfold 7 {
> >> > \modalTranspose c "c+index" \scale \pattern
> >> >   }
> >>
> >> What is simple?
> >>
> >> \version "2.18.0"
> >>
> >> scale = {c d e f g a b}
> >> pattern = {c d e f}
> >>
> >> \fixed c' {
> >>   #@(map
> >>   (lambda (p)
> >> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
> >>   (iota 8))
> >> }
> >
> > Thank you David, it works perfectly!
> >
> > Is there any way to encapsulate it in a function to avoid to write all
> the
> > code any time I need it?
>
> What is "all the code"?  I really have no idea what makes you consider
> something simple (and your "explanation" below does not help at all
> since it is tantamount to "simple depends on the viewer's metrics").
> I also have no idea what part of the above you consider "it" to be
> encapsulated and what you consider variable.
>
> > Regarding "simple". Never think seriously about what I mean with
> "simple".
> > Maybe:
> >
> > Suppose that you know well how to informally solve a problem.  Now
> > suppose you have to describe your solution in a formal and algorithmic
> > way.
> >
> > Between many formal solution I would say that the simplest one is that
> one
> > that better overlap the informal solution.
> > g.
>
> --
> David Kastrup
>

I'm sorry I have not been clear. If you have a look to the following source
you'll see that the same code is repeated three times (only the variable
'pattern' changes).

\version "2.18.0"
scale = {c d e f g a b}

pattern = {c d e f}
\fixed c' {
  #@(map
  (lambda (p)
#{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
  (iota 8))
}

pattern = {f e d c}
\fixed c' {
  #@(map
  (lambda (p)
#{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
  (iota 8))
}

pattern = {a c e g}
\fixed c' {
  #@(map
  (lambda (p)
#{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
  (iota 8))
}


I was wondering if it was possible to to avoid this redundancy.

And yes, forgot what I tried to define as simpler. In this case it only
makes things more complicated...
Thank you, g.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: repeat index

2017-11-20 Thread David Kastrup
Gianmaria Lari  writes:

> On 20 November 2017 at 12:00, David Kastrup  wrote:
>
>> Gianmaria Lari  writes:

>> > Is there any (simple) way to rewrite it in a more concise way like
>> > this for example?
>> >
>> >   \repeat unfold 7 {
>> > \modalTranspose c "c+index" \scale \pattern
>> >   }
>>
>> What is simple?
>>
>> \version "2.18.0"
>>
>> scale = {c d e f g a b}
>> pattern = {c d e f}
>>
>> \fixed c' {
>>   #@(map
>>   (lambda (p)
>> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
>>   (iota 8))
>> }
>
> Thank you David, it works perfectly!
>
> Is there any way to encapsulate it in a function to avoid to write all the
> code any time I need it?

What is "all the code"?  I really have no idea what makes you consider
something simple (and your "explanation" below does not help at all
since it is tantamount to "simple depends on the viewer's metrics").
I also have no idea what part of the above you consider "it" to be
encapsulated and what you consider variable.

> Regarding "simple". Never think seriously about what I mean with "simple".
> Maybe:
>
> Suppose that you know well how to informally solve a problem.  Now
> suppose you have to describe your solution in a formal and algorithmic
> way.
>
> Between many formal solution I would say that the simplest one is that one
> that better overlap the informal solution.
> g.

-- 
David Kastrup

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


Re: repeat index

2017-11-20 Thread Gianmaria Lari
On 20 November 2017 at 12:00, David Kastrup  wrote:

> Gianmaria Lari  writes:
>
> > I have this:
> >
> > \version "2.19.80"
> >
> > scale = {c d e f g a b}
> > pattern = {c d e f}
> >
> > \fixed c' {
> >   \modalTranspose c c \scale \pattern
> >   \modalTranspose c d \scale \pattern
> >   \modalTranspose c e \scale \pattern
> >   \modalTranspose c f \scale \pattern
> >   \modalTranspose c g \scale \pattern
> >   \modalTranspose c a \scale \pattern
> >   \modalTranspose c b \scale \pattern
> >   \modalTranspose c c' \scale \pattern
> > }
> >
> > Is there any (simple) way to rewrite it in a more concise way like this
> for
> > example?
> >
> >   \repeat unfold 7 {
> > \modalTranspose c "c+index" \scale \pattern
> >   }
>
> What is simple?
>
> \version "2.18.0"
>
> scale = {c d e f g a b}
> pattern = {c d e f}
>
> \fixed c' {
>   #@(map
>   (lambda (p)
> #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
>   (iota 8))
> }
>
> --
> David Kastrup
>

Thank you David, it works perfectly!

Is there any way to encapsulate it in a function to avoid to write all the
code any time I need it?

* * *

Regarding "simple". Never think seriously about what I mean with "simple".
Maybe:

Suppose that you know well how to informally solve a problem.
Now suppose you have to describe your solution in a formal and algorithmic
way.

Between many formal solution I would say that the simplest one is that one
that better overlap the informal solution.
g.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: repeat index

2017-11-20 Thread David Kastrup
Gianmaria Lari  writes:

> I have this:
>
> \version "2.19.80"
>
> scale = {c d e f g a b}
> pattern = {c d e f}
>
> \fixed c' {
>   \modalTranspose c c \scale \pattern
>   \modalTranspose c d \scale \pattern
>   \modalTranspose c e \scale \pattern
>   \modalTranspose c f \scale \pattern
>   \modalTranspose c g \scale \pattern
>   \modalTranspose c a \scale \pattern
>   \modalTranspose c b \scale \pattern
>   \modalTranspose c c' \scale \pattern
> }
>
> Is there any (simple) way to rewrite it in a more concise way like this for
> example?
>
>   \repeat unfold 7 {
> \modalTranspose c "c+index" \scale \pattern
>   }

What is simple?

\version "2.18.0"

scale = {c d e f g a b}
pattern = {c d e f}

\fixed c' {
  #@(map
  (lambda (p)
#{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
  (iota 8))
}

-- 
David Kastrup

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


repeat index

2017-11-20 Thread Gianmaria Lari
I have this:

\version "2.19.80"

scale = {c d e f g a b}
pattern = {c d e f}

\fixed c' {
  \modalTranspose c c \scale \pattern
  \modalTranspose c d \scale \pattern
  \modalTranspose c e \scale \pattern
  \modalTranspose c f \scale \pattern
  \modalTranspose c g \scale \pattern
  \modalTranspose c a \scale \pattern
  \modalTranspose c b \scale \pattern
  \modalTranspose c c' \scale \pattern
}

Is there any (simple) way to rewrite it in a more concise way like this for
example?

  \repeat unfold 7 {
\modalTranspose c "c+index" \scale \pattern
  }


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


Re: [OT] Linux Users

2017-11-20 Thread David Kastrup
Urs Liska  writes:

> Am 20.11.2017 um 09:34 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> Am 19.11.2017 um 23:43 schrieb Br. Samuel Springuel:
 On 2017-11-19 5:28 PM, Simon Albrecht wrote:
> Font selection, language support, UTF-8 input…
 All of these are supported in LuaTeX/LuaLaTeX.

 For some key differences see this:
 https://www.overleaf.com/blog/500-whats-in-a-name-a-guide-to-the-many-flavours-of-tex#keyfeatures


>>> There's one feature that sets LuaLaTeX apart from XeLaTeX for my use
>>> cases, and that's the compatibility of the 'microtype' package. While
>>> it works with XeTeX it offers a limited feature set - and that package
>>> with LuaTeX provides (at least for me) those last 5% of beautiful
>>> typesetting.
>>>
>>> However, this comes at a cost: both XeTeX and LuaTeX work
>>> *substantially* slower than pdfTeX.
>> Which works substantially slower than compiling to DVI and then using
>> dvips or similar.
>>
>>> I'm always stunned how fast "ordinary" compilation can be with LaTeX,
>>> for example when simply pushing a Markdown document through Pandoc.
>> Try compiling the TeX source code to DVI (not! PDF) with plain TeX.
>> That was sort of the definition of a large document in the 80s.
>
> I'll sure do that occasionally
>
>> Makes you wonder where LaTeX spends all its time.
>>
>
> Do you have an idea where it does?

Sure.  It's part of the cost of using TeX as a programming language.
All the important and/or costly things when running plain TeX are
executed in Pascal and the respective data kept there.

But LaTeX does a lot of programming in TeX macros (just take a look at
the difference for \"A or even Ä in some input encoding), and PDFTeX has
to deal with a lot more font data and structure than just the metrics in
the TFM file, and the respective libraries have not been written by
Knuth.

-- 
David Kastrup

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


Re: [OT] Linux Users

2017-11-20 Thread Urs Liska



Am 20.11.2017 um 09:34 schrieb David Kastrup:

Urs Liska  writes:


Am 19.11.2017 um 23:43 schrieb Br. Samuel Springuel:

On 2017-11-19 5:28 PM, Simon Albrecht wrote:

Font selection, language support, UTF-8 input…

All of these are supported in LuaTeX/LuaLaTeX.

For some key differences see this:
https://www.overleaf.com/blog/500-whats-in-a-name-a-guide-to-the-many-flavours-of-tex#keyfeatures



There's one feature that sets LuaLaTeX apart from XeLaTeX for my use
cases, and that's the compatibility of the 'microtype' package. While
it works with XeTeX it offers a limited feature set - and that package
with LuaTeX provides (at least for me) those last 5% of beautiful
typesetting.

However, this comes at a cost: both XeTeX and LuaTeX work
*substantially* slower than pdfTeX.

Which works substantially slower than compiling to DVI and then using
dvips or similar.


I'm always stunned how fast "ordinary" compilation can be with LaTeX,
for example when simply pushing a Markdown document through Pandoc.

Try compiling the TeX source code to DVI (not! PDF) with plain TeX.
That was sort of the definition of a large document in the 80s.


I'll sure do that occasionally


Makes you wonder where LaTeX spends all its time.



Do you have an idea where it does?

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


Scheme help? snippet for movement page headers

2017-11-20 Thread Shevek
Hi all,

It would be quite nice to be able to use \fromproperty #'header:piece in
oddHeaderMarkup and evenHeaderMarkup, so that the title of the current
movement will display in the page header. Unfortunately, after investigating
the Lilypond source code, I can't see how to make that work, because it
requires the markup command knowing the top system of the current page and
what score it belongs to. That information isn't included in either the
layout or props argument to a markup function.

But! Lilypond has a table of contents feature that is able to find out what
page a particular musical moment happens on, and to print it in a markup.
I've copied and hacked that code to come up with the following very rough
snippet:

\version "2.18.2"

#(define-markup-command (curent-toc-section layout props)
  ()
  (ly:stencil-add (ly:make-stencil
   `(delay-stencil-evaluation
 ,(delay (ly:stencil-expr
  (let* ((table (ly:output-def-lookup layout 'label-page-table))
  (curr (chain-assoc-get 'page:page-number props))
  (prevs (filter (lambda (item) (<= curr (cdr item)))
table))
  (winpage  (apply min (map cdr prevs)))
  (winner (filter (lambda (item) (eq? (cdr item)
winpage)) prevs))
  (wintext (cdr (assoc-get (caar winner) (toc-items
  (winmarkup (interpret-markup layout props
   (car wintext)))
 )
 (display winner)
 (interpret-markup layout props
   (car wintext))

   )))


\paper {
  evenHeaderMarkup = \markup { \curent-toc-section " " }
  oddHeaderMarkup = \markup { \curent-toc-section " " }
}

\score {
  \new Staff {
s1
\pageBreak
s1
\tocItem "Title 1"
  }
}

\score {
  \new Staff {
s1
\pageBreak
s1
\tocItem "Title 2"
  }
}

The idea here is to put a table of contents entry at the very end of the
music for each movement score, so that the page header reflects the first
system of the page. This behavior can almost certainly be improved, so that
the snippet can coexist with an actual table of context listing movement
beginning pages. Maybe the page header should just reflect if a new movement
starts on that page.

I'd much appreciate feedback on this snippet. In particular, I don't quite
understand how the delayed evaluation part of the code works — I just copied
that from the definition of page-ref in define-markup-commands.scm. It seems
silly to define a whole new stencil when in the end it's just a plain old
markup. For page numbers, it's fine to make the stencil the same size every
time using a template, but since my snippet is for movement titles, and
might be used within text flow, it really ought to have a flexible stencil
extent. Currently, the returned stencil has null extent, since I cut out the
fixed-extent code from page-ref.



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

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


Re: [OT] Linux Users

2017-11-20 Thread Henning Hraban Ramm

Am 2017-11-20 um 09:30 schrieb Henning Hraban Ramm :

> Am 2017-11-19 um 16:46 schrieb Marc Hohl :
> 
>> Am 18.11.2017 um 17:58 schrieb Jacques Peron:
>>> Linux, LilyPond, LuaLaTeX (and Gregorio for gregorian chant) here. To 
>>> integrate LilyPond into LaTeX, I developped lyluatex 
>>> .
>> 
>> Which is a great tool and IMHO easier to use than lilypond-book!
> 
> A similar approach for ConTeXt instead of LaTeX is my LilyPond module (i.e. 
> config for the filter module):
> http://wiki.contextgarden.net/LilyPond

... also using LuaTeX, as ConTeXt MkIV is partly written in Lua itself.

Oh, and, BTW: ConTeXt is the reference platform of LuaTeX; most features are 
ported to LaTeX only later.

Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net




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


Re: [OT] Linux Users

2017-11-20 Thread David Kastrup
Urs Liska  writes:

> Am 19.11.2017 um 23:43 schrieb Br. Samuel Springuel:
>> On 2017-11-19 5:28 PM, Simon Albrecht wrote:
>>> Font selection, language support, UTF-8 input…
>>
>> All of these are supported in LuaTeX/LuaLaTeX.
>>
>> For some key differences see this:
>> https://www.overleaf.com/blog/500-whats-in-a-name-a-guide-to-the-many-flavours-of-tex#keyfeatures
>>
>>
>
> There's one feature that sets LuaLaTeX apart from XeLaTeX for my use
> cases, and that's the compatibility of the 'microtype' package. While
> it works with XeTeX it offers a limited feature set - and that package
> with LuaTeX provides (at least for me) those last 5% of beautiful
> typesetting.
>
> However, this comes at a cost: both XeTeX and LuaTeX work
> *substantially* slower than pdfTeX.

Which works substantially slower than compiling to DVI and then using
dvips or similar.

> I'm always stunned how fast "ordinary" compilation can be with LaTeX,
> for example when simply pushing a Markdown document through Pandoc.

Try compiling the TeX source code to DVI (not! PDF) with plain TeX.
That was sort of the definition of a large document in the 80s.

Makes you wonder where LaTeX spends all its time.

-- 
David Kastrup

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


Re: [OT] Linux Users

2017-11-20 Thread Henning Hraban Ramm
Am 2017-11-19 um 16:46 schrieb Marc Hohl :

> Am 18.11.2017 um 17:58 schrieb Jacques Peron:
>> Linux, LilyPond, LuaLaTeX (and Gregorio for gregorian chant) here. To 
>> integrate LilyPond into LaTeX, I developped lyluatex 
>> .
> 
> Which is a great tool and IMHO easier to use than lilypond-book!

A similar approach for ConTeXt instead of LaTeX is my LilyPond module (i.e. 
config for the filter module):
http://wiki.contextgarden.net/LilyPond


Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net




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