Re: Introducing "LilyPond HTML Live Score"

2015-11-30 Thread Mathieu Demange
Hi David,

The jPlayer plugin for jQuery excepts (if possible) two audio formats :
Ogg Vorbis (.ogg) and AAC (.m4a). Please make sure you have your audio
source file converted into those two formats.

I'll update the make-live-script.sh file today so it can accept command
line arguments to specify the .ly source file and the audio files (if
any).

I'll urge myself to write some documentation too!

Yours,

Mathieu


Le dimanche 29 novembre 2015 à 13:15 -0800, David Bellows a écrit :
> > Ow! That's because I clearly didn't except anyone to try the script that 
> > quick :D
> 
> Ha! I've been looking for something like this for a while. There's
> another out there but I've had no luck getting it working and I think
> it's been abandoned.
> 
> > - make sure you adapt the paper format so that your score fits into one 
> > single page (see the \paper block in the original score.ly file)
> > - adapt the Javascript code in the index.tpl file (lines 80, 81, 82) to the 
> > audio files you want to use (if any)
> 
> Ok, I switched to a score that uses only one page.
> 
> I changed line 80 to reflect the name of the piece ("name").
> I changed line 82 to point to the correct ogg file ("name.ogg").
> I'm not sure what to do with line 81:
>A) If I change it to "name.m4a" then everything seems to compile
> and the score is shown in index.html but there's no sound or
> animation.
>B) If I comment out that line then I get the score and the music
> but no animation. So close!
> 
> So I'm almost there!
> 
> And I would very much like to include this in a super huge project I'm
> working once it reaches maturity and to that end I'll help out
> wherever I can (though I'm not much of a programmer).
> 
> Thanks!
> Dave
> 
> On Sun, Nov 29, 2015 at 12:03 PM, Mathieu Demange
>  wrote:
> > Ow! That's because I clearly didn't except anyone to try the script that
> > quick :D It's not fail-proof, yet, but here are some hints (before all this
> > gets managed automatically):
> >
> > - make sure you adapt the paper format so that your score fits into one
> > single page (see the \paper block in the original score.ly file)
> > - adapt the Javascript code in the index.tpl file (lines 80, 81, 82) to the
> > audio files you want to use (if any)
> >
> > Thanks for you interest! The tool is currently at an early stage of
> > development (more like a proof-of-concept actually). There's still quite a
> > lot of work to do :)
> >
> > Yours,
> >
> > Mathieu
> >
> >
> > Le 2015-11-29 20:10, David Bellows a écrit :
> >>
> >> This seems like it might be exceedingly cool, but I'm running into a
> >> problem. When running make-live-score.sh I get this:
> >>
> >> Drawing systems...
> >> Layout output to `score-page-1.svg'...
> >> Layout output to `score-page-2.svg'...
> >> Layout output to `score-page-3.svg'...
> >> Success: compilation successfully completed
> >> Adding #score id to  tag...
> >> sed: can't read score.svg: No such file or directory
> >> Injecting events timing data into score.svg...
> >> Traceback (most recent call last):
> >>   File "injector.py", line 6, in 
> >> svg = ET.parse("score.svg")
> >>   File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
> >> tree.parse(source, parser)
> >>   File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
> >> source = open(source, "rb")
> >> IOError: [Errno 2] No such file or directory: 'score.svg'
> >> Injecting score.svg into index.html...
> >>
> >> I'm really not sure what I should be doing. I changed the name of my
> >> original Lilypond file to score.ly and the svg files are all correct
> >> but the index.html file still plays your original demo.
> >>
> >> On Sun, Nov 29, 2015 at 10:08 AM, Mathieu Demange
> >>  wrote:
> >>>
> >>> Hello all,
> >>>
> >>> I've been developing a tool which is at a very early stage now, but I
> >>> humbly
> >>> guess you should like the idea. Check this very simple page and click the
> >>> "play" button (or you can click any note or rest).
> >>>
> >>> http://www.mathieudemange.fr/lilypond-html-live-score-demo/
> >>>
> >>> There's a public repository for the tool here :
> >>>
> >>> https://gitlab.com/sigmate/lilypond-html-live-score
> >>>
> >>> And the score used in the demo is a transcription I made which is a free
> >>> score (CC-BY-SA) available on this repo :
> >>>
> >>> https://gitlab.com/sigmate/transcription-pools-vibes-solo
> >>>
> >>> Looking forward to hear your feedback!
> >>>
> >>> Cheers,
> >>>
> >>> Mathieu
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> ___
> >>> lilypond-user mailing list
> >>> lilypond-user@gnu.org
> >>> https://lists.gnu.org/mailman/listinfo/lilypond-user
> >>
> >>
> >> ___
> >> lilypond-user mailing list
> >> lilypond-user@gnu.org
> >> https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
> >
> > 

Re: Better slashed graces

2015-11-30 Thread tisimst
David,

On Mon, Nov 30, 2015 at 9:45 AM, David Nalesnik-2 [via Lilypond] <
ml-node+s1069038n184294...@n5.nabble.com> wrote:

> Hi Gilberto,
>
> On Mon, Nov 30, 2015 at 10:16 AM, Gilberto Agostinho <[hidden email]
> > wrote:
>
>> Hi all,
>>
>> I am trying to improve the slashed grace function because currently it
>> does
>> work only for a limited amount of examples. I am trying to make the slash
>> always at the same position relative to the highest beam (which was one of
>> the most annoying things about the other function) and then take into
>> account the beam angle to compensate for the slash angle. My solution is
>> surely very inelegant (regarding programming) so I'd welcome anyone who
>> wants to improve it, but it does a much better job in practise. Compare it
>> below.
>>
>> BEFORE:
>> 
>>
>> AFTER:
>> 
>>
>> Here is the function:  slashed-notes-function.ly
>> <
>> http://lilypond.1069038.n5.nabble.com/file/n184292/slashed-notes-function.ly
>> >
>>
>> Cheers,
>> Gilberto
>>
>>
> Could you provide a link to the function you're trying to improve?  It
> isn't part of the regular distribution.
>

I believe it's in response to this snippet in the LSR:
http://lsr.di.unimi.it/LSR/Item?id=721 (Slashed beamed grace notes)

Gilberto,

I think this is a VERY nice improvement! Great work!

Devs,

Any reason this can't be incorporated into the regular distribution? I know
that beamed grace notes don't *need* a slash, so maybe there could be a
hook to turn it on or off?

Best,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Better-slashed-graces-tp184292p184295.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Better slashed graces

2015-11-30 Thread Gilberto Agostinho
Hi all, thanks for the comments,


tisimst wrote
> I believe it's in response to this snippet in the LSR:
> http://lsr.di.unimi.it/LSR/Item?id=721 (Slashed beamed grace notes)

Yes, that's the function, sorry for being unclear. My improvements above
work well on most cases, but I modified that function using only trial and
error methods, so it's surely not very elegant. If we could come up with a
consistent and good looking slash function, it would be a great addition to
LilyPond, as slashed graces are a fundamental part of contemporary music
(just open any score by Boulez, Stockhausen, Ferneyhough, Cage and others).

Cheers,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Better-slashed-graces-tp184292p184296.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Better slashed graces

2015-11-30 Thread David Nalesnik
Hi again,

On Mon, Nov 30, 2015 at 10:44 AM, David Nalesnik 
wrote:

> Hi Gilberto,
>
> On Mon, Nov 30, 2015 at 10:16 AM, Gilberto Agostinho <
> gilbertohasn...@gmail.com> wrote:
>
>> Hi all,
>>
>> I am trying to improve the slashed grace function because currently it
>> does
>> work only for a limited amount of examples. I am trying to make the slash
>> always at the same position relative to the highest beam (which was one of
>> the most annoying things about the other function) and then take into
>> account the beam angle to compensate for the slash angle. My solution is
>> surely very inelegant (regarding programming) so I'd welcome anyone who
>> wants to improve it, but it does a much better job in practise. Compare it
>> below.
>>
>> BEFORE:
>> 
>>
>> AFTER:
>> 
>>
>> Here is the function:  slashed-notes-function.ly
>> <
>> http://lilypond.1069038.n5.nabble.com/file/n184292/slashed-notes-function.ly
>> >
>>
>> Cheers,
>> Gilberto
>>
>>
> Could you provide a link to the function you're trying to improve?  It
> isn't part of the regular distribution.
>
>
I suppose it's this:
http://www.mail-archive.com/lilypond-user%40gnu.org/msg86544.html

What confuses me a little here is your usage of the stem-fraction
parameter.  This is designed in the original to represent where the slash
crosses the initial stem as a fraction of the stem's length.  From visual
inspection, it appears that you have it set to halfway along the stem in
the original in every case.  The idea--surely not ideal--is that it would
need to be adjusted on a case-by-case basis.

It appears to have a different function in your example.

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


Re: Better slashed graces

2015-11-30 Thread David Nalesnik
On Mon, Nov 30, 2015 at 11:01 AM, tisimst 
wrote:
>
> Devs,
>
> Any reason this can't be incorporated into the regular distribution? I
> know that beamed grace notes don't *need* a slash, so maybe there could
> be a hook to turn it on or off?
>
>
I remember an email--I believe it was from Neil Puttock to Valentin about
the original version of the function (of which the LSR snippet is a
rewrite)--that such a thing ought to have its own grob to
allow for all manner of user customization.  Sorry--can't seem to locate
the mail!!

DN
___
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 Richard Shann
On Mon, 2015-11-30 at 14:56 +0100, Mathieu Demange wrote:
> Hi Richard,
> 
> The ideal approach would have been to have a timing information
> directly inserted in the svg output by LilyPond itself but I tried
> everything I could to obtain such a result with no luck. I posted here
> about that topic but I didn't get any clue.
> 
> So I figured out I'd do it myself.
> 
> I was able to set a grob's ID dynamically and put its "origin" (point
> and click information) in it : that was a way to later reference a
> unique notehead or rest.
> 
> On the other side, the event listener (based on the event-listener.ly
> file bundled with LilyPond) allowed me to get an approximate timing
> information and another "origin" which I could then couple to the
> first one.
[...]
> 
> The script then injects extra HTML5 attributes to the svg code.
> 
> The JavaScript part gather all noteheads and rests  tags and
> creates an array of objects which is then sorted chronologically (svg
> objects are laid out in a way which is not chronological at all).
> 
> Hope this answers even partially to your curiosity :)

Thank you, this goes a little beyond mere curiosity in fact - I just
spent a few days looking at this problem and was just about to abandon
it. Can I ask for an overview of the flow you use?
I can see a 

score.ly

containing the regular LilyPond score and 

live-score.ily

I guess to make the LilyPond executable do things on encountering notes,
rests etc

and I see a python script which seems (I don't speak python!) to take a
file
events.txt

and output a file

score.svg

Is the rest (js) a matter of confabulating the svg from LilyPond with
that score.svg file and an audio file to make the webpage?

Richard





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


Re: Better slashed graces

2015-11-30 Thread David Nalesnik
Hi Gilberto,

On Mon, Nov 30, 2015 at 10:16 AM, Gilberto Agostinho <
gilbertohasn...@gmail.com> wrote:

> Hi all,
>
> I am trying to improve the slashed grace function because currently it does
> work only for a limited amount of examples. I am trying to make the slash
> always at the same position relative to the highest beam (which was one of
> the most annoying things about the other function) and then take into
> account the beam angle to compensate for the slash angle. My solution is
> surely very inelegant (regarding programming) so I'd welcome anyone who
> wants to improve it, but it does a much better job in practise. Compare it
> below.
>
> BEFORE:
> 
>
> AFTER:
> 
>
> Here is the function:  slashed-notes-function.ly
> <
> http://lilypond.1069038.n5.nabble.com/file/n184292/slashed-notes-function.ly
> >
>
> Cheers,
> Gilberto
>
>
Could you provide a link to the function you're trying to improve?  It
isn't part of the regular distribution.

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


Re: Better slashed graces

2015-11-30 Thread Gilberto Agostinho
Hi David,

As I wrote, I simply tried using some basic programming skills and trial and
error in order to get a better looking results, and I would need some help
to make this function look decently (I am not very familiar with Scheme at
all, nor with programming functions in LilyPond). The main thing I tried to
achieve is the following:

- make the slash to always cross the first stem at a constant distance from
beam (the previous function wasn't consistent with this at all, and the
results were all over the place even for beams with similar angles)
- compensate the angle of the slash with the angle of the beam, so that all
of these slashes look more uniform



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Better-slashed-graces-tp184292p184300.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Introducing "LilyPond HTML Live Score"

2015-11-30 Thread Mathieu Demange
Yes! Thanks for the help! I'll check that as soon as possible. This 
could greatly reduce the amount of work which is actually done by the 
python script.


Is there a way to know the current tempo for any given grob ?

Regards,

Mathieu

Le 2015-11-30 15:50, David Nalesnik a écrit :

On Mon, Nov 30, 2015 at 8:43 AM, Urs Liska  wrote:


Am 30.11.2015 um 15:19 schrieb David Kastrup:

Mathieu Demange  writes:


Hi Richard,

The ideal approach would have been to have a timing information
directly inserted in the svg output by LilyPond itself but I tried
everything I could to obtain such a result with no luck. I posted 
here

about that topic but I didn't get any clue.

(grob::rhythmic-location grob) should deliver a pair consisting of
measure number (integer) and position in the measure (Moment).



What does (grob::when grob) do?


It returns the global timestep: how many moments along we are without
any regard for measure.

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


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


Better slashed graces

2015-11-30 Thread Gilberto Agostinho
Hi all,

I am trying to improve the slashed grace function because currently it does
work only for a limited amount of examples. I am trying to make the slash
always at the same position relative to the highest beam (which was one of
the most annoying things about the other function) and then take into
account the beam angle to compensate for the slash angle. My solution is
surely very inelegant (regarding programming) so I'd welcome anyone who
wants to improve it, but it does a much better job in practise. Compare it
below.

BEFORE:
 

AFTER:
 

Here is the function:  slashed-notes-function.ly
  

Cheers,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Better-slashed-graces-tp184292.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Introducing "LilyPond HTML Live Score"

2015-11-30 Thread David Kastrup
Mathieu Demange  writes:

> Yes! Thanks for the help! I'll check that as soon as possible. This
> could greatly reduce the amount of work which is actually done by the
> python script.
>
> Is there a way to know the current tempo for any given grob ?

I don't think so.  The context property tempoWholesPerMinute records the
current tempo so you'd need to fetch this information at grob
acknowledge time (going via ly:translator-context and
ly:context-property) and store it somewhere until the grob is being
typeset.

-- 
David Kastrup

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


RE: A few notes softer

2015-11-30 Thread mskala
On Mon, 30 Nov 2015, Mark Stephen Mrotek wrote:

> Sotto voce?

Thanks, I think sotto voce is the term I want.  How should I indicate its
scope, horizontally and vertically?

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/

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


Re: A few notes softer

2015-11-30 Thread Jacques Menu
Hello Matthew,

How about:

\version "2.19.32"

{ c1\mf d1-\markup{\dynamic "p" \italic sub} e1\mf}

{ c1\mf \once\textLengthOn d1-\markup{ \italic "sotto voce"} e1-\markup{ 
\italic "sopra voce (joke) "}}

JM

> Le 30 nov. 2015 à 19:43, msk...@ansuz.sooke.bc.ca a écrit :
> 
> On Mon, 30 Nov 2015, Mark Stephen Mrotek wrote:
> 
>> Sotto voce?
> 
> Thanks, I think sotto voce is the term I want.  How should I indicate its
> scope, horizontally and vertically?
> 
> -- 
> Matthew Skala
> msk...@ansuz.sooke.bc.ca People before principles.
> http://ansuz.sooke.bc.ca/
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


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


Re: Better slashed graces

2015-11-30 Thread Gilberto Agostinho
David Nalesnik-2 wrote
> You could have the idea of proportionality, but relative to the width of
> the beam, so the line would always cross dead-center or a fixed distance
> below the beams, whether you have 1, 2, 3,  That's doable, but a
> little
> annoying: get the number of beams, the space between beams, do some math.

I don't think that's really necessary, I think very often the slash is
already crossing the beams when it intercepts the stem (when there are too
many beams). Also, if the slash is set against a fixed point (connection
point of top beam and stem) then it's much easier to ensure it will always
look a certain way regardless of the angle of the beams, number of beams,
position of notes, etc. That's for instance how Sibelius handles slashed
graces if my memory serves well (it has been ages since I migrated to
LilyPond...): the slash crosses only the very corner of the beams, so it's
easy for it to look consistent regardless of other variables. See:

 



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Better-slashed-graces-tp184292p184309.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Better slashed graces

2015-11-30 Thread David Nalesnik
On Mon, Nov 30, 2015 at 11:17 AM, Gilberto Agostinho <
gilbertohasn...@gmail.com> wrote:

> Hi David,
>
> As I wrote, I simply tried using some basic programming skills and trial
> and
> error in order to get a better looking results, and I would need some help
> to make this function look decently (I am not very familiar with Scheme at
> all, nor with programming functions in LilyPond). The main thing I tried to
> achieve is the following:
>
> - make the slash to always cross the first stem at a constant distance from
> beam (the previous function wasn't consistent with this at all, and the
> results were all over the place even for beams with similar angles)
>

The reason it isn't consistent with regard to the beam is that the crossing
is determined solely by the quantity stem-fraction which is based on stem
length. The beam is not taken into account for the crossing.  It is,
however, considered with protrusion, how much the line sticks out at either
end, since a sloping beam must be reckoned with.

(Note that the improved examples in your rewrite are doable with the
original function -- you just have to mess with stem-fraction. You can't
leave it at the same setting.  It's the lack of complete automation that
makes the LSR snippet a hassle.)

I like the idea of consulting the beam for the crossing.  After all,
changing the stem-fraction when using the original is probably mostly done
to get a good position relative to the beam!  Should've thought of that :)

My question would be: what is 'stem-fraction' now?  What does it now
measure?

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


RE: A few notes softer

2015-11-30 Thread Mark Stephen Mrotek
Matthew,

Sotto voce?
Piu piano?

Mark

-Original Message-
From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
msk...@ansuz.sooke.bc.ca
Sent: Monday, November 30, 2015 10:11 AM
To: lilypond-user@gnu.org
Subject: A few notes softer

This may be more a question about musical notation than about LilyPond,
but:

I would like to indicate that just a few notes (one hand on the piano for
the duration of one bar) should be played softly.  Not as a progressive
change over time (crescendo/decrescendo), but the isolated notes - play at
normal volume up to that point, play the few soft notes, then go back to the
previous level.

What is the best way to indicate this so that musicians will easily
understand that that is how I intend it to be played?  How can that best
notation be easily achieved with LilyPond?  Is there a standard musical term
for this effect?

Here's what I have at the moment, and what it looks like is attached.
Code extracted from a longer score; in the real file the two hands are
inside separate defines.

% this is in D major; none of these notes will be engraved as accidentals
   << { 8 8
 8 8 } \\
   { \override Hairpin.stencil = #constante-hairpin
  s8._\> s16_\p\< s4_\! } >> |

% the left hand is probably not relevant, but:
4 r4 |

I think this looks nice, but I don't know if anyone else but me will
understand what it means, and I wish I could get the "p" to be centred and
the spacing at the ends of the bracket to be more balanced.  Maybe it would
be better to abuse a tuplet bracket to engrave this?

Having it *also* produce the right velocities for MIDI is probably a lost
cause, but it's no big deal if I have to rewrite that bar for the MIDI
version.  I don't want to just put \p at the start of the bar and \mf at the
start of the immediately following bar, because that suggests changes in the
ongoing overall dynamic level (which I don't intend) and also I don't think
that would clearly indicate that it's just for one hand.

--
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/


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


Re: Better slashed graces

2015-11-30 Thread David Nalesnik
On Mon, Nov 30, 2015 at 11:48 AM, Gilberto Agostinho <
gilbertohasn...@gmail.com> wrote:

> David Nalesnik-2 wrote
> > My question would be: what is 'stem-fraction' now?  What does it now
> > measure?
>
> I have absolutely no idea, I just messed around with the variables and
> expressions until I got a result that looked right in the situations I was
> testing :)


Seems to now be a simple offset of the line along the stem -- 1 is move the
line down 1 ss, rather than put the line at 100% of the stem's length.
Much better, I would say.

You could have the idea of proportionality, but relative to the width of
the beam, so the line would always cross dead-center or a fixed distance
below the beams, whether you have 1, 2, 3,  That's doable, but a little
annoying: get the number of beams, the space between beams, do some math.

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


A few notes softer

2015-11-30 Thread mskala
This may be more a question about musical notation than about LilyPond,
but:

I would like to indicate that just a few notes (one hand on the piano for
the duration of one bar) should be played softly.  Not as a progressive
change over time (crescendo/decrescendo), but the isolated notes - play at
normal volume up to that point, play the few soft notes, then go back to
the previous level.

What is the best way to indicate this so that musicians will easily
understand that that is how I intend it to be played?  How can that best
notation be easily achieved with LilyPond?  Is there a standard musical
term for this effect?

Here's what I have at the moment, and what it looks like is attached.
Code extracted from a longer score; in the real file the two hands are
inside separate defines.

% this is in D major; none of these notes will be engraved as accidentals
   << { 8 8
 8 8 } \\
   { \override Hairpin.stencil = #constante-hairpin
  s8._\> s16_\p\< s4_\! } >> |

% the left hand is probably not relevant, but:
4 r4 |

I think this looks nice, but I don't know if anyone else but me will
understand what it means, and I wish I could get the "p" to be centred and
the spacing at the ends of the bracket to be more balanced.  Maybe it
would be better to abuse a tuplet bracket to engrave this?

Having it *also* produce the right velocities for MIDI is probably a
lost cause, but it's no big deal if I have to rewrite that bar for the
MIDI version.  I don't want to just put \p at the start of the bar and \mf
at the start of the immediately following bar, because that suggests
changes in the ongoing overall dynamic level (which I don't intend) and
also I don't think that would clearly indicate that it's just for one
hand.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/

piano-bar.png
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Better slashed graces

2015-11-30 Thread Gilberto Agostinho
David Nalesnik-2 wrote
> My question would be: what is 'stem-fraction' now?  What does it now
> measure?

I have absolutely no idea, I just messed around with the variables and
expressions until I got a result that looked right in the situations I was
testing :) As you say, ideally this all could be automatized, so that those
three arguments can actually become three parameters in the function.



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Better-slashed-graces-tp184292p184302.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Better slashed graces

2015-11-30 Thread David Nalesnik
On Mon, Nov 30, 2015 at 12:08 PM, David Nalesnik 
wrote:

>
>
> You could have the idea of proportionality, but relative to the width of
> the beam, so the line would always cross dead-center or a fixed distance
>

Well, not "fixed" if proportional...
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: transpose pitch by semitones

2015-11-30 Thread Gilles THIBAULT

> #(define (semitones->pitch semitone)
>(let ((index (modulo semitone 12))
>  (octave (floor (/ semitone 12
>  (list
>   octave
>   (list-ref
>'((0 0)   ; c
>   (0 1/2) ; cis
>   (1 0)   ; d
>   (1 1/2) ; dis
>   (2 0)   ; e
>   (3 0)   ; f
>   (3 1/2) ; fis %  \jiPitch 2 1
> 
>   (4 0)   ; g
>   (4 1/2) ; gis
>   (5 0)   ; a
>   (5 1/2) ; ais
>   (6 0))   ; b
>index
> 
> but would like to find a solution that is more straightforward.
Sorry to answer so late.
I made this function some times ago, but don't know if is enough   
straightforward :-)


\version "2.18.2"

#(define (semitones->pitch n)
(let loop ((a 0)
   (b 0)
   (c n))
  (cond 
   ((> c 11)(loop (1+ a) b (- n 12)))
   ((< c 0)(loop (1- a) b (+ n 12)))
   ((< c 5) (ly:make-pitch a (quotient c 2) (* 1/2 (modulo c 2
   (else (ly:make-pitch a (quotient (1+ c) 2) (* 1/2 (modulo (1+ c) 2)))

%%% test

#(for-each 
   (lambda(n)(format #t "~2,' d - ~a\n" n (semitones->pitch n)))
   '(-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))

%

-- 
Gilles

___
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: Introducing "LilyPond HTML Live Score"

2015-11-30 Thread David Bellows
> The jPlayer plugin for jQuery excepts (if possible) two audio formats :
> Ogg Vorbis (.ogg) and AAC (.m4a). Please make sure you have your audio
> source file converted into those two formats.

Hey Mathieu,

So here is my Lilypond test file.

\include "live-score.ily"
\score{
  {c e g c'}
  \layout {}
  \midi {}
}

I then convert that to an ogg file with Timidity:

timidity -Ov score.midi

If I run make-live-score.sh as is then I get the score in index.html
but no sound or animation.

If I comment out line 81, the m4a part, then I get the score and the
sound but no animation.

I'm using Lilypond 2.19.32

On Mon, Nov 30, 2015 at 1:52 AM, Mathieu Demange
 wrote:
> Hi David,
>
> The jPlayer plugin for jQuery excepts (if possible) two audio formats :
> Ogg Vorbis (.ogg) and AAC (.m4a). Please make sure you have your audio
> source file converted into those two formats.
>
> I'll update the make-live-script.sh file today so it can accept command
> line arguments to specify the .ly source file and the audio files (if
> any).
>
> I'll urge myself to write some documentation too!
>
> Yours,
>
> Mathieu
>
>
> Le dimanche 29 novembre 2015 à 13:15 -0800, David Bellows a écrit :
>> > Ow! That's because I clearly didn't except anyone to try the script that 
>> > quick :D
>>
>> Ha! I've been looking for something like this for a while. There's
>> another out there but I've had no luck getting it working and I think
>> it's been abandoned.
>>
>> > - make sure you adapt the paper format so that your score fits into one 
>> > single page (see the \paper block in the original score.ly file)
>> > - adapt the Javascript code in the index.tpl file (lines 80, 81, 82) to 
>> > the audio files you want to use (if any)
>>
>> Ok, I switched to a score that uses only one page.
>>
>> I changed line 80 to reflect the name of the piece ("name").
>> I changed line 82 to point to the correct ogg file ("name.ogg").
>> I'm not sure what to do with line 81:
>>A) If I change it to "name.m4a" then everything seems to compile
>> and the score is shown in index.html but there's no sound or
>> animation.
>>B) If I comment out that line then I get the score and the music
>> but no animation. So close!
>>
>> So I'm almost there!
>>
>> And I would very much like to include this in a super huge project I'm
>> working once it reaches maturity and to that end I'll help out
>> wherever I can (though I'm not much of a programmer).
>>
>> Thanks!
>> Dave
>>
>> On Sun, Nov 29, 2015 at 12:03 PM, Mathieu Demange
>>  wrote:
>> > Ow! That's because I clearly didn't except anyone to try the script that
>> > quick :D It's not fail-proof, yet, but here are some hints (before all this
>> > gets managed automatically):
>> >
>> > - make sure you adapt the paper format so that your score fits into one
>> > single page (see the \paper block in the original score.ly file)
>> > - adapt the Javascript code in the index.tpl file (lines 80, 81, 82) to the
>> > audio files you want to use (if any)
>> >
>> > Thanks for you interest! The tool is currently at an early stage of
>> > development (more like a proof-of-concept actually). There's still quite a
>> > lot of work to do :)
>> >
>> > Yours,
>> >
>> > Mathieu
>> >
>> >
>> > Le 2015-11-29 20:10, David Bellows a écrit :
>> >>
>> >> This seems like it might be exceedingly cool, but I'm running into a
>> >> problem. When running make-live-score.sh I get this:
>> >>
>> >> Drawing systems...
>> >> Layout output to `score-page-1.svg'...
>> >> Layout output to `score-page-2.svg'...
>> >> Layout output to `score-page-3.svg'...
>> >> Success: compilation successfully completed
>> >> Adding #score id to  tag...
>> >> sed: can't read score.svg: No such file or directory
>> >> Injecting events timing data into score.svg...
>> >> Traceback (most recent call last):
>> >>   File "injector.py", line 6, in 
>> >> svg = ET.parse("score.svg")
>> >>   File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
>> >> tree.parse(source, parser)
>> >>   File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
>> >> source = open(source, "rb")
>> >> IOError: [Errno 2] No such file or directory: 'score.svg'
>> >> Injecting score.svg into index.html...
>> >>
>> >> I'm really not sure what I should be doing. I changed the name of my
>> >> original Lilypond file to score.ly and the svg files are all correct
>> >> but the index.html file still plays your original demo.
>> >>
>> >> On Sun, Nov 29, 2015 at 10:08 AM, Mathieu Demange
>> >>  wrote:
>> >>>
>> >>> Hello all,
>> >>>
>> >>> I've been developing a tool which is at a very early stage now, but I
>> >>> humbly
>> >>> guess you should like the idea. Check this very simple page and click the
>> >>> "play" button (or you can click any note or rest).
>> >>>
>> >>> http://www.mathieudemange.fr/lilypond-html-live-score-demo/
>> >>>
>> >>> There's a public repository for the 

Re: Is there a similar command to LaTeX's \vfill?

2015-11-30 Thread Andrew Bernard
HI Joshua,

Trail and error I am afraid.

Andrew


On 1/12/2015, 10:16, "Joshua Nichols" 
 wrote:

​Thanks for the lead. How can I apply this to force the item it puts space 
before to the bottom of the page? All I see is application for mm specific 
intervals.​

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


Re: Layout of a (piano) hand indicator

2015-11-30 Thread Simon Albrecht

Hello Urs,

it’s very handy that you just came up with this thread, since I’m 
needing the very thing in a score I just do.

I wrote an event function to nicely wrap up your approach:

%%%
\version "2.19.32"

hook =
#(let ((direction? (lambda (n) (= 1 (abs n
   (hook-markup #{ \markup \path #0.175 #'((moveto 0 0)
   (rlineto -0.85 0)
   (rlineto 0 3)) #}))
   (define-event-function (direction on-line) (direction? boolean?)
 (let* ((self-al (if on-line 0.6 0.31))
(self-al (if (= direction 1) (- self-al) self-al)))
   #{
 \tweak self-alignment-Y $self-al
 \tweak extra-spacing-width #'(-.5 . 0)
 \finger \markup \scale #(cons 1 direction) #hook-markup
   #})))

\layout {
  \context {
\Voice
fingeringOrientations = #'(left)
  }
}

{
   
}
%%

It’s not quite elegant with its hard-coded values, but it’s easy to use.

Thanks for the ideas,
Simon

On 24.11.2015 23:44, Urs Liska wrote:


Am 24.11.2015 um 22:39 schrieb Simon Albrecht:

On 24.11.2015 18:49, Urs Liska wrote:

Hi all,

please consider the attached image, especially the "half-bracket" at the
center. This is to indicate that this d' is to be played with the
left hand.

Is there anything I could improve to the proportions and placement of
that sign?

Any suggestions for improvement welcome. Suggestions for *not* improving
it even more ;-)

I agree that it looks quite good, and that the vertical part should be
shorter. Also, the horizontal part could be longer in my eyes.
And I’d be very interested in how you did it :-)


I use a very simple \path. Originally I simply added it as a \markup and
used extra-offset to position it. But thanks to Abraham's blog post I
changed that to use a fingering indication. However, I'm not really sure
this is more reliable (for example against transposition):

So this is what it looks like now:

\set fingeringOrientations = #'(left)
 8

Urs


Yours, Simon


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


RE: Layout of a (piano) hand indicator

2015-11-30 Thread Mark Stephen Mrotek
Simon,

Attached is a snippet for bracket and hand indication from my library. I
cannot remember from whom I got it, so I cannot properly ascribe.

Mark

-Original Message-
From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
Simon Albrecht
Sent: Monday, November 30, 2015 3:29 PM
To: Urs Liska ; lilypond-user 
Subject: Re: Layout of a (piano) hand indicator

Hello Urs,

it's very handy that you just came up with this thread, since I'm needing
the very thing in a score I just do.
I wrote an event function to nicely wrap up your approach:

%%%
\version "2.19.32"

hook =
#(let ((direction? (lambda (n) (= 1 (abs n
(hook-markup #{ \markup \path #0.175 #'((moveto 0 0)
(rlineto -0.85 0)
(rlineto 0 3)) #}))
(define-event-function (direction on-line) (direction? boolean?)
  (let* ((self-al (if on-line 0.6 0.31))
 (self-al (if (= direction 1) (- self-al) self-al)))
#{
  \tweak self-alignment-Y $self-al
  \tweak extra-spacing-width #'(-.5 . 0)
  \finger \markup \scale #(cons 1 direction) #hook-markup
#})))

\layout {
   \context {
 \Voice
 fingeringOrientations = #'(left)
   }
}

{
     } %%

It's not quite elegant with its hard-coded values, but it's easy to use.

Thanks for the ideas,
Simon

On 24.11.2015 23:44, Urs Liska wrote:
>
> Am 24.11.2015 um 22:39 schrieb Simon Albrecht:
>> On 24.11.2015 18:49, Urs Liska wrote:
>>> Hi all,
>>>
>>> please consider the attached image, especially the "half-bracket" at 
>>> the center. This is to indicate that this d' is to be played with 
>>> the left hand.
>>>
>>> Is there anything I could improve to the proportions and placement 
>>> of that sign?
>>>
>>> Any suggestions for improvement welcome. Suggestions for *not* 
>>> improving it even more ;-)
>> I agree that it looks quite good, and that the vertical part should 
>> be shorter. Also, the horizontal part could be longer in my eyes.
>> And I'd be very interested in how you did it :-)
>>
> I use a very simple \path. Originally I simply added it as a \markup 
> and used extra-offset to position it. But thanks to Abraham's blog 
> post I changed that to use a fingering indication. However, I'm not 
> really sure this is more reliable (for example against transposition):
>
> So this is what it looks like now:
>
> \set fingeringOrientations = #'(left)
>  \markup {
>\path #0.175
>#'((moveto 0 -2)
>   (rlineto 0 3)
>   (rlineto 0.85 0)
>   (moveto -1.5 2)) } > 8
>
> Urs
>
>> Yours, Simon



Hand indicators.docx
Description: MS-Word 2007 document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Is there a similar command to LaTeX's \vfill?

2015-11-30 Thread Joshua Nichols
​Thanks for the lead. How can I apply this to force the item it puts space
before to the bottom of the page? All I see is application for mm specific
intervals.​



IX,

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


Re: aligning melisma and non-melisma lyrics across staves in the same system

2015-11-30 Thread Thomas Morley
2015-11-28 23:54 GMT+01:00 Kieren MacMillan :
> Hi Thomas,
>
> Thanks for the detailed and helpful response!
>
>> If you want to attract me working on some of your most pressing
>> issues, please write short, add a compilable code-example (no link)
>> and give feed-back.
>
> I will make sure to do that.

Thanks.

> Now as to your proposed solution…
[...]
>
>> How should the lyrics of third Staff be aligned?
>
> I guess in a perfect world, the engraver would only “couple” lyrics which are 
> exactly the same string as a melisma-aligned lyric. So in the case of the 
> example you provided, the alignment of the lyrics for the third staff would 
> be unaffected (i.e., would align as per default); *however*, if there were a 
> fourth staff with the same lyrics as the third staff, and one of those were 
> melismatic, then the lyrics for the third and fourth staff would “couple up” 
> with regard to alignment.
>
> 1. Does that make sense?
> 2. Is it feasible to implement?

Yes, parts of it works already. Look at the attached image.
In first bar the lyrics are aligned correctly I'd say.
Though not in 3rd bar. "three" is offsetted as well, it shouldn't.

The problem is how to test equality?
For strings it's trivial, but LyricText also allows for markup.
Thus "blue" and \markup \with-color #red "blue" should return true for
some equality-test.
Maybe I'll go for length of grob-extent or stencil-extent, though I
have to test if these values are available early enough.
At any rate, with this method "blue" and "elub" will probably return
false positive...

>
>> Maybe affecting 'self-alignment-X is the wrong method at all,
>> instead I could probably set 'X-offset.
>
> Perhaps someone else [with a more encyclopedic knowledge of the back-end] can 
> weigh in on that. I am (and always have been) a little confused by the 
> difference — and especially interaction — of these two parameters.
>
> 1. They seem to have the same effect, once the math is worked out (i.e., 
> ‘self-alignment-X is proportional to the width of the LyricText grob, whereas 
> ‘X-offset is an absolute value). I don’t see any difference between them in 
> terms of the effect they have on [horizontal] spacing, etc.
>
> 2. On the other hand, I have recently found that there are potentially 
> frustrating interactions between them. For example, the “center-on-word” 
> snippet appears to render #'self-alignment-X untweakable, and it also appears 
> to render lyricMelismaAlignment incapable of accepting non-integral values. 
> (I intend to code a minimal example, but am currently too swamped to do so, 
> which is why it’s not been made into an issue.)


I think David answered already sufficiently about the difference,
although I'm still not sure how to proceed.
Likely I'll go for 'self-alignment-X only ...

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


Re: unpacking a list

2015-11-30 Thread Urs Liska
Hi David,

now finally to this one ...

Am 28.11.2015 um 10:52 schrieb David Kastrup:
> Urs Liska  writes:
>
>> If someone might want to have a second look at the actual code it's
>> (currently) in
>> https://github.com/openlilylib/snippets/blob/just-intonation-stub/notation-snippets/just-intonation/definitions.ily,
>> towards the end where it reads "(append (color-music col) ..."
> Well, obviously you could just write
>
> #{ #@(color-music col) $pitch $duration -#(format "~@f" cent) #}
>
> instead of
>
> (make-music
>  'SequentialMusic
>  'elements
>  (append
>   (color-music col)
>   (list
>(make-music
> 'NoteEvent
> 'articulations
> (list (make-music
>'TextScriptEvent
>'text (format "~@f" cent)))
> 'pitch pitch
> 'duration ji-duration
>
> And it would likely result in somewhat better point-and-click behavior
> out of the box (of course, one can fix the above make-music calls for
> the same effect if it's a matter of professional pride).

Indeed, that's much better and produces point-and-click *at all*. And
especially it looks much more expandable once I might want to add more
bells and whistles to the generated music.

How would I find out about that solution? What I came up with was the
result of taking \displayMusic's result as a model.

Concretely: Can you tell me what the "#@" in front of (color-music does?

Thanks
Urs


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


\autochange and \override of dynamics and hairpins

2015-11-30 Thread Gilberto Agostinho
Hi all,

Can anyone explain to me why the second system doesn't work, while the last
one does? Can't I use \override commands inside a \autochange block?

\version "2.19.28"

\markup{"no override, no problems"}
\new PianoStaff \autochange {
  a\p\< d' g f'\f
}

\markup{"autochange doesn't work here"}
\new PianoStaff \autochange {
  \override PianoStaff.DynamicText.stencil = ##f
  \override PianoStaff.Hairpin.stencil = ##f
  a\p\< d' g f'\f
}

\markup{"autochange works fine here"}
\new PianoStaff {
  \override PianoStaff.DynamicText.stencil = ##f
  \override PianoStaff.Hairpin.stencil = ##f  
  \autochange {
a\p\< d' g f'\f
  }
}

 

Cheers,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/autochange-and-override-of-dynamics-and-hairpins-tp184278.html
Sent from the User mailing list archive at Nabble.com.

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


Re: Gounod - Le Rendez Vous

2015-11-30 Thread Alberto Simões




in a nutshell:
s2\> s4\!
instead of
s2.\> s\!

And I have yet another suggestion: It works as is, but LilyPond would
have more freedom to make good linebreaks if you insert \bar "" at
appropriate places in the introduction’s cadenza.


Hi, Simon

Better like this?
https://github.com/ambs/music/blob/master/Gounod/LeRendezVous/suite.pdf

Thanks
Alberto


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


Force minor trill playback

2015-11-30 Thread Gilberto Agostinho
Hi all,

In case someone else will find this useful, here is a way to force all
trills to be minor:

\include "articulate.ly"
\version "2.19.28"

#(define (ac:trill music)
  (let* ((hemisemidur (ly:make-duration 5 0 1/1))
 (orig-len  (ly:music-length music))
 (t (ac:twiddletime music))
 (uppernote '())
 (note_moment (ly:moment-mul t (ly:make-moment 1/2)))
 (c1 (ly:moment-div orig-len t))
 (c2 (inexact->exact
  (round (/ (ly:moment-main-numerator c1)
  (* 2 (ly:moment-main-denominator c1))
 (count (if (< c2 2) 2 c2)))

   (set! (ly:music-property music 'elements)
(filter (lambda (y) (eq? 'NoteEvent (ly:music-property y 'name)))
 (ly:music-property music 'elements)))
   (map (lambda (y) (ac:setduration y hemisemidur))
(ly:music-property music 'elements))
   (set! uppernote (ly:music-transpose (ly:music-deep-copy music)
(ly:make-pitch 0 0 SHARP)))

   (let* ((trillMusicElements
  (let loop ((so_far (list uppernote music))
 (c count))
   (if (> c 1)
(loop (append (list (ly:music-deep-copy uppernote)
(ly:music-deep-copy music)) so_far) (1- c))
so_far)))
  (trillMusic (make-sequential-music trillMusicElements))
  (newlen (ly:music-length trillMusic))
  (factor (ly:moment-div  orig-len newlen)))
(ly:music-compress trillMusic factor)
)))

music = { \time 2/4 c'4\startTrillSpan d' e' fis'}

\score { 
  \unfoldRepeats \new Staff \articulate \music
  \midi {}
}

Cheers,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Force-minor-trill-playback-tp184281.html
Sent from the User mailing list archive at Nabble.com.

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


Re: \autochange and \override of dynamics and hairpins

2015-11-30 Thread Gilberto Agostinho
Interesting enough, this works:

\version "2.19.28" 
\new PianoStaff \autochange {
  \override Score.DynamicText.stencil = ##f
  \override Score.Hairpin.stencil = ##f
  a\p\< d' g f'\f
}



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/autochange-and-override-of-dynamics-and-hairpins-tp184278p184279.html
Sent from the User mailing list archive at Nabble.com.

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


Re: unpacking a list

2015-11-30 Thread Urs Liska


Am 30.11.2015 um 09:27 schrieb Urs Liska:
> Hi David,
>
> now finally to this one ...
>
> Am 28.11.2015 um 10:52 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> If someone might want to have a second look at the actual code it's
>>> (currently) in
>>> https://github.com/openlilylib/snippets/blob/just-intonation-stub/notation-snippets/just-intonation/definitions.ily,
>>> towards the end where it reads "(append (color-music col) ..."
>> Well, obviously you could just write
>>
>> #{ #@(color-music col) $pitch $duration -#(format "~@f" cent) #}
>>
>> instead of
>>
>> (make-music
>>  'SequentialMusic
>>  'elements
>>  (append
>>   (color-music col)
>>   (list
>>(make-music
>> 'NoteEvent
>> 'articulations
>> (list (make-music
>>'TextScriptEvent
>>'text (format "~@f" cent)))
>> 'pitch pitch
>> 'duration ji-duration
>>
>> And it would likely result in somewhat better point-and-click behavior
>> out of the box (of course, one can fix the above make-music calls for
>> the same effect if it's a matter of professional pride).
> Indeed, that's much better and produces point-and-click *at all*. And
> especially it looks much more expandable once I might want to add more
> bells and whistles to the generated music.
>
> How would I find out about that solution? What I came up with was the
> result of taking \displayMusic's result as a model.
>
> Concretely: Can you tell me what the "#@" in front of (color-music does?

Maybe, not for having someone else do the work for me but as an
incentive to learn:

I assume I could also rewrite the following code in a similar fashion?

% Produce the code for coloring one grob in a (make-music) expression
#(define (color-element grob color)
   (make-music
'ContextSpeccedMusic
'context-type
'Bottom
'element
(make-music
 'OverrideProperty
 'once
 #t
 'pop-first
 #t
 'grob-value
 color
 'grob-property-path
 (list (quote color))
 'symbol
 grob)))

What would that be in the newer, LilyPond-ish syntax?

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


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


Re: unpacking a list

2015-11-30 Thread David Kastrup
Urs Liska  writes:

> Am 30.11.2015 um 09:27 schrieb Urs Liska:
>
> Maybe, not for having someone else do the work for me but as an
> incentive to learn:
>
> I assume I could also rewrite the following code in a similar fashion?
>
> % Produce the code for coloring one grob in a (make-music) expression
> #(define (color-element grob color)
>(make-music
> 'ContextSpeccedMusic
> 'context-type
> 'Bottom
> 'element
> (make-music
>  'OverrideProperty
>  'once
>  #t
>  'pop-first
>  #t
>  'grob-value
>  color
>  'grob-property-path
>  (list (quote color))
>  'symbol
>  grob)))
>
> What would that be in the newer, LilyPond-ish syntax?

Oh, #{ ... #} is not new.  It's been there since basically forever at
least for straightforward music expressions (rather than layout
definitions, markups, and other stuff).  It became more versatile around
2.14 and started to work nicely with lexical closures at a similar point
of time.

The above would roughly be

#(define (color-element grob color)
  #{ \once \override #grob . color = #color #})

Note that the default context for overrides is Bottom anyway, so you
don't need to write \override Bottom . #grob . color here.

-- 
David Kastrup

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


Re: unpacking a list

2015-11-30 Thread David Kastrup
Urs Liska  writes:

> now finally to this one ...
>
> Am 28.11.2015 um 10:52 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> If someone might want to have a second look at the actual code it's
>>> (currently) in
>>> https://github.com/openlilylib/snippets/blob/just-intonation-stub/notation-snippets/just-intonation/definitions.ily,
>>> towards the end where it reads "(append (color-music col) ..."
>> Well, obviously you could just write
>>
>> #{ #@(color-music col) $pitch $duration -#(format "~@f" cent) #}
>>
>> instead of
>>
>> (make-music
[...]

> Indeed, that's much better and produces point-and-click *at all*.

Well, one can use 'origin (*location*) arguments (and the top-level
music returned by a music function gets that automatically, but the top
level here is sequential music and you cannot click that as it is just a
container of other music).  Or equivalently call ly:set-origin! on such
expression that should get point-and-click info.

Or, previously to 2.19.22, use 'origin location arguments to make-music,
assuming that one has used the default (parser location ...) argument
list at the top of the music function.

> And especially it looks much more expandable once I might want to add
> more bells and whistles to the generated music.
>
> How would I find out about that solution? What I came up with was the
> result of taking \displayMusic's result as a model.

Well, the above is likely taking whatever syntax you fed into
\displayMusic as a model.  Which is sort of the point of #{ ... #}.

> Concretely: Can you tell me what the "#@" in front of (color-music
> does?

It's like the difference between , (unquote) and ,@ (unquote-splicing).
The first is for putting a single Scheme expression somewhere, the
second takes a list as argument and turns every list element into a
separate Scheme expression.

-- 
David Kastrup

___
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 Mathieu Demange
Hi Richard,
The ideal approach would have been to have a timing information directly inserted in the svg output by LilyPond itself but I tried everything I could to obtain such a result with no luck. I posted here about that topic but I didn't get any clue.
So I figured out I'd do it myself.
I was able to set a grob's ID dynamically and put its "origin" (point and click information) in it : that was a way to later reference a unique notehead or rest.
On the other side, the event listener (based on the event-listener.ly file bundled with LilyPond) allowed me to get an approximate timing information and another "origin" which I could then couple to the first one.
I say "approximate" because the event listener itself seems imperfect to me (even though I'm glad it exist, of course). The "moment" value is always computed on a 4/4 time signature basis, even if specified otherwise. Time signatures events themselves are not reported even though there's a listener for that. Anyway, I got rid of those little things by calculating timing data myself.
In the python script, I'm basically keeping track of a current tempo and use delta-time computations over note and rest events to calculate their real timing.
The script then injects extra HTML5 attributes to the svg code.
The _javascript_ part gather all noteheads and rests  tags and creates an array of objects which is then sorted chronologically (svg objects are laid out in a way which is not chronological at all).
Hope this answers even partially to your curiosity :)
I really appreciate your feedback and I'm happy to have reasons to keep working on that tool other than myself only :)
Cheers,
Mathieu

Le 30 nov. 2015 13:39, Richard Shann  a écrit :On Sun, 2015-11-29 at 19:08 +0100, Mathieu Demange wrote:
> Hello all,
> 
> I've been developing a tool which is at a very early stage now, but I 
> humbly guess you should like the idea. Check this very simple page and 
> click the "play" button (or you can click any note or rest).

I wonder could you give a brief over-view of how you are finding
locations in the LilyPond typeset score that correspond with times?

I ask because by strange coincidence I have just spent the last few days
exploring this topic: I resorted to specifying the number of bars per
line and systems per page and setting the

 Score.proportionalNotationDuration = #(ly:make-moment ...

so as to arrive at a score where I could calculate the location by
dead-reckoning.
Could you say, very roughly, what you are doing?

And, if there has been any further progress in LilyPond to generate a
set of timings for locations in a LilyPond svg or pdf output score which
I may have missed, can anyone else on the list enlighten me.

Richard


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


Re: Gounod - Le Rendez Vous

2015-11-30 Thread tisimst
Alberto,

On Mon, Nov 30, 2015 at 4:25 AM, Alberto Simões-2 [via Lilypond] <
ml-node+s1069038n184280...@n5.nabble.com> wrote:

>
> >
> > in a nutshell:
> > s2\> s4\!
> > instead of
> > s2.\> s\!
> >
> > And I have yet another suggestion: It works as is, but LilyPond would
> > have more freedom to make good linebreaks if you insert \bar "" at
> > appropriate places in the introduction’s cadenza.
>
> Hi, Simon
>
> Better like this?
> https://github.com/ambs/music/blob/master/Gounod/LeRendezVous/suite.pdf


Now, that looks very nice. Great job! It will be a great addition to IMSLP.

Best,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Gounod-Le-Rendez-Vous-tp183419p184284.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: unpacking a list

2015-11-30 Thread Urs Liska


Am 30.11.2015 um 10:03 schrieb David Kastrup:
> Urs Liska  writes:
>
>> Am 30.11.2015 um 09:27 schrieb Urs Liska:
>>
>> Maybe, not for having someone else do the work for me but as an
>> incentive to learn:
>>
>> I assume I could also rewrite the following code in a similar fashion?
>>
>> % Produce the code for coloring one grob in a (make-music) expression
>> #(define (color-element grob color)
>>(make-music
>> 'ContextSpeccedMusic
>> 'context-type
>> 'Bottom
>> 'element
>> (make-music
>>  'OverrideProperty
>>  'once
>>  #t
>>  'pop-first
>>  #t
>>  'grob-value
>>  color
>>  'grob-property-path
>>  (list (quote color))
>>  'symbol
>>  grob)))
>>
>> What would that be in the newer, LilyPond-ish syntax?
> Oh, #{ ... #} is not new.  It's been there since basically forever at
> least for straightforward music expressions (rather than layout
> definitions, markups, and other stuff).  It became more versatile around
> 2.14 and started to work nicely with lexical closures at a similar point
> of time.
>
> The above would roughly be
>
> #(define (color-element grob color)
>   #{ \once \override #grob . color = #color #})
>
> Note that the default context for overrides is Bottom anyway, so you
> don't need to write \override Bottom . #grob . color here.
>

Oh, seems like a typical case of not seeing the forest for the trees ...

Thanks for the explanations
Urs

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


Re: unpacking a list

2015-11-30 Thread Urs Liska


Am 30.11.2015 um 09:53 schrieb David Kastrup:
>> Concretely: Can you tell me what the "#@" in front of (color-music
>> > does?
> It's like the difference between , (unquote) and ,@ (unquote-splicing).
> The first is for putting a single Scheme expression somewhere, the
> second takes a list as argument and turns every list element into a
> separate Scheme expression.

Thanks, I think I'll get to an understanding from there
Urs

___
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 Richard Shann
On Sun, 2015-11-29 at 19:08 +0100, Mathieu Demange wrote:
> Hello all,
> 
> I've been developing a tool which is at a very early stage now, but I 
> humbly guess you should like the idea. Check this very simple page and 
> click the "play" button (or you can click any note or rest).

I wonder could you give a brief over-view of how you are finding
locations in the LilyPond typeset score that correspond with times?

I ask because by strange coincidence I have just spent the last few days
exploring this topic: I resorted to specifying the number of bars per
line and systems per page and setting the

 Score.proportionalNotationDuration = #(ly:make-moment ...

so as to arrive at a score where I could calculate the location by
dead-reckoning.
Could you say, very roughly, what you are doing?

And, if there has been any further progress in LilyPond to generate a
set of timings for locations in a LilyPond svg or pdf output score which
I may have missed, can anyone else on the list enlighten me.

Richard






___
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 David Kastrup
Mathieu Demange  writes:

> Hi Richard,
>
> The ideal approach would have been to have a timing information
> directly inserted in the svg output by LilyPond itself but I tried
> everything I could to obtain such a result with no luck. I posted here
> about that topic but I didn't get any clue.

(grob::rhythmic-location grob) should deliver a pair consisting of
measure number (integer) and position in the measure (Moment).

-- 
David Kastrup

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


Re: Gounod - Le Rendez Vous

2015-11-30 Thread Alberto Simões



On 30/11/15 14:08, tisimst wrote:

Now, that looks very nice. Great job! It will be a great addition to IMSLP.


Thank you for your help.
I will also contact Chris Sawyer, in case he wants to add these two 
musics to Mutopia.


Best,
Alberto

___
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 Urs Liska


Am 30.11.2015 um 15:19 schrieb David Kastrup:
> Mathieu Demange  writes:
>
>> Hi Richard,
>>
>> The ideal approach would have been to have a timing information
>> directly inserted in the svg output by LilyPond itself but I tried
>> everything I could to obtain such a result with no luck. I posted here
>> about that topic but I didn't get any clue.
> (grob::rhythmic-location grob) should deliver a pair consisting of
> measure number (integer) and position in the measure (Moment).
>

What does (grob::when grob) do?

___
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 David Kastrup
Urs Liska  writes:

> Am 30.11.2015 um 15:19 schrieb David Kastrup:
>> Mathieu Demange  writes:
>>
>>> Hi Richard,
>>>
>>> The ideal approach would have been to have a timing information
>>> directly inserted in the svg output by LilyPond itself but I tried
>>> everything I could to obtain such a result with no luck. I posted here
>>> about that topic but I didn't get any clue.
>> (grob::rhythmic-location grob) should deliver a pair consisting of
>> measure number (integer) and position in the measure (Moment).
>>
>
> What does (grob::when grob) do?

Absolute position measured from the start.  That's the only thing moving
between \cadenzaOn and \cadenzaOff and is reliable for sorting and other
stuff, but the value is not particularly human-friendly.

-- 
David Kastrup

___
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 David Nalesnik
On Mon, Nov 30, 2015 at 8:43 AM, Urs Liska  wrote:

>
>
> Am 30.11.2015 um 15:19 schrieb David Kastrup:
> > Mathieu Demange  writes:
> >
> >> Hi Richard,
> >>
> >> The ideal approach would have been to have a timing information
> >> directly inserted in the svg output by LilyPond itself but I tried
> >> everything I could to obtain such a result with no luck. I posted here
> >> about that topic but I didn't get any clue.
> > (grob::rhythmic-location grob) should deliver a pair consisting of
> > measure number (integer) and position in the measure (Moment).
> >
>
> What does (grob::when grob) do?
>
>
It returns the global timestep: how many moments along we are without any
regard for measure.

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