Color parenthesized accidentals with \accidentalStyle teaching

2019-05-12 Thread Paul Morris
Just in case anyone is wondering, `AccidentalCautionary` is the GROB to 
override to color the parenthesized accidentals you get with 
`\accidentalStyle teaching`.


-Paul


%%%

\version "2.21.0"
\new Staff {
  \key g \major
  \accidentalStyle teaching
  \override AccidentalCautionary.color = #red
  { fis' f' }
}

%%%



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


Template for flexible vertical spacing \paper variables

2019-03-02 Thread Paul Morris

I got tired of looking up the flexible vertical spacing \paper variables:

http://lilypond.org/doc/v2.19/Documentation/notation/flexible-vertical-spacing-paper-variables

So I put together some boilerplate (below) that I can use as a snippet 
in Frescobaldi.  Just un-comment the lines and tweak as needed.  
Overkill?  Probably, but I don't mind.  Sharing in case someone else 
wants to use it.


Cheers,
-Paul


\paper {


  % markup-system-spacing =
  % #'((basic-distance . 5) (padding . 0.5) (stretchability . 30))
  % #'((basic-distance . 5) (padding . 0.5) (stretchability . 30)) % 
default

  % from a (top-level) markup to a system

  % score-markup-spacing =
  % #'((basic-distance . 12) (padding . 0.5) (stretchability . 60))
  % #'((basic-distance . 12) (padding . 0.5) (stretchability . 60)) % 
default

  % from the last system of a score to a (top-level) markup

  % score-system-spacing =
  % #'((basic-distance . 14) (minimum-distance . 8) (padding . 1) 
(stretchability . 120))
  % #'((basic-distance . 14) (minimum-distance . 8) (padding . 1) 
(stretchability . 120)) % default

  % from the last system of a score to the first system of the next score
  % when no (top-level) markup exists between them

  % system-system-spacing =
  % #'((basic-distance . 12) (minimum-distance . 8) (padding . 1) 
(stretchability . 60))
  % #'((basic-distance . 12) (minimum-distance . 8) (padding . 1) 
(stretchability . 60)) % default

  % between two systems in the same score

  % markup-markup-spacing =
  % #'((basic-distance . 1) (padding . 0.5))
  % #'((basic-distance . 1) (padding . 0.5)) % default
  % between two (top-level) markups

  % last-bottom-spacing =
  % #'((basic-distance . 1) (minimum-distance . 0) (padding . 1) 
(stretchability . 30))
  % #'((basic-distance . 1) (minimum-distance . 0) (padding . 1) 
(stretchability . 30)) % default
  % from the last system or top-level markup on a page to the bottom of 
the printable area

  % (i.e., the top of the bottom margin)

  % top-system-spacing =
  % #'((basic-distance . 1) (minimum-distance . 0) (padding . 1))
  % #'((basic-distance . 1) (minimum-distance . 0) (padding . 1)) % default
  % from the top of the printable area (i.e., the bottom of the top margin)
  % to the first system on a page, when there is no (top-level) markup 
between the two


  % top-markup-spacing =
  % #'((basic-distance . 0) (minimum-distance . 0) (padding . 1))
  % #'((basic-distance . 0) (minimum-distance . 0) (padding . 1)) % default
  % from the top of the printable area (i.e., the bottom of the top margin)
  % to the first (top-level) markup on a page, when there is no system 
between them


}



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


Re: Please test new lilypond installers

2019-01-29 Thread Paul Morris

On 1/29/19 1:24 PM, David Kastrup wrote:


Paul Morris  writes:


On 1/29/19 4:19 AM, Knut Petersen wrote:


lilypond-2.21.0-1.linux-64.sh

Installed on Ubuntu 18.04.1 LTS and tested with a couple of
pieces. Everything appears to be working fine.

Thanks to all for the work on GUB and the next stable LilyPond release!

Well, 21.0 is the next unstable release...


Ah, yes, I didn't intend to imply otherwise, but I see how what I wrote 
could have been misleading.  (I was just thinking along the lines of 
'work on GUB contributes to the release of the next stable', but I may 
not be fully aware of all the details there.)


Thanks for the clarification.

-Paul


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


Re: Please test new lilypond installers

2019-01-29 Thread Paul Morris

On 1/29/19 4:19 AM, Knut Petersen wrote:


lilypond-2.21.0-1.linux-64.sh


Installed on Ubuntu 18.04.1 LTS and tested with a couple of pieces. 
Everything appears to be working fine.


Thanks to all for the work on GUB and the next stable LilyPond release!

-Paul


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


Re: lilypond.org Productions page

2018-12-11 Thread Paul Morris

On 12/10/18 5:07 PM, Federico Bruni wrote:


I've just remembered another one, Paul Morris' Clairnote sheets:
https://clairnote.org/sheet-music/


Oh, I like that one! :-)

This free "Anthology of Melodies for Sight-Singing" would be good to 
include:

http://www.lightandmatter.com/sight/sight.html

-Paul



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


Re: Automatically set the page size to fit the music

2018-04-15 Thread Paul Morris

Hi Robert,

On 04/15/2018 11:56 AM, Robert Hickman wrote:

I'm using 2.18 but -dpreview seems to do what I want.


Okay, yeah that works as long as the music fits on the first system on 
the page.  These other features will work when the music is longer than 
that.


-Paul

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


Automatically set the page size to fit the music

2018-04-15 Thread Paul Morris

Hi,

On 04/15/2018 10:56 AM, Robert Hickman wrote:
> I'm trying to set the page size so that it automatically
> matches the size of the staff with zero margins.

Take a look at "One-page page breaking" and "One-line-auto-height page 
breaking":


http://lilypond.org/doc/v2.19/Documentation/notation/page-breaking#index-ly_003aone_002dpage_002dbreaking

These features are in LilyPond 2.19 (not in LilyPond 2.18).

(Changed subject from "Defining custom symbols".)

-Paul



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


Re: calling lilybin (or similar) as a service triggered from a [JavaScript?] form in a web page

2018-03-27 Thread Paul Morris

On 03/13/2018 11:54 AM, Kieren MacMillan wrote:

Hello all,  Has anyone tried to set up a form (e.g., Javascript) in a web page 
which, when submitted, triggers a Lilypond-on-server (LoS?) 
application/environment (e.g., lilybin.com) and returns a PDF?

I'd like to offer some music and music education documents and templates on my 
website, but (a) don’t want to show my Lilypond code, and (b) if possible, 
avoid installing and maintaining the Lilypond server installation myself.

Thanks for any hints/advice/pointers.


Hi Kieren,

I've done something in roughly the same ballpark by creating a version 
of LilyBin for Clairnote music notation:


http://lilybin.clairnote.org/

Not sure if it makes sense for your use case, but check out this blog 
post for more details.


http://clairnote.org/blog/2017/06/announcing-lilybin-clairnote/

Cheers,
-Paul


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


Re: SVG output - Group multiple grobs together

2018-01-11 Thread Paul Morris

Hi James,  I'm cc'ing the user list, as per the usual custom.


On 01/11/2018 08:13 AM, James Opstad wrote:


Thanks. I will work through David's example. It seems it isn't 
possible to embed more than one item within a group and one group per 
grob is the only approach for the time being. If this is the case then 
why use groups rather than adding the attributes to the grob itself?




Good question.  I think it's because some grobs produce more than one 
glyph, path, or shape in the SVG, so the groups group these together as 
one thing.  Might be interesting to explore feasibility of conditionally 
adding groups only when needed (for grobs with multiple shapes) and 
otherwise adding properties to the (single) SVG shapes themselves.


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


Re: Non-standard ledger lines and articulations collisions

2018-01-11 Thread Paul Morris

On 01/11/2018 04:20 AM, David Kastrup wrote:


Or let grob-transformer do all of the work.


Thanks for the tip!  That's the perfect tool for the job.  And I can 
also use it for other cases where I have been using 
before-line-breaking.  For the archives, below is the example expanded 
to show ly:unpure-call and grob-transformer.


Paul

%%

\version "2.19.63"

m = {
  c'''
  c'''\fermata
  c'''\trill
  c'''-^
  c'''-.
  c'''\segno
}

% collisions ahead!
{
  \override Staff.StaffSymbol.ledger-extra = 2
  \m
}

% using ly:unpure-call
{
  \override Staff.StaffSymbol.ledger-extra = 2
  \override Staff.Script.Y-offset =
  #(lambda (grob)
 (+ 1 (ly:unpure-call side-position-interface::y-aligned-side grob)))
  \m
}

% using grob-transformer from scm/music-functions.scm
{
  \override Staff.StaffSymbol.ledger-extra = 2
  \override Staff.Script.Y-offset =
  #(grob-transformer
    'Y-offset
    (lambda (grob default-value) (+ 1 default-value)))
  \m
}

%%




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


Re: Non-standard ledger lines and articulations collisions

2018-01-10 Thread Paul Morris

On 01/10/2018 10:57 AM, David Kastrup wrote:


You are missing the difference between
ly:side-position-interface::y-aligned-side and
side-position-interface::y-aligned-side .

The latter is defined in scm/output-lib.scm as

(define-public side-position-interface::y-aligned-side
   (ly:make-unpure-pure-container
ly:side-position-interface::y-aligned-side
ly:side-position-interface::pure-y-aligned-side))


So am I missing something or are the docs off for Script.Y-offset?

The docs are autogenerated and cannot be off with regard to listed
default values.


Is a call to "(ly:side-position-interface::y-aligned-side grob)"
actually the default call to use?

You are better off with
(ly:pure-call side-position-interface::y-aligned-side grob start end)
or
(ly:unpure-call side-position-interface::y-aligned-side grob)
depending on what you need.

Or of course calling ly:side-position-interface::y-aligned-side and
ly:side-position-interface::pure-y-aligned-side directly.


Thank you David!  That clears up most of my confusion.  Should have 
realized there was a difference between those two procedures.  I'd still 
like to look further into what's going on with the unpure-pure-container 
stuff, as I currently only have a vague sense of it.  Then maybe I'll 
have a better handle on whether to use the pure or unpure call for this 
case. (Or, I wonder, if it would make sense to do wrapped/custom 
versions of both and then combine them with 
ly:make-unpure-pure-container , so it more closely parallels the default 
situation?)


Thanks again,
Paul




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


Re: SVG output - Group multiple grobs together

2018-01-10 Thread Paul Morris

On 01/10/2018 06:51 AM, James Opstad wrote:
How would I include multiple grobs within the same group e.g. all the 
grobs associated with a single note (NoteHead, Stem, Accidental etc.)?


Hi, I don't think there is currently a way to do that.  You could give 
each grob you want to group together the same id.  Your SVG will not be 
as concise or elegant (one group per grob), but it might be a way to get 
the job done.


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


Non-standard ledger lines and articulations collisions

2018-01-10 Thread Paul Morris
Hi all,  I'm working on a work-around for a collision between ledger 
lines and articulations, for Clairnote an alternative notation system: 
http://clairnote.org/sn/  LilyPond does not currently take non-standard 
'extra' ledger lines into account when positioning articulations.  
Here's a minimal example with a proof of concept for a possible work-around:


%%

\version "2.19.63"

m = {
  c'''
  c'''\fermata
  c'''\trill
  c'''-^
  c'''-.
  c'''\segno
}

% collisions ahead!
{
  \override Staff.StaffSymbol.ledger-extra = 2
  \m
}

% wrap the usual Script.Y-offset procedure in another
% one to make an adjustment to what it returns, to
% avoid the collisions
{
  \override Staff.StaffSymbol.ledger-extra = 2
  \override Staff.Script.Y-offset =
  #(lambda (grob)
 (+ 1 (ly:side-position-interface::y-aligned-side grob)))
  \m
}

%%

Here's my specific question.  The docs say this for the Y-offset 
property of the Script object:


|Y-offset| (number):

   |# # >|

   The vertical amount that this object is moved relative to its Y-parent.

http://lilypond.org/doc/v2.19/Documentation/internals/script

But in the source code, in 'scm/define-grobs.scm', for the Script grob I 
see no mention of unpure-pure-container:


(Y-offset . ,side-position-interface::y-aligned-side)

I see other grob properties in that file that do have the 
unpure-pure-container pattern, like Rest.Y-extent:


(Y-extent . ,(ly:make-unpure-pure-container ly:rest::height 
ly:rest::pure-height))


So am I missing something or are the docs off for Script.Y-offset? Is a 
call to "(ly:side-position-interface::y-aligned-side grob)" actually the 
default call to use?


(On the other hand, maybe it would work to change the Y-parent of Script 
grobs to be the ledger lines grob in cases where there are ledger lines 
that are further from the staff than the furthest note head?)


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


Re: Choice of pitch input mode

2016-05-01 Thread Paul Morris
> On May 1, 2016, at 8:38 AM, Paul Morris <p...@paulwmorris.com> wrote:
> 
> I just tried it and it requires the explicit reference pitch like:  \fixed 
> c’’ { … } 

…and that makes sense because the first note may not be in the base octave.

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


Re: Choice of pitch input mode

2016-05-01 Thread Paul Morris
> On May 1, 2016, at 3:46 AM, Johan Vromans  wrote:
> 
> Can this also be written as:
> 
> \fixed {
>  \key a \major
>  \time 6/8
>  cis''8. d16 cis8 e4 e8 |
>  b,8. cis16 b,8 d4 d8 |
> }
> 
> just like \relative?

No, I just tried it and it requires the explicit reference pitch like:

\fixed c’’ { … } 

(Like relative used to.)

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


Re: Choice of pitch input mode

2016-04-30 Thread Paul Morris
> On Apr 29, 2016, at 6:56 PM, Jeff Olson  wrote:
> 
> And for the limited range of a guitar (3.5 octaves) I can \transpose c c'
> to minimize the number of octave marks in absolute mode (so range is e, to 
> b'').
> Thus I never encounter long high runs of 32nds above c'''.

The latest dev version (LilyPond 2.19.x) also has a \fixed mode that lets you 
set a default octave which saves typing, providing some of the advantages of 
both \relative and \absolute.

For example:

{
  \key a \major
  \time 6/8
  cis''8. d''16 cis''8 e''4 e''8 |
  b'8. cis''16 b'8 d''4 d''8 |
}

\fixed c'' {
  \key a \major
  \time 6/8
  cis8. d16 cis8 e4 e8 |
  b,8. cis16 b,8 d4 d8 |
}

From:
http://lilypond.org/doc/v2.19/Documentation/learning/absolute-note-names.en.html

It looks like \fixed is not mentioned in the changes list yet:
http://lilypond.org/doc/v2.19/Documentation/changes/index.html

Cheers,
-Paul


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


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Paul Morris
> On Apr 24, 2016, at 11:15 AM, David Kastrup <d...@gnu.org> wrote:
> 
> Paul Morris <p...@paulwmorris.com> writes:
> 
>> IIUC, wouldn’t the first step be, in any case, to get LilyPond’s
>> python scripts working on python 2.7?
> 
> Which ones _aren't_ working with Python 2.7?  I run a number of them
> routinely, and I just converted some file with midi2ly as well.

Sorry, my words weren’t very precise.  I don’t know of any scripts that aren’t 
working with 2.7.

I jus wanted to make the point that since the LilyPond binaries ship with an 
earlier python version and that GUB still uses 2.4 (as mentioned earlier in the 
thread) that getting those things successfully upgraded to python 2.7 would be 
the first step to take (regardless of how we handle the transition to python 3).

(Of course, you’re right that the transition to guile 2 is a much higher 
priority, but it seems we could use any help we can get wherever we can get it.)

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


Re: Python 3, was Re: ANN: Frescobaldi 2.19.0

2016-04-24 Thread Paul Morris
IIUC, wouldn’t the first step be, in any case, to get LilyPond’s python scripts 
working on python 2.7?  Then at that point we could discuss and decide about 
whether it’s better to switch to python 3 or to support both 2.7 and 3.

Searching the LilyPond source code for files with extension “.py” turns up 
about 73 files, if anyone’s interested in a rough estimate of the scope.

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


Re: What is the proper way of programmatically generating markup?

2016-04-23 Thread Paul Morris
> On Apr 23, 2016, at 11:00 PM, Matt Hood  wrote:
> 
> **So my second question is: How do I programmatically generate markup from 
> information taken from a list, and then put it into a single markup 
> variable?**

Hi again,  I’d suggest looking at snippets in the LSR, searching for "time 
signature", if you haven’t yet, .  This one looks like it might be helpful:

http://lsr.di.unimi.it/LSR/Snippet?id=743

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


Re: What is the proper way of programmatically generating markup?

2016-04-23 Thread Paul Morris
> On Apr 23, 2016, at 11:00 PM, Matt Hood  wrote:
> 
> does anyone know where can I find the source (scm or otherwise) for 
> \compoundMeter?


You’ll find it in ly/music-functions-init.ly  

Hope that helps,
-Paul___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: ANN: Frescobaldi 2.19.0

2016-04-22 Thread Paul Morris
Hi Andrew,

> On Apr 22, 2016, at 8:12 PM, Andrew Bernard  wrote:
> 
> The 2.19 release seems premature. The contents of the tar file have code that 
> clearly refers to Qt4.

Um, so... 2.19 still uses Qt4.  In the future, version 3.0 will require Qt5 
(and Python3).  

Hope that helps,
-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: I'm not smart enough to figure out the math for this.

2016-04-04 Thread Paul Morris
> On Mar 9, 2016, at 6:27 PM, David Kastrup  wrote:
> 
> \version "2.19.28"
> 
> show =
> #(define-music-function (mup item) (markup? symbol-list-or-music?)
>  (propertyTweak 'stencil
>   (lambda (grob)
>(grob-interpret-markup grob mup))
>   item))
> 
> \relative c' \new Staff {
>  \show \markup \compound-meter #'(4 . 3)
>  \time 3/4
>  c4 c c | c c c
> }
> 
> Maybe we should have \show (possibly with a different name) as a nice
> supplement to \omit/\hide.

This seems like a good idea to me.  Previously when this was discussed, I 
argued that the function should take a stencil as well as a markup and maybe a 
procedure too…  but I now see the sense in just providing a simple and 
high-level shortcut that takes a markup.  (And “ \markup \stencil sss “ still 
allows use of stencils.)

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-04 Thread Paul Morris
> On Apr 4, 2016, at 6:46 AM, Bernard  wrote:
> 
> I have attached some more real live code using /with and and example I tried 
> to skip the /with section and assign properties directly, which fails.

Here’s how to fix your example (without \with) that was not working:

\score {
  \new DrumStaff {
\override DrumStaff.StaffSymbol.line-count =  #3
\set DrumStaff.instrumentName = #"Djembe 2"
\set DrumStaff.drumStyleTable = #(alist->hash-table djembe)
\djEen
  }
}

As others have mentioned, reading the Learning Manual is a good idea, and 
should answer many of your questions.

http://lilypond.org/doc/v2.18/Documentation/learning/index.html

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-03 Thread Paul Morris
> On Apr 3, 2016, at 11:53 AM, Paul Morris <p...@paulwmorris.com> wrote:
> 
> This should help:
> http://lilypond.org/doc/v2.18/Documentation/notation/changing-context-default-settings#index-_005cwith-3

See also:
http://lilypond.org/doc/v2.18/Documentation/notation/modifying-context-plug_002dins#index-_005cwith

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


Re: Lilypond structure / implicit - explicit / with statement

2016-04-03 Thread Paul Morris
Hi Bernard,

> On Apr 3, 2016, at 10:59 AM, Bernard  wrote:
> 
> All boils down to what is the \with statement. 

This should help:
http://lilypond.org/doc/v2.18/Documentation/notation/changing-context-default-settings#index-_005cwith-3

I found that section by looking for “\with” in the notation reference index:
http://lilypond.org/doc/v2.18/Documentation/notation/lilypond-index

You can search that index page quickly by using your browsers “find” command to 
look for the command you’re interested in on that page.  This approach has 
served me well for finding relevant documentation.

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


Re: Fonts from the former fonts.openlilylib.org

2016-03-27 Thread Paul Morris
> On Mar 27, 2016, at 4:13 AM, tisimst  wrote:
> 
> I have considered Patreon before, but before I jump into that, does anyone 
> else have any other suggestion? 

Gratipay (formerly Gittip) is worth considering: https://gratipay.com/

It is more radical than Patreon insofar as: "Gratipay is funded on Gratipay. We 
don't take a cut of payments (though we do pass through processing fees at 
cost).”  from https://gratipay.com/about/
 
Also, they are now organized around teams and what they call “open-work”.  It’s 
an interesting model, one that may or may not fit your particular case.

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


Re: Piano_Tab Notation; Tie customization

2016-03-11 Thread Paul Morris
Hi Philip,

> On Mar 10, 2016, at 3:40 PM, Philip Bergwerf  
> wrote:
> 
> i was thinking about tweaking
> the ties. Is it possible in lilypond to make a horizontal straight line
> between tied notes? 

I’m pretty sure tie shapes can be customized.  Maybe take a look at this 
snippet, although it is for slurs:

http://lsr.di.unimi.it/LSR/Item?id=777

Or the other snippets that come up with an LSR search for “shape”.

Maybe that helps,
-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Piano_Tab Notation; questions ;-)

2016-03-11 Thread Paul Morris
Hi Philip,

Glad you found the information on the MNP site helpful.  I’ve been down many of 
these paths in order to get LilyPond to support Clairnote music notation 
(http://clairnote.org).  (At some point you might want to look at my 
clairnote-code.ly file (http://clairnote.org/software/).)

More below...

> On Mar 10, 2016, at 4:12 PM, Philip Bergwerf  
> wrote:
> 
> 1. how can i place the rests in a custom default position? When writing low
> on a staff i want a rest also low on the staff. and i think it would be more
> clear if rests from voice two are always placed down and for voice one up.
> How to do this?

See the attached .ly file with some old code that shows a way to do this.  
You’ll need to get fairly fluent in scheme to do everything that you'll want to 
do.

> 2. I made this custom staff using
> %begin
> \override Staff.StaffSymbol #'line-positions = #'(enter line positions)
> %end
> .
> Sometimes the note is not fitting on the staff so i have to change the key
> or make some extra lines. (look at bar 79) I did this by the following code:
> %begin
> \stopStaff \override Staff.StaffSymbol #'line-positions = #'(21 19 16 14 12
> 9 7 4 2 0 -2.8 -3 -3.2 -4.8 -5 -5.2 -8 -10 -12 -15 -17 -20 -22 -24 -27 -29
> -32 -34 -36) \startStaff
> %end
> This is a lot of text. Is there a way to increase text when changing the
> number of stafflines? 

You can store it all in a variable and then just use that.

%%%

\version "2.19.36"

myLinePositions = {
  \stopStaff 
  \override Staff.StaffSymbol #'line-positions = #'(21 19 16 14 12
9 7 4 2 0 -2.8 -3 -3.2 -4.8 -5 -5.2 -8 -10 -12 -15 -17 -20 -22 -24 -27 -29
-32 -34 -36) 
  \startStaff
}

{ 
  c d e f 
  \myLinePositions
  c d e f
}

%%%



> 3. Is it possible to make you own for example \pianotabStaff?

Search the LSR for "Defining a Custom Staff Context"
http://lsr.di.unimi.it/LSR/Search

HTH,
-Paul




rests-vertical-position.ly
Description: Binary data



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


Re: Accessing Context Properties

2016-02-25 Thread Paul Morris
Hi Abraham,

> On Feb 25, 2016, at 12:28 PM, tisimst  wrote:
> 
> I'm asking this because I know that if I can get my hands on a grob, I know 
> how to access its properties (with ly:grob-property) and use that property's 
> value to make a change if I want (e.g., with ly:grob-set-property!). I just 
> don't know the equivalent process for getting my hands on a context to access 
> its properties. I know there's ly:context-property, but I just don't have as 
> much experience with it as normal grobs.

You may want a custom engraver, as they have access to contexts and context 
properties.

As I understand it there are three main ways of intervening:

1. music functions (and scheme, void, and markup functions)
2. custom engravers
3. grob property callback procedures

1: let you do fancy things with the input, early on, before LilyPond processes 
it
3: let you do things with graphical output very late in the game
2: are earlier than 3, exist within contexts and thus have access to context 
properties (and can do things with grobs as well like with 3)

As far as I know context properties can’t be accessed from a grob callback and 
not from music functions as David has said.  So that leaves custom engravers 
(although I don’t really know how \applyContext fits into this).

Maybe that helps?
-Paul

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


Re: Using path expressions to override stencils

2016-02-16 Thread Paul Morris
Hi Paul, 

If you are using 2.19 you might want to use "make-path-stencil” instead.  (It 
is not in 2.18 and so not in the LSR yet. Although maybe we should add it 
commented out?)  It calculates the extents of the stencil for you so you don’t 
have to specify them.  See below.

Cheers,
-Paul


\version "2.19.36"

customClefStencilOne =
#(ly:make-stencil
  `(path 0.2
 `(rmoveto 0 0
rcurveto 0 0.75 1 0.75 1 0
rcurveto 0 -0.75 -1 -0.75 -1 0
rcurveto -1 0 -1 1.5 -0.5 1.5
rmoveto 0.5 -1.5
rcurveto -1 0 -1 -1.5 -0.5 -1.5
rmoveto 0.5 1.5
rmoveto 1 0
rcurveto 2.5 0 2.5 4 4 4
rmoveto -4 -4
rcurveto 2.5 0 2.5 -4 4 -4))
  (cons -0.5 1)
  (cons -3 5))

customClefStencilTwo =
#(make-path-stencil
  '(rmoveto 0 0
 rcurveto 0 0.75 1 0.75 1 0
 rcurveto 0 -0.75 -1 -0.75 -1 0
 rcurveto -1 0 -1 1.5 -0.5 1.5
 rmoveto 0.5 -1.5
 rcurveto -1 0 -1 -1.5 -0.5 -1.5
 rmoveto 0.5 1.5
 rmoveto 1 0
 rcurveto 2.5 0 2.5 4 4 4
 rmoveto -4 -4
 rcurveto 2.5 0 2.5 -4 4 -4)
  0.2 ;; line thickness
  1 ;; x-axis scaling factor
  1 ;; y-axis scaling factor
  #f ;; filled path or not?
  )

\markup \stencil #customClefStencilOne
\markup " "
\markup " "
\markup \stencil #customClefStencilTwo





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


Re: Using path expressions to override stencils

2016-02-16 Thread Paul Morris
> On Feb 16, 2016, at 8:35 AM, Paul Booker  wrote:
> 
> I've only narrowed the problem down to the function

Hi Paul,  Can you send a full but tiny example that we can run/test with 
LilyPond?  See:

http://lilypond.org/tiny-examples.html

That will make it easier to see what’s going on.

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


Re: Detect slurred notes in callback function

2016-02-11 Thread Paul Morris
> On Feb 7, 2016, at 5:42 PM, David Nalesnik  wrote:
> 
> Slur grobs store a pointer to an array of NoteColumns they encompass.  So, 
> expanding on Paul's solution, you could do something like this:

Very nice solution!  Might be worth an LSR snippet as a good example of this 
kind of grob to grob access.

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


Re: list of thicknesses affected by changing StaffSymbol.thickness

2016-02-08 Thread Paul Morris
> On Jan 31, 2016, at 5:15 PM, Simon Albrecht  wrote:
> 
> I do think that it should be easier to override staff line thickness in a 
> style sheet without changing other line thicknesses.

This would indeed be a good thing.  In the meantime, this snippet shows a 
possible workaround/hack:

http://lsr.di.unimi.it/LSR/Item?id=277

You may have to hold your nose, although it’s probably more foolproof than 
trying to do an inverse setting for everything affected by line-thickness.

To make things easier, I can imagine a user function that returns a list of 
line positions based on a thickness argument (and maybe optionally a line 
pattern list).  So for a staff with a single line at position '(2) it would 
return '(1.9  2  2.1) or maybe just '(1.9  2.1) when given a thickness argument 
of 0.2

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


Re: list of thicknesses affected by changing StaffSymbol.thickness

2016-02-08 Thread Paul Morris
> On Feb 8, 2016, at 11:33 AM, Paul Morris <p...@paulwmorris.com> wrote:
> 
> To make things easier, I can imagine a user function that returns a list of 
> line positions based on a thickness argument (and maybe optionally a line 
> pattern list).  So for a staff with a single line at position '(2) it would 
> return '(1.9  2  2.1) or maybe just '(1.9  2.1) when given a thickness 
> argument of 0.2

\version "2.18.2"

#(define (thicker-line-positions thick pattern)
   (let ((th (/ thick 2)))
   (append-map 
(lambda (ln) (list (- ln th) ln (+ ln th)))
pattern)))

% #(display (thicker-line-positions 0.1 '(-4 -2 0 2 4)))
% displays:  (-4.05 -4 -3.95 -2.05 -2 -1.95 -0.05 0 0.05 1.95 2 2.05 3.95 4 
4.05)

#(define (line-positions-callback thick pattern)
   (lambda (grob) 
 (thicker-line-positions thick pattern)))


\relative {
  c'1 c c c 
}

\relative {
  \override Staff.StaffSymbol.line-positions =
  #(lambda (grob) (thicker-line-positions 0.2 '(-4 -2 0 2 4)))
  c'1 c c c 
}

\relative {
  \override Staff.StaffSymbol.line-positions =
  #(line-positions-callback 0.2 '(-4 -2 0 2 4))
  c'1 c c c 
}

%%

If we wanted to get extra fancy, we might be able to get the line-thickness 
property from the grob, and then use that to calculate things... such that when 
you entered X as a thickness input it would result in the same line thickness 
as entering X directly as a line-thickness value.  

…or there’s visual eyeballing and trial and error with the above.

Cheers,
-Paul 






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


Re: Detect slurred notes in callback function

2016-02-07 Thread Paul Morris
Hi Jakub,

FWIW, here’s another approach that starts from slurs and goes to note heads.  
(Adapted from some code for tied notes where this works a little more cleanly 
since ties connect to note heads directly rather than to note columns…)  

Unfortunately, this one also doesn’t color notes in the middle of slurs, only 
those on the ends.  And Harm’s code that deals with note heads directly is 
probably better for addressing that.

Cheers,
-Paul




\version "2.19.36"

#(define (color-slur-notes grob)
   (let*
((right-note-col (ly:spanner-bound grob RIGHT))
 (left-note-col (ly:spanner-bound grob LEFT))
 
 (right-notes (ly:grob-array->list 
   (ly:grob-object right-note-col 'note-heads)))
 
 (left-notes (ly:grob-array->list
  (ly:grob-object left-note-col 'note-heads)))
 
 (color-notes (lambda (n) (ly:grob-set-property! n 'color red

; (display right-notes)(newline)

(for-each color-notes right-notes)
(for-each color-notes left-notes)
))

\score {
  \relative c'' {
\override Staff.Slur.before-line-breaking = #color-slur-notes
a a
a( a)
a( a a)
  }
}


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


Re: Super and sub

2016-02-07 Thread Paul Morris
> On Feb 7, 2016, at 8:50 AM, Phil Holmes  wrote:
> 
> I wasn't aware that git-cl "always fails".  Could you describe the problem 
> and provide a traceback?
> 
> Is everyone having the same problem?

It has been working fine for me.  (I think I remember once where it didn’t 
create or update the Allura issue?)

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


Re: Removing white space from svg output

2016-02-01 Thread Paul Morris
> On Feb 1, 2016, at 8:00 PM, Paul Booker  wrote:
> 
> Interesting!
> I had a go, guessing with 
> 
>paper-height=#(one-line-auto-height-breaking)

Try this:

%

\version "2.19.36"

\paper {
  page-breaking = #ly:one-line-auto-height-breaking
}

{ c1 }

%

The syntax is documented on that page in the Notation Reference that I linked 
to in my previous message.

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


Re: Removing white space from svg output

2016-02-01 Thread Paul Morris
> On Feb 1, 2016, at 10:15 PM, Paul Booker  wrote:
> 
> Ok, that wasn't clear, got it now, thanks
> Works for one-line parts but also converts two line pieces to one line,
> ignoring the \break. Can I reinstate that somehow, without the white-space?

Not with this function.  It puts everything on one line.  The 
ly:one-page-breaking function should do what you want, but it’s still in 
development, not released yet.

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


Re: Removing white space from svg output

2016-02-01 Thread Paul Morris
Hi Paul,

> On Feb 1, 2016, at 7:36 AM, paul booker  wrote:
> 
> Can anyone see this becoming a scheme function which could sit in my
> defs.ily file and save this ugly step?
> I guess I mean an internal to Lilypond rather than external solution.
> I'm not at all familiar with Scheme, but I did peek at "svg-output.scm". I
> can't find the equivalent for png output.

These are timely questions.  See ly:one-line-auto-height-breaking 

http://lilypond.org/doc/v2.19/Documentation/notation/page-breaking#one_002dline_002dauto_002dheight-page-breaking

which just landed in the LilyPond development release, 2.19.36

There’s also (in the works) a similar ly:one-page-breaking function that will 
set the paper height to fit the music.  

http://sourceforge.net/p/testlilyissues/issues/4752/

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


no-ledgers not working with NoteHead.before-line-breaking

2016-01-28 Thread Paul Morris
Any ideas why this doesn’t work?  Thanks, -Paul

\version “2.19.35"

% works:
{
  \override NoteHead.no-ledgers = ##t
  c c c c
}

% nope:
{
  \override NoteHead.before-line-breaking = 
  #(lambda (grob) (ly:grob-set-property! grob 'no-ledgers #t))
  c c c c
}



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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 5:35 AM, Chris Yate  wrote:
> 
> BTW, is there a standard term for non-accidental notes?  You would think it 
> would be “natural notes” but sometimes natural notes are also accidental 
> notes.
> 
> In a chromatic scale, what are the accidental notes? They're certainly NOT 
> notes with a sharp or flat, since you may already be in a key signature with 
> those notes.

Well, right, that is my point.  Accidental notes are notes that aren’t in the 
current key (signature).  These are different distinctions:

1. sharp/flat notes & natural notes

2. notes not in the key (accidental notes) & notes in the key (???)

I don’t know that there's any term that’s the complement to “accidental notes” 
(besides writing out “notes in the key”).

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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 4:35 AM, David Kastrup  wrote:
> 
> CBA player here.  The problem I see is more one that such "even
> notation" doesn't match well with our standard tonalities.  Play a C
> major scale.  Now do an accompaniment in "Küchenmädchenterzen", namely
> just play the same melody a third up or a sixth below.

You mean like a modal transposition, where you stay in the same scale / key but 
just start the melody from a different note, right?

> Now write down what you just did in any chromatic notation and try
> understanding its irregular patterns of major and minor intervals.

This is a fair point.  Partly that's because such systems are optimized more 
for reading than writing (especially writing in a diatonic tonality / scale / 
key).  

If the music is already written out, then you can easily see and understand the 
pattern of major and minor intervals, and with experience would learn to 
recognize that it’s the same melody just at a different place in the scale.

In Clairnote you know which notes are in the key because there are 
(alternative) accidental signs that indicate when notes are accidentals (i.e. 
not in the key).  Also, Clairnote's key signatures help by showing the notes in 
the current key / scale, a reminder and aide when reading and writing.

Cheers,
-Paul


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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 5:40 AM, Chris Yate  wrote:
> 
> Unless they spend their lives playing on their own at home, musicians have 
> eventually to play with other people who will have learnt a method of 
> notation that's been good for 400 years.

Yikes, it’s not that grim.  One can always:

1. Learn to read more than one system.  (Bilingualism is not a bad thing, even 
for kids.)

2. Bring your own sheet music in your preferred system.  

I do both.  LilyPond and this whole digital media thing make #2 much easier.  
But I agree that opt-in is the best way.  So yes, teach children to read the 
traditional system.  Learning another one should be extra and by choice.

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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 7:35 AM, Chris Yate  wrote:
> 
> As it is, when I mark up confusing music I sometimes use an upside-down "V" 
> to indicate semitones, "=" to indicate 'same note' and a square bracket (like 
> upside down "|__|") between notes to indicate a tone. This is occasionally 
> useful to me as an aide-memoire, in stuff where we have lots of double-sharps 
> and flats, but it's certainly not "standard".

I can’t help but point out, just FWIW, and intending this in a tone of respect, 
and as one consideration among a host of others that might outweigh it...

...that this kind of annotation wouldn’t be needed in a system where the 
differences between intervals (semitone, tone, others...) were clearly and 
consistently represented.  

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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 7:45 AM, David Kastrup  wrote:
> 
> Sharon Rosner  writes:
> 
>> But seriously, I see no reason to change a system which works so well
>> for so many different kinds of music. All these alternative systems, I
>> don't see what advantage they offer. On the contrary, there are many
>> downsides - they're unsuitable for keyboards,
> 
> Piano keyboards.  Chromatic button accordions would likely benefit, as
> would Janko keyboards.

I’d also add guitars, most string instruments, and any other isomorphic 
instruments:

http://musicnotation.org/wiki/instruments/isomorphic-instruments/

Although, I wouldn’t say “unsuitable” but maybe just "a little less ideal" for 
traditional 7-5 keyboard layouts, especially if you color them (or just 
conceive of them) in this way:

http://musicnotation.org/wiki/instruments/6-6-colored-traditional-7-5-keyboard/


>> unsuitable for tonal music,
> 
> Not "unsuitable" as much as intransparent.  It's harder to see the
> tonality.

Yes, or you could say they provide a different perspective on the tonality of 
tonal music, by revealing the interval patterns behind it, which also happen to 
be the interval patterns you have to play on an instrument to produce it.

Cheers,
-Paul



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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 8:18 AM, Sharon Rosner  wrote:
> 
> Of all alternative systems discussed on this thread, the only one which is
> really appropriate for transposition is the "Lines a Whole Step Apart"
> system (http://musicnotation.org/systems/gallery/). There it is just a
> matter of moving the clef or switching the clef.
> 
> The rest of them use either special note shapes for sharps/flats
> ("Clairnote", "Simplified notation"), which is not any better for
> transposition, or special note shapes for the in-between notes ("Twinline
> Notation"). 
> 
> The OP's system uses Four vertical positions between staff lines (including
> on-the-line). How do you transpose that by half a step?

I see what you’re saying.  Seems to me that transposing on the fly is generally 
not an easy thing to do in any case, without a lot of practice.

Transposing by an octave is actually really easy in Clairnote.  Transposing by 
a major 3rd (or minor 6th) would be as easy as transposing by a semitone in a 
“Lines a Whole Step Apart” system, since the lines are that far apart.  
Transposing by a whole step would be next easiest, but...

Ultimately, I think you would learn to read and play by intervals and do it 
that way.  Making it easier to read by intervals is a strength of these systems.

> In contrast, in traditional notation you can easily transpose by moving or
> changing the clef and changing the key signature.

Well, there’s a lot of work that goes into getting to the point where this is 
easy.

> Admittedly this is harder
> today with the modern accidental display practice (displayed once per bar),
> but 300 years ago musicians were able to do this on sight by imagining an
> alternative clef and key signature. See also the practice of Chiavette or
> chiavi transportate - transposition clefs.

Hmmm… Seems like this primarily works for music without accidentals.  Does it 
really work when you have a lot of accidentals?

Say a note that was a natural in the first key is a sharp in the new key…  in 
the music that note appears altered by a sharp sign…  you have to read that 
sharp sign as if it were a double sharp sign.  

Or, say a note was a sharp in the first key, but is a natural in the second 
key…  and that note appears in the music altered by a natural sign…  you have 
to read that natural sign as a flat sign.  

Or am I missing something?

-Paul

P.S. To musicus, apologies that this conversation has expanded beyond your 
proposal…  It seems I have a lot to say on this topic.  I’ll try to pipe down...



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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 4:49 AM, musicus  wrote:
> 
> I really admire the effort and courage of alternative notation systems, but I 
> cannot see a reasonable improvement in this case. I don't think it's a good 
> idea to remove all great advantages, which our standard notation system has. 
> IMO, there are only a few problems to be solved - chromatic scales are one of 
> them - with as little as possible interfering with the remaining music.

Thanks for your thoughts.  All systems have advantages and disadvantages, 
tradeoffs and presuppositions, things they emphasize and de-emphasize, obscure 
and reveal.  

I mainly play guitar (no white and black key distinction) so I think that’s 
probably why Clairnote and its approach appeals to me.  

> Especially the Liszt example doesn't gain a lot in your version, i'd say ;)
> Is the left hand correct? (I didn't check out the rules entirely...)
> It looks very strange to me...

Yes it is correct.  (Note how you can see the ascending and descending 
chromatic lines in the highest and lowest notes.)  

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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 11:24 AM, David Kastrup  wrote:
> 
> "in-key"?

Hmmm, yeah, that works and is clear.  I think I’ll start using that.

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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 12:01 PM, Sharon Rosner  wrote:
> 
> So you see, it's quite a straight-forward a technique. Yes, accidental
> translation can be tricky, but with practice it becomes second nature. And
> again, 300 years ago it was considered a basic skill for any musician worth
> his salt, it's just modern musicians that are handicapped.

Thanks for the examples.  I can see how this would work fine, especially for 
music with fewer accidental notes and assuming proficiency in all clefs and key 
signatures.  

That’s interesting about the history of tablatures.  I’ve wondered whether one 
reason guitar tablature has become so popular today among hobbyists is that it 
more closely maps to the instrument and the process of playing it than standard 
notation (which maps rather well to the piano with its black and white key 
distinction).

(In some respects a system like Clairnote lies between standard notation and 
tablature, providing a more direct mapping between notes on the page and how 
you play them on an instrument, but without being tied to a single instrument – 
so providing some of the benefits of tablature without the drawbacks.)

Cheers,
-Paul


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


Re: simplifying chromatic scale notation

2016-01-26 Thread Paul Morris
> On Jan 26, 2016, at 11:12 AM, Chris Yate  wrote:
> 
> Yes, you're probably right. 
> 
> Though whatever you choose would have to be:
> 
> 1) equally easy to read in all keys (which is demonstrably NOT the case for 
> traditional notation)
> 2) easy to manage when key changes
> 3) make it easy to identify octaves, and possibly the tonic, and harmonic 
> relationship between notes etc.
> 4) suitable for all tessitura, which of course we currently manage with clefs
> 5) compact
> 6) easy to notate by hand
> 7) avoid confusion with traditional notation (here Clairnote fails very badly 
> indeed for me)

Yep, it’s a tall order trying to achieve all desirable features in the same 
system.  Seems there are always trade-offs.

(I originally resisted using hollow and solid notes for pitch to preserve more 
continuity with the traditional system, but then came to think the benefits 
were worth it.  Of course, YMMV.)

Cheers,
-Paul

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


Re: simplifying chromatic scale notation

2016-01-25 Thread Paul Morris
> On Jan 25, 2016, at 4:19 PM, musicus  wrote:
> 
> See attached. Comments, suggestions are very welcome ;)

Hi musicus,  

I think you’re right that standard notation is not as good as it could be for 
such chromatic music, and you have an interesting approach for improving it.  I 
agree with what others have said about the ambiguity of the notes though.  

One idea would be to use triangle shapes for the accidental notes to better 
clarify their relation to the “natural” or rather in-the-key, non-accidental, 
notes.  Like a diatonic-staff version of Reed’s Twinline: 
http://musicnotation.org/system/twinline-notation-by-thomas-reed/

Although, I’m not sure how that would work with sharp or flat notes in a given 
key... (are they ovals or triangles?)

BTW, is there a standard term for non-accidental notes?  You would think it 
would be “natural notes” but sometimes natural notes are also accidental notes.

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


Re: Accessing Grob properties

2016-01-24 Thread Paul Morris
> Am 22.01.2016 um 21:54 schrieb David Kastrup:
>>> However, from there I don't get any further, and it seems I totally
 don't understand how the Scheme types are matched in C++.
 Any attempt to compare the content of beam_count_prop with a set of
 predefined values seems to fail, and even
 
if (scm_equal_p (ly_symbol2scm ("one"), ly_symbol2scm ("two")))
 
 returns true (using scm_equal_p equally as for the eq and eqv
 versions.
>> It does not return true but SCM_BOOL_F.  Which you then convert to a
>> true C++ boolean since it is non-zero.
>> 
>> You want   if (scm_is_eq (... ))
>> instead: predicates with name xxx_is_yyy return a C (or C++) boolean.
>> Predicates with name xxx_p return an SCM boolean which you need to
>> convert to a C++ boolean using, for example, scm_is_true.
>> 
>> ...
>> 
>> SCM_BOOL_F as a C condition is _true_ rather than false. 
> 
> Thank you for this clear and general explanation that will serve me much
> further than simply solving the problem at hand. Of course this totally
> makes sense - and works perfectly.

This is indeed helpful info.  I checked the CG to see if it covers this kind of 
thing, and it looks like it does, although I didn’t check closely enough to see 
if it covers this exact example.  

http://lilypond.org/doc/v2.19/Documentation/contributor/comparison

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


Re: Access a stem’s notehead

2016-01-22 Thread Paul Morris
On January 22, 2016 7:47:11 AM EST, Simon Albrecht  
wrote:
>How do I retrieve the 
>NoteHead from the Column?

Hi Simon, this snippet should help:

http://lsr.di.unimi.it/LSR/Item?id=621

It shows how to get a Stem from a NoteHead, using ly:grob-object 

That way may be simpler than going from Stem to NoteHead (one Stem per 
NoteHead, potentially many NoteHeads per Stem).

Cheers, 
-Paul



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


Re: Access a stem’s notehead

2016-01-22 Thread Paul Morris
> On 22.01.2016 16:11, Simon Albrecht wrote:
>> The feature is designed for a very specific case: Renaissance vocal music, 
>> one voice per staff, no chords, no dynamics etc. With this callback, I crop 
>> those stems which protrude beyond the staff, such as to allow for still 
>> closer vertical spacing. 

Ok, are there any rests?  If so, you’ll get this error: 

In procedure ly:grob-array-ref in expression (ly:grob-array-ref note-heads 0):
/var/folders/x0/800486lw8xj7t90059bpdlb0gn/T/frescobaldi-tHHLRO/tmpJg6Ur_/document.ly:7:23:
 Wrong type argument in position 1 (expecting Grob_array): ()

since rests actually have stem grobs (that usually don’t produce visible 
output) but they have no grob array of note heads.  

Below is a version that overrides note head grobs which avoids this rest 
problem.  Also it looks like you don’t need to bother with the note column, as 
it seems these both work directly:

(note-heads-grob-array (ly:grob-object stem-grob 'note-heads))

(stem-grob (ly:grob-object note-head-grob ‘stem))

Cheers,
-Paul

%
\version "2.19.35"
#(define shorten-stem
  (lambda (note-head)
(let* ((stem (ly:grob-object note-head 'stem))
   (staff-pos (ly:grob-staff-position note-head))
   (stem-len (ly:grob-property stem 'length))
   (delta (case (abs staff-pos)
((3) -0.3)
((2) -1)
((1) -1.5)
((0) -1.8)
(else 0
  (ly:grob-set-property! stem 'length (+ stem-len delta)
mus = { a'4 b' c'' d'' r }
{
 \time 5/4
 \mus
 \override NoteHead.before-line-breaking = #shorten-stem
 \mus
}




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


Re: ly:one-page-breaking (was: ly:one-line-breaking)

2016-01-19 Thread Paul Morris
> On Jan 19, 2016, at 4:02 AM, Richard Shann  wrote:
> 
> That's great news! For the application to Denemo taglines and footnotes
> are not wanted anyway as it is for creating a score to play from
> on-screen.
> I guess it will be some time before this code gets into a release?

It depends on whether or not this is acceptable with the current known issues.  
(Some other pressing demands mean that I need to take a break from LilyPond 
work for some months, so I won’t have time to further improve upon this any 
time soon.)  In its current state it would already work for many of the more 
obvious use cases – like Denemo’s on-screen score or producing image files 
destined for other documents.

Should I put this up for code review or should we discuss this on the dev list? 
 …or in an issue tracker?


>> The approach is to temporarily set the page-height to the largest size 
>> possible, 
> 
> What is the largest size possible? I tried playing around with some
> sizes, and some didn't work …

I tried setting it to positive infinity, but that gave a programming error when 
there was a tagline.  I traced the error to Stencil::translate, which throws 
the error for any value greater than 1e6.  So I used 1e6 as the temporary 
page-height and everything is working fine.


>> do the line breaking and page layout for that page height, then get the 
>> vertical position on the page and the height of the lowest system (or top 
>> level markup), and use that to calculate and then set the final page height 
>> so that it fits the content of the page.
> 
> A crude version of this is what will be in the impending Denemo release
> - Denemo creates the SVG output and counts the pages and then re-runs
> LilyPond at a larger page size.

I think that should work pretty well for your use case.  I considered a similar 
approach before I worked out the current one.

-Paul



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


ly:one-page-breaking (was: ly:one-line-breaking)

2016-01-18 Thread Paul Morris
> On Jan 9, 2016, at 1:30 PM, Richard Shann  wrote:
> 
> I was wondering if it would be possible to develop a variant of "all on
> one line", namely "all on one page", where the page height would be
> automatically adjusted to fit the music, leaving the width as set.

I’m glad to report that I’ve made some real progress.  The code in the attached 
patch delivers the basic functionality, with a few "known issues".  Namely the 
tagline and any footnotes are not included, and bookparts trigger default page 
breaking for some reason.  I haven’t tested it extensively but titles (etc.), 
top level markups, multiple scores, all seem to work just fine.

The approach is to temporarily set the page-height to the largest size 
possible, do the line breaking and page layout for that page height, then get 
the vertical position on the page and the height of the lowest system (or top 
level markup), and use that to calculate and then set the final page height so 
that it fits the content of the page.

(Also, I now see how to improve the ly:one-line-auto-height code to avoid some 
of the unintuitive results related to bottom-margin and top-system-spacing.  So 
a new patch set for that is on the way, when I can get to it...)

-Paul


%%% TEST SNIPPET %%%

\version "2.19.36"

\paper {
  % system-system-spacing.basic-distance = #0
  page-breaking = #ly:one-page-breaking
  % ragged-bottom = ##t
  % top-margin = 0
  % bottom-margin = 0
  % system-system-spacing.minimum-distance = #0
  % system-system-spacing.padding = #0
}

\header {
  % title = "a title”
  % tagline = ""
}

% \markup \large "top level markup"

\repeat unfold 100 { c’4 d' e' f’ }

\repeat unfold 10 { g'1 }

{ c,1 }

% \markup \large “another top level markup"

%




one-page-breaking-1-18-2016.patch
Description: Binary data


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


ly:one-page-breaking (was: ly:one-line-breaking)

2016-01-18 Thread Paul Morris
> On Jan 9, 2016, at 1:30 PM, Richard Shann  wrote:
> 
> I was wondering if it would be possible to develop a variant of "all on
> one line", namely "all on one page", where the page height would be
> automatically adjusted to fit the music, leaving the width as set.

I’m glad to report that I’ve made some real progress.  The code in the attached 
patch delivers the basic functionality, with a few "known issues".  Namely the 
tagline and any footnotes are not included, and bookparts trigger default page 
breaking for some reason.  I haven’t tested it extensively but titles (etc.), 
top level markups, multiple scores, all seem to work just fine.

The approach is to temporarily set the page-height to the largest size 
possible, do the line breaking and page layout for that page height, then get 
the vertical position on the page and the height of the lowest system (or top 
level markup), and use that to calculate and then set the final page height so 
that it fits the content of the page.

-Paul


%%% TEST SNIPPET %%%

\version "2.19.36"

\paper {
 % system-system-spacing.basic-distance = #0
 page-breaking = #ly:one-page-breaking
 % ragged-bottom = ##t
 % top-margin = 0
 % bottom-margin = 0
 % system-system-spacing.minimum-distance = #0
 % system-system-spacing.padding = #0
}

\header {
 % title = "a title”
 % tagline = ""
}

% \markup \large "top level markup"

\repeat unfold 100 { c’4 d' e' f’ }

\repeat unfold 10 { g'1 }

{ c,1 }

% \markup \large “another top level markup"

%




one-page-breaking-1-18-2016.patch
Description: Binary data


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


Re: Outliner markup command

2016-01-17 Thread Paul Morris
Hi Harm,  

> On Jan 15, 2016, at 5:58 PM, Thomas Morley  wrote:
> 
> The only way I've found, is to delete all color-settings from the 
> stencil-expr.
> Anyone with a better idea?
> 
> Below you'll find what I did.
> Fixes `stencil-whiteout-outline' by applying newly defined `uncolor-stencil'
> Also adding `outliner'-markup-command

This looks like a good solution to me.  Thanks for looking into it and coming 
up with a fix!  That recursive map function is especially nice.  For the name 
of the markup command, I’d like to suggest \outline since it is more in line 
with the names of other markup commands.  

It might also be good to let the \whiteout markup command respond to color 
property overrides, but that’s a separate issue.  And I suppose it raises the 
question of whether to provide both, which is a matter of how sweet or bitter 
to make the syntax.  For example:

\markup {
\override #'(style . outline)
\override #'(thickness . 3)
\override #`(color . ,red)
\whiteout ''text with red outline"
}

\markup {
  \outline #3 #red "text with red outline"
}

Cheers,
-Paul



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


Re: Outliner markup command

2016-01-13 Thread Paul Morris
> On Jan 13, 2016, at 7:45 AM, David Kastrup  wrote:
> 
> This is the correct version of the \override #'(color . red) you wrote
> which does not work.  Whether the above works depends on whether the
> following markup actually uses the color property, of course.

Indeed, the “\whiteout" markup command does not currently use the color 
property (although the functions it calls does, “stencil-whiteout” etc.).  No 
reason it couldn’t be enhanced to use it though.

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


Re: Outliner markup command

2016-01-13 Thread Paul Morris
> On Jan 12, 2016, at 6:09 PM, Thomas Morley  wrote:
> 
> Though, there might be a bug in `stencil-whiteout-outline', Paul cc-ed.
> 
> Look at:
> 
> \markup \stencil
> #(stencil-whiteout-outline
>  (make-filled-box-stencil '(-1 . 1) '(-1 . 1))
>  0.5
>  red
>  16
>  1)
> 
> \markup \stencil
> #(stencil-whiteout-outline
>  (stencil-with-color (make-filled-box-stencil '(-1 . 1) '(-1 . 1)) green)
>  0.5
>  red
>  16
>  1)
> 
> First one is ok.
> But in the second one the color from the stencil is taken (green) and
> the specified (red) is ignored.
> Will investigate more detailed the upcoming days.

Huh, that’s odd…  stencil-whiteout-box works as expected (see below), so the 
problem must indeed be in stencil-whiteout-outline.

-Paul


\markup \stencil
#(stencil-whiteout-box
 (make-filled-box-stencil '(-1 . 1) '(-1 . 1))
 0.5
 1
 red)

\markup \stencil
#(stencil-whiteout-box
 (stencil-with-color (make-filled-box-stencil '(-1 . 1) '(-1 . 1)) green)
 0.5
 1
 red)



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


Re: ly:one-line-breaking

2016-01-11 Thread Paul Morris
> On Jan 9, 2016, at 1:30 PM, Richard Shann  wrote:
> 
> I was wondering if it would be possible to develop a variant of "all on
> one line", namely "all on one page", where the page height would be
> automatically adjusted to fit the music, leaving the width as set.


Well, I made a couple of partially successful attempts.  See two patches 
attached.  I basically followed the examples of minimum line breaking and one 
line breaking, while trying to understand page-breaking.cc.  The challenge is 
calculating the exact page height needed to fit the music.


INITIAL ATTEMPT

Here I access the vertical extent of each system and add them together, along 
with top and bottom margins, to calculate the page height that would allow all 
systems fit on one page.  But this doesn't take into account the spacing 
between systems so the page height is underestimated.  

So next I access system-system-spacing.basic-distance, and add that in.  But 
system-system-spacing is measured from the center of the staff (see [1]), so 
the page height is overestimated.  There doesn’t seem to be any way to use 
these spacing settings to calculate the height.  (I should have seen this 
coming…)

[1] 
http://lilypond.1069038.n5.nabble.com/attachment/164161/0/vertical-spacing-paper-variables.pdf

Maybe (presumably?) somewhere in the vertical spacing code there is a reliable 
way to get an exact height value based on an actual layout of music on the page 
(without any compression), but I haven’t found it.  

(Also top level markups, titles, etc. cause a crash with this code…)


ANOTHER ATTEMPT

Here the idea was to simply take the default layout on N pages and then 
calculate a page height that would be equal to the total of all of the heights 
of those N pages – effectively merging the N pages into one page.  For some 
reason the resulting paper height often seems to be short (despite using an 
existing routine to get the default paper height), and I’m not sure what’s 
going wrong.  LilyPond does seem to fit all the systems onto one page in those 
cases, but with some compression, and ideally there shouldn’t be any need for 
compression.  

(Top level markups, titles, etc. work fine, but there are some programming 
errors reported in the log about trying to fit music... crossing fingers… etc. 
but the results seem to come out ok.)


(I also tried some code that progressively increased or decreased the page 
height, attempting new page breaking at each size, to locate the threshold 
between one and two pages, which would be the height needed.  But this didn’t 
work.  No matter the page height the number of pages stayed the same, I suspect 
because of caching of values for a given page breaking configuration.)

There's a staggeringly sophisticated system for fitting music onto pages that 
have a constant size, but keeping the music constant and changing the page size 
to fit it is another story.

Anyway, it's a start.  I’m putting this on the shelf for now, but wanted to 
share what I’d done to prevent duplication of effort if anyone else feels 
inclined to take this on.

(I’m mostly interested in how this would allow for creating SVG images where 
the size of the image is automatically cropped to fit the music (with user 
customizable margins) rather than having to do this manually with Inkscape.)

-Paul


%%% TEST SNIPPET %%%

\version "2.19.36"

\paper {
  % system-system-spacing.basic-distance = #0
  page-breaking = #ly:one-page-breaking
  % ragged-bottom = ##t
  % top-margin = 0
  % bottom-margin = 0
  % system-system-spacing.minimum-distance = #0
  % system-system-spacing.padding = #0
}

\header {
  % title = "a title"
  tagline = ""
}

% \markup \large "top level markup"

\repeat unfold 200 {
  c' d' e' f'
}

%




0001-initial-attempt-at-one-page-breaking.patch
Description: Binary data


0001-initial-attempt-at-one-page-breaking.patch
Description: Binary data


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


Re: ly:one-line-breaking

2016-01-09 Thread Paul Morris
> On Jan 9, 2016, at 1:30 PM, Richard Shann  wrote:
> 
> I could not see where the ly:one-line-breaking algorithm was written
> however (looking in the .scm and .ly files) is it in C++ ?

Yes, see:

lily/page-breaking-scheme.cc
lily/one-line-page-breaking.cc

HTH,
-Paul

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


Rewriting an expression that uses ly:make-simple-closure

2016-01-07 Thread Paul Morris
Hi all,  Here’s a tricky one…  I’m working on updating a piece from the Mutopia 
Project[1] (from LilyPond 2.16.1 to 2.19.35) and it uses the following:

centermarkup = {
  \once \override TextScript.self-alignment-X = #CENTER
  \once \override TextScript.X-offset =#(ly:make-simple-closure
`(,+
  ,(ly:make-simple-closure (list
ly:self-alignment-interface::centered-on-x-parent))
  ,(ly:make-simple-closure (list
ly:self-alignment-interface::x-aligned-on-self
}

But ly:make-simple-closure is no longer around[2].  So how to rewrite this 
without it?

It seems to be documented (barely) in the 2.18 extending manual:
http://www.lilypond.org/doc/v2.18/Documentation/extending/callback-functions.html

Looking in the source code I find the example given there from define-grobs.scm:

(X-offset . ,(ly:make-simple-closure
  `(,+
,(ly:make-simple-closure
  (list 
ly:self-alignment-interface::centered-on-x-parent))
,(ly:make-simple-closure
  (list 
ly:self-alignment-interface::x-aligned-on-self)

and see it has now become the following in 2.19.35:

(X-offset . ,ly:self-alignment-interface::aligned-on-x-parent)

So would the following be an equivalent rewrite?

centermarkup = {
  \once \override TextScript.self-alignment-X = #CENTER
  \once \override TextScript.X-offset = 
  #ly:self-alignment-interface::aligned-on-x-parent
}

I can’t see a difference in the minimal example below (taken from the piece).

Thanks,
-Paul

[1] http://www.mutopiaproject.org/cgibin/piece-info.cgi?id=1938
[2] https://lists.gnu.org/archive/html/lilypond-devel/2015-09/msg00273.html


%%
\version "2.18"

centermarkup = {
  \once \override TextScript.self-alignment-X = #CENTER
  \once \override TextScript.X-offset =
  #(ly:make-simple-closure
`(,+
   ,(ly:make-simple-closure (list
 
ly:self-alignment-interface::centered-on-x-parent))
   ,(ly:make-simple-closure (list
 
ly:self-alignment-interface::x-aligned-on-self
}

centermarkup-new  = {
  \once \override TextScript.self-alignment-X = #CENTER
  \once \override TextScript.X-offset = 
  #ly:self-alignment-interface::aligned-on-x-parent
}

{
  \key fis \minor
  \time 3/2

  fis2  \once \override Voice.TextScript.extra-offset = #'(0.0 . -1.1 ) 
eis1^\markup { \override #'( baseline-skip . 1.3 ) \column { \finger " 4" 
\finger " 1" \concat {  \musicglyph #"scripts.tenuto" \hspace #0.8  \musicglyph 
#"scripts.turn" } } }-\tweak stencil ##f \turn | % 19

  fis2 \centermarkup  \once \override Voice.TextScript.extra-offset = #'(0.0 . 
-1.1 ) eis1^\markup { \override #'( baseline-skip . 1.3 ) \column { \finger " 
4" \finger " 1" \concat {  \musicglyph #"scripts.tenuto" \hspace #0.8  
\musicglyph #"scripts.turn" } } }-\tweak stencil ##f \turn | % 19

  fis2 \centermarkup-new  \once \override Voice.TextScript.extra-offset = 
#'(0.0 . -1.1 ) eis1^\markup { \override #'( baseline-skip . 1.3 ) \column { 
\finger " 4" \finger " 1" \concat {  \musicglyph #"scripts.tenuto" \hspace #0.8 
 \musicglyph #"scripts.turn" } } }-\tweak stencil ##f \turn | % 19
}

%%%




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


Re: Staff customization question.

2016-01-05 Thread Paul Morris
> On Jan 5, 2016, at 11:03 AM, Hwaen Ch'uqi  wrote:
> 
> Yes, I had seen this snippet before. It appears though that this
> function assumes a certain regularity - i.e., by semitones, whole
> tones, etc. In this case, the intervals between pitches are not
> uniform, varying from minor seconds to major thirds. Will this take a
> list of numbers to define each line and space? If so, can I simply
> plug in a series of numbers, or must they be surrounded by parentheses
> and a hash or something? I am quite nervous with Scheme!

For your use-case I would just use a lookup-table (alist) that maps semitones 
to staff positions, as shown in the snippet below.

HTH,
-Paul


\version "2.18"

#(define (my-procedure pitch)
   (let
;; get the semitone of the pitch
((semitone (ly:pitch-semitones pitch))
 ;; lookup-alist maps semitones to positions on the staff
 (lookup-alist
  '((0 . 0)
(2 . 3)
(4 . 6)
(5 . 9)
;; ...edit and add more here as needed
)))
;; for development / debugging to see what semitones you are working with
(display semitone)(newline)
;; lookup the position and return the position that goes with it
(assoc-ref lookup-alist semitone)))

\new Staff \with {
  staffLineLayoutFunction = #my-procedure
} {
  c'4 d' e' f’
}





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


Re: turn off tab double half note stems

2016-01-04 Thread Paul Morris
> On Jan 3, 2016, at 3:11 PM, Marc Hohl  wrote:
> 
> I am responsible for the double stems in tablature, but I did not invent them 
> ;-)
> 
> AFAIK, there is no common standard for tablature with stems.
> 
> I found the double-stemmed variant in some examples and found it quite
> more readable as – for instance – circles drawn around the fret numbers to 
> indicate half or whole notes (this looks even more ugly with chords).

Good to know, thanks.  Double stems seem like as good a way to indicate half 
notes in tablature as any.

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


Re: Staff customization question.

2016-01-04 Thread Paul Morris
> On Jan 4, 2016, at 8:48 PM, Hwaen Ch'uqi  wrote:
> 
> Is there a way to create a specific calibration of pitch
> to line/space where the lowest and highest notes align with the lowest
> and highest lines? 

Briefly, here’s a small hint: setting “staffLineLayoutFunction” in the Staff 
context to a custom scheme procedure is a way to do this.  Try searching the 
LSR for examples of how this is done.

Cheers,
-Paul


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


Re: adding a markup ("sim.") to the end of a SustainPedalBracket

2016-01-03 Thread Paul Morris
> On Dec 27, 2015, at 7:25 PM, David Kastrup  wrote:
> 
>> (2)
>> The doc-string for `stencil-whiteout' implies that @var{thickness} is
>> optional. As far as I understand it's not.

You’re right that the doc-string is misleading.  @var{thickness} is required as 
an argument but if its value is not a number then an appropriate value is 
selected based on @var{style}.  If the user hasn’t explicitly specified a 
number for the thickness of the whiteout, then this procedure is called with an 
empty/null/non-number value for @var{thickness}.

> Should it be?  Would that have saved us from the error?

I don’t think it would have prevented this error but it probably makes sense to 
make it an optional argument.  I’ll prepare a patch for that so the code will 
match the doc string.

-Paul



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


Re: Strings as variable names

2016-01-03 Thread Paul Morris
> On Jan 3, 2016, at 10:06 AM, David Wright  wrote:
> 
> Recognising the lack of this construct, python is currently adding string 
> interpolation to the language.

Looks like a trend as Javascript also got it in the ECMAscript 2015 
specification:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings

I mention this only for curiosity’s sake.  "I have no dog in this race", as 
they say, and as David mentioned, LilyPond as a language is not comparable to 
Javascript, Python, Perl, etc… that would be the Scheme/Guile department.

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


Re: guileV2 and Lilypond (was: Strings as variable names)

2016-01-03 Thread Paul Morris
> On Jan 3, 2016, at 11:14 AM, Menu Jacques  wrote:
> 
> A newbie question: what are the expected benefits and challenges of moving 
> from guile 1.8.x to guile 2.y?

As I understand it, guile 2.0 introduced significant performance improvements, 
mainly for compiled scheme, but since LilyPond interprets scheme, and the 
scheme interpreter in guile 2.0 is actually slower than in 1.8 (but faster in 
2.2 than in 2.0)  …just how much of the performance benefits LilyPond will 
enjoy remains to be seen.

One of the immediate benefits is just keeping up with the current guile version 
distributed with gnu/linux distributions.  They don’t want to keep including 
guile 1.8 just for LilyPond’s sake, so LilyPond could get dropped from these 
distributions.

But the big story is the challenges -- mainly that guile 2.0 still has bugs 
that need to be fixed for it to work reliably with LilyPond.

I recently saw this announcement about guile 2.1.1 the "first pre-release in 
what will become the 2.2 stable series”:
http://savannah.gnu.org/forum/forum.php?forum_id=8397

That led me to the redesigned guile website and their mailing list, where I 
found a post that touches on the need for better LilyPond support in guile:
http://lists.gnu.org/archive/html/guile-devel/2015-11/msg5.html

And this follow-up post that clearly lays out the current showstopper bug: 
http://lists.gnu.org/archive/html/guile-devel/2015-11/msg00031.html

Maybe that sheds some light on this.  Clarifications and additions welcome.

-Paul




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


Re: turn off tab double half note stems

2016-01-03 Thread Paul Morris
> On Dec 29, 2015, at 11:02 AM, Steve Fullerton  wrote:
> 
> In tab, lilypond draws a double stem for half notes. This is done 
> intentionally to distinguish half notes from quarter notes. 

I’m curious about these double stems.  Does anyone know if they are a 
common/standard way to indicate half notes in tab?  I searched the web but 
didn’t turn up any documentation on this.  


> Is there a way to turn this feature off so half note stems are drawn with a 
> single line like quarter notes?

I was looking into the source code and it seems that for completeness one 
should also revert the Stem.X-extent:

\version “2.19.35”

\new TabStaff \with { 
  \tabFullNotation
  \revert Stem.stencil
  \revert Stem.X-extent
}
 { c''2 4 4 }


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


converting svg glyph to path data for use in scheme (was: accidentals for just intonation)

2015-12-12 Thread Paul Morris
Hi Andrew,

> On Dec 12, 2015, at 10:38 AM, N. Andrew Walsh  
> wrote:
> 
> I've been doing some background work on my just-intonation accidentals, and I 
> was hoping you could give me some advice on the svg-to-path translation. I 
> know what the stencils should look like, but I'm not sure about things like 
> scaling (how many units high or wide should a stencil have if it's 
> equivalent, say, to the thick bars in a sharp sign?), and what the best 
> procedure might be for drawing them. Could you give me some advice/help? 
> 
> I think this is going to be geared towards adding into the OLL repository as 
> part of the "contemporary notation" extensions, so probably aimed at the dev 
> branch. So I'll see about the make-path-stencil (are you sure it's that and 
> not the "make-connected-path-stencil" I see in the LSR?).


Here’s what I’d suggest for going from an svg to a path from my experience with 
doing this.  

You can create a simple .ly file with a few notes and accidentals, then render 
it to SVG and open that SVG in Inkscape.  Then use Inkscape to draw your 
accidentals (or parts of accidentals) so they look good next to the notes and 
standard accidentals.  Having the default notes, accidentals, staff, in the SVG 
will help you get it at approximately the right scale.  (Although this may not 
matter, you will probably have to change the scaling later anyway…  I can’t 
remember for sure.)

Cut and paste your shape into a separate Inkscape SVG file and export/save as a 
plain SVG.  I found that I had to horizontally flip the shape in Inkscape first 
because svgs from Inkscape apparently come out reversed for some reason.  So 
you may need to do that.

Open that SVG file in a text editor and find the path data.  It should look 
something like this (a custom whole note glyph I made):



Working with this is the tedious part…  You can take out the parts you don’t 
need.  Here’s the part you do need:

d="m 304.96006,540.93655 c 11.66747,0 16.5678,6.05308 16.5678,16.78715 
0,18.43458 -14.00096,28.9213 -32.43555,28.9213 -11.66747,0 -16.33444,-6.05308 
-16.33444,-16.78715 0,-18.43458 13.7676,-28.9213 32.20219,-28.9213 z m 
-66.27119,22.85423 c 0,10.03402 7.93387,17.50119 17.0345,22.40152 
12.60086,6.76713 27.06851,9.33397 41.30282,9.33397 14.23429,0 28.9353,-2.56684 
41.53616,-9.33397 9.10063,-4.90033 17.0345,-12.3675 17.0345,-22.40152 
0,-10.03402 -7.93387,-17.5012 -17.0345,-22.40153 -12.60086,-6.76713 
-27.30186,-9.33397 -41.53616,-9.33397 -14.23431,0 -28.70196,2.56684 
-41.30282,9.33397 -9.10063,4.90033 -17.0345,12.36751 -17.0345,22.40153 z"

You can manually reformat that so it is easier to read and then use something 
like
http://petercollingridge.appspot.com/svg_transforms 

to transform the path in various ways. 

For example the following is scaled using "scale(0.016, 0.016)" and converted 
to absolute coordinates.  It may help to look up "SVG path" on the web to get 
familiar with the commands C c M m z and the possible transformations, etc.



You might want to shift / translate it so it is snug to (0,0) with 
“translate(x, y)” where x and y are the inverse of the smallest X and Y values 
in the path.  (I did this, but it may not be necessary…)

Now you have a path that can be used by “make-path-stencil”.  It will look 
something like the following as embedded scheme in a LilyPond file:

#(define whole-note-outline
'(M 0 0
   C 0 0.16054432 0.12694192 0.28001904 0.272552 0.35842432
   C 0.47416576 0.4666984 0.70564816 0.50776784 0.93339712 0.50776784
   C 1.16114576 0.50776784 1.39636192 0.4666984 1.59797568 0.35842432
   C 1.74358576 0.28001904 1.87052768 0.16054432 1.87052768 0
   C 1.87052768 -0.16054432 1.74358576 -0.2800192 1.59797568 -0.35842448
   C 1.39636192 -0.46669856 1.16114592 -0.507768 0.93339712 -0.507768
   C 0.70564816 -0.507768 0.47416576 -0.46669856 0.272552 -0.35842448
   C 0.12694192 -0.2800192 0 -0.16054432 0 0
   z))

Then you can use it like so:

  (make-path-stencil whole-note-outline 0.0001 1 1 #t)

in the scheme code you’re using to override the accidental glyphs.  The 
arguments are:

(make-path-stencil 
path-data-list 
thickness-of-path-line
x-scale-factor 
y-scale-factor 
filled-or-not)

(Oh, and yes make-path-stencil is what I'd use if you’re targeting 2.19 or 
higher.  The make-connected-path-stencil procedure is similar but more limited. 
 make-path-stencil is not in the LSR yet...)

To get the scaling right is basically a trial and error dance.  Use the scale 
factor arguments to test until you’ve got it right, then go back and scale the 
path data itself with those values so it’s the correct size to start with.  
(You could go back to Inkscape and scale there if you prefer…)

…so you’ll need some scheme code for overriding the standard accidental 
stencils with your path stencils.  (It might make sense to just create some 
simple line 

Re: converting svg glyph to path data for use in scheme (was: accidentals for just intonation)

2015-12-12 Thread Paul Morris
> On Dec 12, 2015, at 3:34 PM, Johan Vromans  wrote:
> 
> If I understand the procedure correctly, wouldn't it be easier to use a
> tool like fontforge add/adjust font glyphs?

Maybe so, but the result is less portable because (if I understand correctly) 
you'd have to have a custom font and have it installed correctly, etc. for 
anyone to be able to use the glyph...  as opposed to just having the custom 
glyphs in an include file that you’re going to be including anyway.  

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


Re: accidentals for just intonation

2015-12-01 Thread Paul Morris
> On Dec 1, 2015, at 5:38 AM, Urs Liska  wrote:
> 
> You have a rather small number of individual components (vertical,
> horizontal and diagonal elements) that can all represented by a
> postscript path. A function should be able to determine from the input
> ratio which of these elements have to be combined and then generate the
> appropriate path and eventually use that to replace Accidental.stencil.

Yep, sounds like a matter of creating path stencils for each component part, as 
static unchanging building blocks, and then have a function that dynamically 
combines these stencils to produce the accidental needed for a given note.  
Combining stencils in different ways is simpler than producing a path on the 
fly, so that will make things easier.

I have done this kind of thing by creating an SVG with Inkscape and then 
opening the SVG file in a text editor where I can copy the path coordinates.  
Then I can paste those coordinates into a LilyPond include file, in a procedure 
that produces a path stencil.  (With some tedious back and forth to get the 
scaling right.)  Then that stencil is available to use by LilyPond.  

For Clairnote music notation I have code that replaces accidental signs with 
custom accidentals[0] that might be helpful to look at.  It combines a dot 
stencil with a line stencil, so no paths are needed.  However, I also use path 
coordinates to create whole note glyphs, so there’s an example of that as well. 
 That code is available here:

http://clairnote.org/software/

[0] http://clairnote.org/accidental-signs/

> How these paths can be created is something I won't be of much help, but
> if you get to the point where you have very concrete necessities you'll
> surely be able to get help by others with more experience in that.

There are several ways to create a stencil from a path.  Search the LSR for 
“path” for two different ways in addition to the \path markup command.  The 
most recent development version of LilyPond (2.19.x) also has a 
make-path-stencil function that combines the benefits of the two ways 
documented on the LSR without their drawbacks, so I prefer to use that unless 
I’m supporting LilyPond 2.18. 

-Paul


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


Re: Introducing "LilyPond HTML Live Score"

2015-11-30 Thread Paul Morris
> On Nov 29, 2015, at 1:08 PM, Mathieu Demange  
> wrote:
> 
> http://www.mathieudemange.fr/lilypond-html-live-score-demo/

Nice work!  This is great stuff, and I’d probably be interested in using it at 
some point.  

(Another case where the ability to automatically calculate the size of the SVG 
to fit the music would come in handy.)

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


Re: RFC: new location for openLilyLib repository

2015-11-13 Thread Paul Morris
> On Nov 13, 2015, at 5:58 AM, Urs Liska  wrote:
> Regaring the location of the individual libraries, what would you consider 
> best:
> 
> adding all beside oll-core
> (keeping the option that anyone creates libraries in their own place)
> creating a new openlilylib sibling organization for that purpose
> Just have library maintainers maintain their repos in their own namespace
> (providing a central listing of available libraries in some place, of course)
Does this depend somewhat on how the documentation will work?  Seems like 
centralized documentation would be easier with centralized repos, but maybe it 
would work fine either way…

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


Re: RFC: new location for openLilyLib repository

2015-11-13 Thread Paul Morris
> On Nov 13, 2015, at 5:58 AM, Urs Liska  wrote:
> renaming the "openlilylib" repository to "snippets"
> -> https://github.com/openlilylib/snippets 
> 
> NOTE: This may require users to adapt their repository set-ups and LilyPond 
> include path settings
What about this instead: clone or copy to a new /openlilylib/snippets repo, 
leaving the current /openlilylib/openlilylib in place for now.  Then users can 
change to the new one while the old one still works.  After a transition 
period, delete the old one.  That would provide a smoother transition for 
users.  

Just a suggestion.  The rest of the plan seems fine to me.

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


Re: LilyPond-aware text editors

2015-11-05 Thread Paul Morris
> On Nov 5, 2015, at 10:18 AM, Urs Liska  wrote:
> 
> Is there *any* tool around that offers more than a notepad application
> but doesn't try to be an IDE?

There’s a bundle that provides LilyPond syntax highlighting for TextMate:

https://github.com/textmate/lilypond.tmbundle

TextMate is mac only ( http://macromates.com/ ) but I think I have seen other 
text editors support the TextMate bundle format.

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


Re: My finances for working on LilyPond

2015-10-27 Thread Paul Morris
> On Oct 27, 2015, at 8:19 PM, Bruno Ruviaro  wrote:
> 
> It seems to me that Patreon (https://www.patreon.com/ 
> ) might be a good system in your case. 

Or maybe Gratipay (https://gratipay.com/) (formerly known as “gittip") which is 
based on continuous weekly payments – ongoing contributions for ongoing work – 
rather than payment per creation.  

Also, unlike most of these deals, Gratipay does not take a percentage off the 
top of each transaction.  Gratipay is itself funded on Gratipay.  How’s that 
for "eating your own dog food"?

It looks like they are going through a big transition that involves a new 
approach organized around funding teams (rather than individuals) that offer 
what they’re calling “open work”.  It’s an intriguing and unconventional 
approach… FWIW.

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


Re: My finances for working on LilyPond

2015-10-25 Thread Paul Morris
> On Oct 22, 2015, at 2:55 PM, ciconia  wrote:
> 
> I'm sure many would agree with me that your hard work (and indeed that of
> all lilypond contributors) is greatly appreciated.

+1  

I hope this appeal will lead to a more financially viable situation that will 
allow you to continue with your valuable LilyPond work.

-Paul


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


Re: Updating library code

2015-10-23 Thread Paul Morris
> On Oct 23, 2015, at 6:43 AM, Urs Liska  wrote:
> 
> How are you dealing with keeping code working and consistent?

One simple thing I do, FWIW, is to add a short prefix to all my own functions.  
For example, instead of "do-something", I'd call it "cn-do-something".  That 
way it’s clear which functions are custom functions, and it effectively removes 
the chance of naming collisions.

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


Re: \applyContext, StaffSymbol, and \stopStaff \startStaff

2015-10-19 Thread Paul Morris
> On Oct 19, 2015, at 1:56 AM, David Kastrup  wrote:
> 
> I think your main problem is that you are using \applyContext here at
> Voice level where it does not really do anything worthwhile.

Ah, I see.

> Try \context Staff \applyContext …

That did the trick and now it works, thanks!

\version “2.19.22” 

myfunc =
#(define-music-function () ()
   #{
 \context Staff
 \applyContext
 #(lambda (context)
;; access context properties and pick a property setting based on 
them...
(ly:context-pushpop-property context 'StaffSymbol 'color green))
 \stopStaff
 \startStaff
   #})

{
  c'
  % now it works!
  \context Staff
  \applyContext
  #(lambda (context)
 ;; access context properties and pick a property setting based on them...
 (ly:context-pushpop-property context 'StaffSymbol 'color red))  
  \stopStaff \startStaff
  c'
  % and you can put it in a music function
  \myfunc
  c'
}


> Though frankly I have no idea what \myFunc is trying to do.  You are
> keeping state in a global variable which is not going to work when using
> \myFunc in several contexts in parallel.

Um, never mind that, it was just my clumsy attempt to try to use \override 
Staff.StaffSymbol... to set the grob property when I couldn’t get 
ly:context-pushpop-property to work.  

Thanks again, I really appreciate your help.  No telling how long or if I would 
have ever figured that out on my own.

-Paul


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


Re: \applyContext, StaffSymbol, and \stopStaff \startStaff

2015-10-19 Thread Paul Morris
> On Oct 19, 2015, at 10:59 AM, David Kastrup <d...@gnu.org> wrote:
> 
> Paul Morris <p...@paulwmorris.com> writes:
>> 
>> That did the trick and now it works, thanks!
>> 
>> \version “2.19.22” 
>> 
>> myfunc =
>> #(define-music-function () ()
>>   #{
>> \context Staff
>> \applyContext
>> #(lambda (context)
>>;; access context properties and pick a property setting based on 
>> them...
>>(ly:context-pushpop-property context 'StaffSymbol 'color green))
>> \stopStaff
>> \startStaff
>>   #})
> 
> Frankly, anything wrong with
> 
>\temporary \override Staff.StaffSymbol.color = #green
> 
> here?

That would work except I want to be able to access Staff context properties and 
then, based on their values, decide what to set the StaffSymbol property to.  
In this example, say color it either green or blue.  I just left these details 
out of my tiny example (as I tried to indicate with the comment "access context 
properties and pick a property setting based on them…”, which may not have been 
very clear).

> Assuming you want a temporary override (which is what
> ly:context-pushpop-property does) in order to be able to revert to the
> previous setting afterwards.

I actually don’t think I’ll need to be able to revert.  I was just using 
ly:context-pushpop-property because it was shown in the examples in the 
extending manual.

Thanks again,
-Paul



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


Re: \applyContext, StaffSymbol, and \stopStaff \startStaff

2015-10-18 Thread Paul Morris
I found another way to do what I was trying to do.  (I used \applyContext in a 
music function to access and then modify a custom staff context property, and 
then used a custom StaffSymbol engraver to access that context property and 
change the grob properties of any new StaffSymbol grob accordingly.  A bit 
roundabout but it does the trick.)

-Paul


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


\applyContext, StaffSymbol, and \stopStaff \startStaff

2015-10-17 Thread Paul Morris
Greetings lilyponders,  

I’m trying to figure out how to use \applyContext to modify StaffSymbol grob 
properties.  The examples here

http://www.lilypond.org/doc/v2.19/Documentation/extending/context-evaluation

are very helpful, but I haven’t been able to get things working with 
StaffSymbol and \stopStaff \startStaff.  There’s probably some subtlety that 
I’m missing…  (Maybe it has to do with the difference between \temporary 
\override and \override ?)  Below is a tiny example (not my actual use case).

Thanks for any help with this,
-Paul


\version "2.19.22"

% These work as expected
{
  c'
  \stopStaff
  \startStaff
  \override Staff.StaffSymbol.color = #red
  c'
  \override Staff.StaffSymbol.color = #green
  \stopStaff
  \startStaff
  c’
}

{
  \applyContext
  #(lambda (context)
 ;; access context properties pick a property setting based on them...
 (ly:context-pushpop-property context 'StaffSymbol 'color blue))
  c’
}

% But so far these don’t...

myfunc =
#(define-music-function () ()
   (define mycolor red)
   #{
 \applyContext
 #(lambda (context)
;; access context properties and pick a property setting based on 
them...
(set! mycolor green))
 \override Staff.StaffSymbol.color = #mycolor
   #})

{
  c’
  % the order of these commands does not seem to affect things
  \stopStaff \startStaff
  \applyContext
  #(lambda (context)
 ;; access context properties and pick a property setting based on them...
 (ly:context-pushpop-property context 'StaffSymbol 'color blue))
  c'
  \myfunc
  \stopStaff \startStaff
  c'
}






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


Re: OT: Beauty of programming languages

2015-09-14 Thread Paul Morris
I’m in my early 40s, and started using LilyPond in early 2011.  I love 
LilyPond’s flexibility and extensibility which lets me create sheet music in 
alternative notation systems that have a “chromatic staff” – especially 
“Clairnote”[1].  LilyPond is in a league of its own for this kind of extension 
and customization, and she handles it like a champ.

By working on extending LilyPond I’ve learned a lot of Scheme.  Before I had 
basically only used javascript.  (I’m not a professional programmer.)  I try to 
contribute back where and when I can.  

I play guitar, trumpet, a little piano, and I sing.  I have mostly used 
LilyPond for arranging fiddle tunes and similar pieces for string bands / dance 
bands that I’ve played in.  

Thanks to everyone for their contributions to LilyPond!

-Paul

[1] Clairnote: http://clairnote.org  
See also the Music Notation Project: http://musicnotation.org
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: OT: Beauty of programming languages

2015-09-14 Thread Paul Morris
Forgot to say I use Frescobaldi.

-Paul


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


Alda "a music programming language for musicians" inspired by LilyPond

2015-09-09 Thread Paul Morris
I thought this might be of interest.  Alda is a LilyPond-inspired programming 
language for musicians to use to produce music, i.e. audio (midi, etc.).  I 
wonder why he didn’t just use LilyPond syntax, or at least follow it more 
closely? 

http://daveyarwood.github.io/alda/2015/09/05/alda-a-manifesto-and-gentle-introduction/
 


https://github.com/alda-lang/alda 

From the comments on that blog post:

"Are you familiar with LilyPond? It seems as though you've reinvented the wheel 
here."

"LilyPond is actually a major influence on Alda. The key difference between 
LilyPond and Alda is that LilyPond is a tool for generating typeset music, 
whereas Alda generates audible music. I'm aware that you can export MIDI from 
LilyPond scores, and at the moment Alda can only generate MIDI music, so for 
now, there probably aren't a lot of things that you can do with Alda that you 
can't already do by writing a LilyPond score and exporting it to MIDI, but in 
the future, Alda will support other kinds of music besides MIDI, e.g. sampled 
sounds, waveform synthesis.”

also:

"It would be great if Alda could output sheet music PDF’s"

"we do have plans to integrate LilyPond (http://lilypond.org 
), so that Alda can generate LilyPond scores from Alda 
scores."

-Paul

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-09-01 Thread Paul Morris
Hi David,

> On Aug 31, 2015, at 8:20 AM, David Nalesnik  wrote:
> 
> Which of course makes them unsuitable for showing phrase elision.
> 
> Getting a TextSpanner to begin on a note and another to start on the same 
> note requires some sleight-of-hand (you can see this in Scheme in the 
> regression test scheme-text-spanner.ly ).  I 
> wonder if the to accommodate nested brackets ruled "conflicting note group 
> events" out?

Good point.  I imagine you’re right.  

-Paul

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


Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread Paul Morris
Hi David,On Aug 30, 2015, at 3:16 PM, David Nalesnik david.nales...@gmail.com wrote:LilyPond already has the ability to make analysis brackets, which are attached to note columns and can nest as in the link (HorizontalBracket). I have an old patch for adding text to these that I will finish up and post. (I have code for doing this in Scheme, but my approach now is an enhancement of the C++ engraver.)The attached file is what I used to use when making form handouts.This is great! – both the analysis brackets (which I didn’t know about before) and your code for text labels for them. I’ve often resorted to using Inkscape to add this kind of thing to LilyPond SVGs.In trying out your code I noticed that it didn’t really work when the text was wider than the bracket (the bracket was pushed over out of place). So I came up with a revision that handles this, using the “center-stencil-on-stencil” function I recently contributed to the LSR. See attached.Would be nice to have this in the LSR, at least. It also might be nice if it could accept a markup instead of a string, so you could change the appearance of the text (size, color, style, etc.).Best,-Paul

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread Paul Morris
Oh, one other thing I noticed.  There seems to be no way to have one bracket 
end at a note and another bracket start at that same note. (warning: 
conflicting note group events”)  I tried spacer rests, but no luck.  It seems 
the start or end of a group cannot be a spacer rest.  Anyway, I thought I'd 
mention this, FWIW.

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


Re: Analysis brackets with text [was: how to get notes without tails?]

2015-08-30 Thread Paul Morris
Hi David,

That’s great that markups already work (I should have tried it before assuming 
they didn’t).  The plan for HorizontalBracketText sounds even better.  

Thanks again,
-Paul


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


Re: vertical spacing of rests

2015-08-23 Thread Paul Morris
 On Aug 23, 2015, at 4:29 PM, Peter Selinger selin...@mathstat.dal.ca wrote:
 
 -  (ly:grob-set-property! rest 'stencil #f)
 +  (ly:grob-set-property! rest 'Y-offset offset)

I wonder if this might work instead:

  (ly:grob-set-property! rest 'stencil empty-stencil)

Just an untested idea…

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


Re: Coloring of key signature accidentals based on their pitch

2015-08-22 Thread Paul Morris
Hi David,

 On Aug 21, 2015, at 9:57 AM, David Nalesnik david.nales...@gmail.com wrote:
 
 You're welcome.  Just for kicks, I've attached a .cc file which you could 
 drop into the lily subdirectory and build.  It makes Line_interface::line 
 available to Scheme. You'd just need to replace the two instances in the 
 hairpin function with calls to ly:line-interface:line. So, lines 405-10 become
 
  (set! mol (ly:line-interface::line grob x starth width endh))
 
  (set! mol
(ly:stencil-add
 mol
 (ly:line-interface::line grob x (- starth) width (- 
 endh
 
 This enables drawing of the different line styles (dashed, zigzag, etc), 
 based on overrides of Hairpin.  AFAICT this makes the Scheme stencil callback 
 have all the same functionality as the C++ original.  So
 
 \override Hairpin.style = #'zigzag
 
 will work.
 
 You can also override dash-definition, and the like.
   
 (I will put this new line function forward as a patch for review when the 
 system is over the upcoming bump.)

Nice!  It’s cool to see how you’re doing this kind of thing with a relatively 
simple example.

 Seeing how you’ve done these is giving me some confidence that I might be 
 able to do the same for the ledger line print function.
 
 I looked at this briefly, enough to see that it will be more involved!  
 You'll need to track down the data structures used there and see if there's a 
 convenient Scheme alternative  But pretty complicated things are 
 possible--see the Scheme rewrite of the ambitus engraver in the snippets.

Yep, it still looks pretty daunting on closer inspection.  Seems like the 
ledger requests data structure stuff could be redone with some nested alists.  
We’ll see.  Thanks for the tip on that ambitus snippet – it is impressive!  I 
hadn’t looked at it before.  

 I made a “commented c++” version of your hairpin code.  This time I used 
 somewhat larger blocks of code which works better than line by line.  I ended 
 up also redoing the key signature file that way while I was at it — and made 
 the paren correction.  Both attached.
 
 Thanks!  The larger blocks of code are a good idea, especially when the 
 translation becomes less line-for-line.  (I kept pretty literal in my 
 adaptation, though.)
 
 I found an error in the hairpin code rewrite--we need to exit the entire 
 function when a bad grow-direction is found, so everything after line 44 
 needs to be a clause of the if-structure beginning in 41.  Simple removal of 
 the parenthesis in 44 and addition of one at the end fixes this.  I went 
 ahead and attached the correction with the indentation redone.  In this 
 connection, I'm noticing is that it's easy to get very nested structures in 
 Scheme when the C++ original exits at a number of points through returns.  
 Maybe there's an easy way to avoid this but I don't know of it.

Good catch, thanks!  The only thing I can think of to prevent this nesting is 
to split the function into separate functions and chain them together.  So you 
would either call the next function or “return early” without calling it.  All 
the needed data would be passed through as parameters.  Not sure if that’s a 
good approach (performance wise) or not.  On the one hand the additional 
functions aren’t even called in some cases, on the other hand you have more 
functions that get called when they are all needed.

Cheers,
-Paul

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


Re: Coloring of key signature accidentals based on their pitch

2015-08-20 Thread Paul Morris
Hi David,

 On Aug 19, 2015, at 10:27 PM, David Nalesnik david.nales...@gmail.com wrote:
 
 Thanks for doing this!  (I should have thought to write it this way in the 
 first place!)

Glad to!  Thanks for leading the way on how to convert these C++ functions to 
Scheme.

 By the way, later in the thread I posted a correction of the version you're 
 commenting, which makes the spacing of naturals tally with the original.  
 There's a parens error: should be an extra parens in line 136 to close the 
 inner loop and one fewer in line 191.  (I also moved a variable into a named 
 let, but that's just cosmetic.)

Got it.  I’ve attached a new version that fixes this.

 By the way, I've also recoded hairpin::print in Scheme, and I'm attaching 
 that to this email in case you're interested. Hairpins are another popular 
 candidate for customizations and this should make it easier--changing the 
 size of the circled-tip, some sort of shorten-pair, easy addition of 
 circles to Ferneyhough hairpins, etc.

Thanks for this!  Seeing how you’ve done these is giving me some confidence 
that I might be able to do the same for the ledger line print function.  

I made a “commented c++” version of your hairpin code.  This time I used 
somewhat larger blocks of code which works better than line by line.  I ended 
up also redoing the key signature file that way while I was at it — and made 
the paren correction.  Both attached.

Cheers,
-Paul




key-sig-print-to-scm-commented.ly
Description: Binary data




hairpin-print-to-scm-commented.ly
Description: Binary data


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


Scheme version of ly:ledger-line-spanner::print

2015-08-18 Thread Paul Morris
Recently I looked into trying to rewrite ly:ledger-line-spanner::print in 
Scheme, in order to do some customization of ledger lines.  I didn’t get very 
far...  I then tried to wrap it in my own function in order to post-process the 
stencil it produced.  But I found it produces one stencil per musical system. 
(!)  So it seems a Scheme rewrite might be needed after all.

I realize this is no small task (the function is over 150 lines of code), but I 
thought I’d post about it just in case anyone else has the time and inclination 
to have a go at it.  Currently it’s a bit beyond my skill set.

Cheers,
-Paul


\version 2.19.22

\layout {
  ragged-right = ##t
}

% there is ony one ledger line spanner/grob/stencil 
% produced for each musical system on the page (!)
% see: ledger-line-spanner.cc for c++ code for ly:ledger-line-spanner::print

#(define (MyLedgerLineSpannerPrint grob)
   (let*
((stil (ly:ledger-line-spanner::print grob))
  ;; (ifaces (ly:grob-interfaces grob))

  (noteheads (ly:grob-object grob 'note-heads))
  (new-stil (box-stencil (stencil-with-color stil blue) 0.1 1))
  )

(display noteheads: )(display noteheads)(newline)(newline)
;; (display (ly:grob-properties grob))(newline)(newline)
;; (display ifaces)(newline)(newline)

 new-stil))


\new Staff \with {
  \override LedgerLineSpanner.stencil = #MyLedgerLineSpannerPrint
  \override LedgerLineSpanner.after-line-breaking = #grob::display-objects
} {
  c d e f''' g'''
  \break
  c2 e
}


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


Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Paul Morris
 On Aug 18, 2015, at 9:31 PM, David Nalesnik david.nales...@gmail.com wrote:
 
 (Not long ago I was looking at the C++ function that draws ledger lines 
 (ly:ledger-line-spanner::print in ledger-line-spanner.cc 
 http://ledger-line-spanner.cc/), thinking about overriding it with a custom 
 function.  Well, I didn’t get very far…  So I’ll have to look into David N.’s 
 conversion work here.  David N. if at any point you find yourself looking for 
 another C++ to Scheme translation challenge, let me know!)
 
 Bring it on!  Well, hopefully it's not one that calls on other functions that 
 need to be converted as well!  This one was nice in that there are Scheme 
 equivalents for everything called.

I don’t know, but it’s over 150 lines of code and looks non-trivial in itself.  
(Oddly enough there’s only one ledger line spanner/grob/stencil produced for 
each musical system on the page…)  I’d definitely appreciate any help with it 
if you’re up for giving it a go!

 No doubt finding the bug I introduced is going to take longer than the 
 (ample) time I've already spent on this :(

I hope not.  Anyway, the ledger line stuff can wait indefinitely so there’s no 
rush there.  I’ll start another thread about that with what little progress 
I’ve made so far.

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


Re: Coloring of key signature accidentals based on their pitch

2015-08-18 Thread Paul Morris
 On Aug 18, 2015, at 7:13 PM, Thomas Morley thomasmorle...@gmail.com wrote:
 
 I wonder if this function would better be defined in Scheme than C++.  If
 someone wanted to do something like you're doing, it wouldn't be a trivial
 matter to first redo the function in Scheme to make the necessary changes.
 
 I'd love to see the KeySig-stencil in scheme in our code-base.

Me too.  The more Scheme the better, IMHO and FWIW.  As long as it makes sense 
to those who understand the trade offs, of course.

(Not long ago I was looking at the C++ function that draws ledger lines 
(ly:ledger-line-spanner::print in ledger-line-spanner.cc), thinking about 
overriding it with a custom function.  Well, I didn’t get very far…  So I’ll 
have to look into David N.’s conversion work here.  David N. if at any point 
you find yourself looking for another C++ to Scheme translation challenge, let 
me know!)

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


Re: Centering a stencil on another stencil

2015-08-13 Thread Paul Morris
Here’s another possibility that uses an optional axis argument.  -Paul

\version 2.19.22

#(define* (center-stencil-on-stencil stil-a stil-b #:optional axis)
   Return a copy of stencil @var{stil-b} that has been moved 
   so it is centered on stencil @var{stil-a} on @var{axis}. When
   @var{axis} is omitted, the centering is done on both X and
   Y axes. @var{axis} is 0 for X axis, 1 for Y axis.
   (if axis
   ;; center on one axis only
   (ly:stencil-translate-axis
(ly:stencil-aligned-to stil-b axis CENTER)
(interval-center (ly:stencil-extent stil-a axis))
axis)
   ;; center on both X and Y axes
   (ly:stencil-translate
(centered-stencil stil-b)
(cons
 (interval-center (ly:stencil-extent stil-a X))
 (interval-center (ly:stencil-extent stil-a Y))

square =
#(make-connected-path-stencil
  '((0 0) (4 0) (4 4) (0 4) (0 0))
  0.4 1 1 #f #f)

blue-square =
#(stencil-with-color (make-filled-box-stencil '(0.4 . 2) '(0.4 . 2)) blue)

\markup
\override #'(word-space . 3)
\line {
  \stencil #(ly:stencil-add square blue-square)
  \stencil #(ly:stencil-add square
  (center-stencil-on-stencil square blue-square X))
  \stencil #(ly:stencil-add square
  (center-stencil-on-stencil square blue-square Y))
  \stencil #(ly:stencil-add square
  (center-stencil-on-stencil square blue-square))
}





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


Re: Centering a stencil on another stencil

2015-08-13 Thread Paul Morris
Hi Harm,

 On Aug 13, 2015, at 3:43 PM, Thomas Morley thomasmorle...@gmail.com wrote:
 
 I like this best and would go for it.

Sounds good ...and done:
http://lsr.di.unimi.it/LSR/Item?id=1009

 Regretable my vacations ended. Meaning I've reasonable less time :(

I suppose all good things must come to an end…  Hope they went well!

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


Re: Centering a stencil on another stencil

2015-08-12 Thread Paul Morris
 On Aug 11, 2015, at 8:23 PM, Thomas Morley thomasmorle...@gmail.com wrote:
 
 I'm still not happy with the example, because the second stencil, the
 circle, is centered already.

Ah, right, so your two squares example is better than the circle one.  Lets use 
it for the LSR snippet.

 As a thought I extended the coding to get the possibility of a
 centered stencil in both directions in one go:

Makes sense, although I think I’d prefer two separate functions (see below), 
following the pattern of ly:stencil-translate and ly:stencil-translate-axis. 
For one thing that prevents someone from trying (center-stencil-on-stencil #f 
square circle) with your combined function, with an invalid argument of #f.

%

\version 2.19.22

#(define (center-stencil-on-stencil-axis axis stil-a stil-b)
   Return a copy of stencil @var{stil-b} that has been
   moved so it is centered on stencil @var{stil-a} on
   @var{axis}. @var{axis} is 0 for X axis, 1 for Y axis.
   (ly:stencil-translate-axis
(ly:stencil-aligned-to stil-b axis CENTER)
(interval-center (ly:stencil-extent stil-a axis))
axis))

% one way:

#(define (center-stencil-on-stencil stil-a stil-b)
   Return a copy of stencil @var{stil-b} that has been
   moved so it is centered on stencil @var{stil-a} on
   both X and Y axes.
   (center-stencil-on-stencil-axis Y stil-a
 (center-stencil-on-stencil-axis X stil-a stil-b)))

% but your way is probably better:

#(define (center-stencil-on-stencil stil-a stil-b)
   Return a copy of stencil @var{stil-b} that has been
   moved so it is centered on stencil @var{stil-a} on
   both X and Y axes.
   (ly:stencil-translate
(centered-stencil stil-b)
(cons
 (interval-center (ly:stencil-extent stil-a X))
 (interval-center (ly:stencil-extent stil-a Y)

test =
#(define-scheme-function (parser location stil-1 stil-2)
   (ly:stencil? ly:stencil?)
   #{
 \markup
 \override #'(word-space . 3)
 \line {
   \stencil #(ly:stencil-add stil-1 stil-2)
   \stencil #(ly:stencil-add stil-1
   (center-stencil-on-stencil-axis X stil-1 stil-2))
   \stencil #(ly:stencil-add stil-1
   (center-stencil-on-stencil-axis Y stil-1 stil-2))
   \stencil #(ly:stencil-add stil-1
   (center-stencil-on-stencil stil-1 stil-2))
 }
   #})

square =
#(make-connected-path-stencil
  '((0 0) (4 0) (4 4) (0 4) (0 0))
  0.4 1 1 #f #f)

green-square =
#(stencil-with-color (make-filled-box-stencil '(0 . 2) '(0 . 2)) green)

circle =
#(stencil-with-color (make-circle-stencil 1 0.3 #f) green)

\test #square #circle
\test #square #green-square

%


I don’t think we need both circle and square examples in the LSR snippet. 
In that case we can simplify by not including the test function?
Either way \override #'(word-space . 3) is a nice improvement.
Let me know what you think and I’ll update the LSR snippet.

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


  1   2   3   4   5   6   7   >