Re: Openlilylib

2022-08-12 Thread Jan-Peter Voigt

Hi Mark,

thank you! Due to a change in work, I haven't gotten around to testing
your changes in depth yet, but I assume that as an OLL user, you've
solved the problems so that it works. When I have it running here, I may
approach you with a call for a pull request.

Best
Jan-Peter


Am 17.07.22 um 16:56 schrieb Mark Knoop:

Hi Andrew and other OLL users,

At 18:24 on 27 May 2022, Andrew Bernard wrote:

The upshot of that is that I suppose I should revive the OLL work. I'll
recreate the dedicated server I set up, recreate the Discourse forum for
discussion, and work on the git repository, then people can
collaboratively work together again and I can take pull requests and so
on.


Just a note to say that I have forks of some of the OLL repositories on
Github as follows.

https://github.com/markk/oll-core
https://github.com/markk/edition-engraver
https://github.com/markk/partial-compilation
https://github.com/markk/breaks

Some of these have some minor updates to make them compatible with
current LilyPond and Guile 2.2.

Andrew, I'm happy for you to host an alternative repository if you
prefer, but it would be good to avoid multiple forks and duplicated effort.

I note a bug with the edition-engraver which can no longer address the
first moment of the score. This needs further investigation (unless
somebody else has already solved this?).

--
Mark Knoop






Re: ANN: Spontini-Editor version 1.12-alfa

2022-02-19 Thread Jan-Peter Voigt
Hello Paolo,

thank for that hint, I wasn’t aware of it.
I’d delegate the SSL-Question to some docker-compose setup with Traefik and 
maybe Authelia.
Until now I haven’t used Authelia yet and I use another image for the SSL part 
for my own setups, but it is also a setup with  nginx serving as a reverse 
proxy with certs from lets-encrypt.
That way you don’t need to bloat the Spontini image with this Cert-Stuff.

Cheers
Jan-Peter

> Am 19.02.2022 um 12:59 schrieb Paolo Prete :
> 
> Hello Jan-Peter, 
> 
> thanks for your contribution! 
> There's already a docker setup for the editor, similar to yours, together 
> with other very useful setups (ly2video, fonts etc.), made by Alexis:
> 
> https://github.com/jeandeaual/docker-lilypond/pulls 
> <https://github.com/jeandeaual/docker-lilypond/pulls>
> 
> However, it's not pushed yet because we have to find a practical way to solve 
> an issue which appears in your setup too: the need to use the 0.0.0.0 address 
> with HTTP, which could be unsafe. 
> It is possibile, with Spontini, to use certs, so to switch to HTTPS and avoid 
> this issue:
> 
> https://github.com/paopre/Spontini/blob/master/documentation/webserver.md 
> <https://github.com/paopre/Spontini/blob/master/documentation/webserver.md>
> 
> However, this could be a bit cumbersome with docker, because the user would 
> have to create certs and then push them to the container through some 
> command. If we find a shorter way to obtain a HTTPS setup it would be much 
> better. 
> I don't know if a sort of duckdns plugin can be a solution... 
> Please let me know if you have any idea about this. 
> 
> Cheers
> Paolo
> 
> 
> 
> 
> 
> On Saturday, February 19, 2022, Jan-Peter Voigt  <mailto:jp.vo...@gmx.de>> wrote:
> Hello Paolo,
> 
> I really like Spontini and created a docker setup to test it. I just
> started it again. It takes some time to build, but then one can use it
> from http://localhost:8000/spontini-editor/ 
> <http://localhost:8000/spontini-editor/>.
> 
> Best
> Jan-Peter
> 
> Am 11.02.22 um 00:33 schrieb Paolo Prete:
> > Hello,
> >
> > I have published a new version of Spontini-Editor (1.12-alpha): it is
> > still in the testing phase and therefore not available in the list of
> > releases, but it is already working and it can be downloaded from the
> > main project page.
> >
> > https://github.com/paopre/Spontini <https://github.com/paopre/Spontini>
> >
> > The important features of this version are:
> >
> > 1) support for PDF output, in order to speed up the compilation of
> > scores. Thanks to the PDF mode, instead of SVG, the compilation time
> > drastically decreases: once the score has been sketched it is possible
> > to switch to SVG mode, in order to complete it through tweaks with the
> > mouse.
> >
> > 2) MIDI input: it is now possible to enter notes / chords via a MIDI
> > device, using the Web MIDI API on both Chrome and Firefox. It is also
> > possible to insert these notes automatically in the tables for the
> > creation of piano / cross-staff music.
> > In this case the notes are automatically inserted in the upper staff,
> > but they can then be quickly moved to the lower staff (or vice versa)
> > with the arrow keys of the keyboard (see the image below)
> >
> > https://github.com/paopre/Spontini/blob/master/documentation/images/midiInput.gif
> >  
> > <https://github.com/paopre/Spontini/blob/master/documentation/images/midiInput.gif>
> >
> > https://github.com/paopre/Spontini/blob/master/documentation/miscellaneous.md
> >  
> > <https://github.com/paopre/Spontini/blob/master/documentation/miscellaneous.md>
> >
> > HTH,
> > P.
> 



Re: ANN: Spontini-Editor version 1.12-alfa

2022-02-19 Thread Jan-Peter Voigt
Hello Paolo,

I really like Spontini and created a docker setup to test it. I just
started it again. It takes some time to build, but then one can use it
from http://localhost:8000/spontini-editor/.

Best
Jan-Peter

Am 11.02.22 um 00:33 schrieb Paolo Prete:
> Hello,
>
> I have published a new version of Spontini-Editor (1.12-alpha): it is
> still in the testing phase and therefore not available in the list of
> releases, but it is already working and it can be downloaded from the
> main project page.
>
> https://github.com/paopre/Spontini
>
> The important features of this version are:
>
> 1) support for PDF output, in order to speed up the compilation of
> scores. Thanks to the PDF mode, instead of SVG, the compilation time
> drastically decreases: once the score has been sketched it is possible
> to switch to SVG mode, in order to complete it through tweaks with the
> mouse.
>
> 2) MIDI input: it is now possible to enter notes / chords via a MIDI
> device, using the Web MIDI API on both Chrome and Firefox. It is also
> possible to insert these notes automatically in the tables for the
> creation of piano / cross-staff music.
> In this case the notes are automatically inserted in the upper staff,
> but they can then be quickly moved to the lower staff (or vice versa)
> with the arrow keys of the keyboard (see the image below)
>
> https://github.com/paopre/Spontini/blob/master/documentation/images/midiInput.gif
>
> https://github.com/paopre/Spontini/blob/master/documentation/miscellaneous.md
>
> HTH,
> P.



docker-compose.yml
Description: application/yaml
FROM ubuntu

RUN apt-get update
RUN apt-get install -y tzdata
RUN apt-get install -y python3 python3-tk python3-pip python3-venv git
RUN apt-get install -y lilypond
RUN useradd -ms /bin/bash spontini

USER spontini
WORKDIR /home/spontini

RUN git clone https://github.com/paopre/Spontini.git

WORKDIR  /home/spontini/Spontini

CMD python3 SpontiniServer.py nogui
#
# Created (28/11/2020) by Paolo-Prete.
# This file is part of Spontini-Editor project.
#
# Spontini-Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Spontini-Editor is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Spontini-Editor. If not, see .
#

cli = {
  "app":"spontini_server_core:asgi",
  "host":"0.0.0.0",
  "port":8000,
# "ssl_keyfile":"key.pem",
# "ssl_certfile":"cert.pem",
  "log_level":"info",
  "timeout_keep_alive":1000
}


Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jan-Peter Voigt



> Am 08.10.2021 um 12:04 schrieb David Kastrup :
> 
> Jan-Peter Voigt  writes:
> 
>> Hi all,
>> 
>> probably what I am writing now is not new to most of you. About a year
>> ago there was a discussion regarding the license of Lilypond, triggered
>> by Urs' question about the future of OLL. Again and again the
>> documentation was referred to, which says that Lilypond is a compiler
>> that translates the source code into a PDF. For God's sake, I don't want
>> to discuss the licensing consequences again, but I want to point out
>> that this representation is not exactly complete. In fact, each source
>> file is translated into a Lilypond internal executable, the execution of
>> which then generates the PDF.
> 
> Uh, no?  Calling LilyPond's internal representation of music an
> "executable" is nonsensical since it does not imply any actions but is a
> structural representation of music.
Ok, my designation as internal executable is certainly not a good picture.
My point is that this process is not a pure translation language A to language 
B.
Whatsoever, this is not the topic I want to discuss.
> There never is any linear
> representation being "executed", and source files are interpreted rather
> than compiled, with no file-level representation ever being explicit.
Well at least a (Scheme) Engraver can be used to instruct that a note head be
painted red if it is the third moment in the measure. Alternatively, this 
information
can be given to each affected notehead via override. The source file is 
interpreted,
as you write, and not compiled, as written in the documentation.
(https://lilypond.org/windows.html, https://lilypond.org/macos-x.html, 
https://lilypond.org/unix.html: "Compiling a file")
> That's not an academic difference since it is a non-trivial question
> just what the structure of a MusicXML file is supposed to represent from
> a given LilyPond input file.
Yes, that is essentially what I wanted to say.

Jan-Peter




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jan-Peter Voigt
Hi all,

probably what I am writing now is not new to most of you. About a year
ago there was a discussion regarding the license of Lilypond, triggered
by Urs' question about the future of OLL. Again and again the
documentation was referred to, which says that Lilypond is a compiler
that translates the source code into a PDF. For God's sake, I don't want
to discuss the licensing consequences again, but I want to point out
that this representation is not exactly complete. In fact, each source
file is translated into a Lilypond internal executable, the execution of
which then generates the PDF. This architecture is representable in XML,
if it is possible at all, only with extensions to MEI or MusicXML. So
the goal should only be to implement the graphical representation
accordingly.
But this also means that structures that serve a better organization of
the lilypond source code will most likely be lost during export and
re-import.

Several solutions for the export have now been mentioned. Behind these
are three concepts, all of which have their justification:
1. convert source-based (python-ly accessible through frescobaldi).
2. lilypond internal generation of an intermediate code
3. scheme based generation of an intermediate code

If the sources comply, i.e. do not contain Scheme, then the python-ly
solution is quite charming, fast and batchable. But I would find the
internal generation of an intermediate code, as envisioned and developed
by Jacques, the nicest. The Scheme based solution I started from the
pragmatic consideration that if it works, it can be quickly adapted and
deployed in different environments.

I'm very glad to see this discussion revisited. Maybe something more can
be developed together in this direction. For this reason, I am also
pushing the discussion to the devel list. ;-)

I'll be on the road for the next week, but I plan to get back to the
topic after that.

Cheers,

Jan-Peter


Am 07.10.21 um 22:51 schrieb Thomas Morley:
> Am Do., 7. Okt. 2021 um 13:32 Uhr schrieb Jean Abou Samra 
> :
>>
>> Harm,
>>
>> Le 07/10/2021 à 11:46, Thomas Morley a écrit :
>>> Not sure Jan-Peter's approach is the best method ...
>>
>> What makes you think so?
>>
>> Best,
>> Jean
>
> Maybe my wording was misleading.
>
> I tested ly->musicxml with
> (1) openlilylib, i.e. Jan-Peter
> (2) python-ly
> (3) Frescobaldi
> (4) https://github.com/de-wolff/lilypond.git
>
> Then tried reimporting the resulting xml-file via
> (a) musicxml2ly
> (b) xml2ly
>
> All results were terrible. Here I stopped frustrated.
> I did not look into any code, thus I simply don't know which one is
> the most promising approach.
>
> Cheers,
>   Harm
>




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jan-Peter Voigt
Hello Peter, and all,

I spotted the problem with the OLL export-solution in 2.22+:
In api.scm ll. 278,279 the call to ly:grob-properties fails. In that
acknowledger block the stem direction is recorded. I'll look how to fix
that later. If you like to try it out, you can temporarily just delete
or comment that block (ll. 274-281).

Cheers,

Jan-Peter

Am 07.10.21 um 11:49 schrieb Jan-Peter Voigt:
> Hello Peter,
>
> yes, I still receive the messages from the list, but since I have
> changed jobs, my commitment to Lilypond has fallen behind a bit.
> But I hope to curate and update my code soon so that it can serve as a
> starting point for further development. Of course, Jacque's work should
> not be lost sight of, as native support would be nice. But maybe the
> scheme-engraver based solution can push the issue a bit.
> This topic has been on my mind for quite some time. Since Lilypond does
> not offer XML export, its use is problematic in many areas. If I want to
> offer something to a publisher, I can't get anywhere with Lilypond in
> most cases. If I want to archive the notes in a structured way, I can
> come up with 1001 solutions in Scheme that fill a database. But if I
> have curated data in MEI format (or MusicXML), I can systematically feed
> a database (e.g. eXist) with it and provide a REST API afterwards to
> build fancy Webapps.
>
> Best regards,
>
> Jan-Peter
>
>
>
> Am 07.10.21 um 11:30 schrieb Peter Toye:
>> The potential need has gone away now - my Sibelius user has told me that
>> he uses ScoreMuse to export the PDF into a suitable format for Sibelius.
>> Looks to me like an expensive way of doing it, but if he can afford
>> Sibelius he can probably afford ScoreMuse as well.
>>
>>  
>>
>> I agree that exchanging music information between different engravers is
>> an extremely complex problem and I don't underestimate the difficulty.
>>
>>  
>>
>> I tried Jan-Peter's code on Github, but it seems to be broken on recent
>> versions of LilyPond. I'm told it works on 19.0  but I don't have
>> that version any more. And I don't have a contact for him to ask - is he
>> on this mailing list?
>>
>>
>> Best regards,
>>
>>
>> Peter
>>
>> mailto:lilyp...@ptoye.com <mailto:lilyp...@ptoye.com>
>>
>> www.ptoye.com <https://www.ptoye.com>
>>
>>
>> -
>>
>> Wednesday, October 6, 2021, 8:05:12 PM, Jean Abou Samra wrote:
>>
>>
>> Le 05/10/2021 à 13:08, Peter Toye a écrit :
>>
>>
>> Sorry - edited subject to get the linking correct
>>
>>
>>  Harm,
>>
>>
>> 
>> https://music.stackexchange.com/questions/42315/lilypond-to-musicxml-to-sibelius#73706
>> 
>> <https://music.stackexchange.com/questions/42315/lilypond-to-musicxml-to-sibelius#73706>
>>  >
>> 
>> <https://music.stackexchange.com/questions/42315/lilypond-to-musicxml-to-sibelius#73706
>> 
>> <https://music.stackexchange.com/questions/42315/lilypond-to-musicxml-to-sibelius#73706>>
>>  has
>> > a discussion about this as well. I've started looking at >
>> the OpenLilyLib solution at the bottom of the thread but it
>> doesn't > work on later versions of LilyPond.
>>
>>
>> It would seem to me that using LP's parsing mechanisms is the
>> right > way to go about it, and I'd offer to help if my health
>> allowed. Is > there anyone on this mailing list who knows about it?
>>
>>
>>
>>
>> About the parsing? Certainly, but the potentiel
>> project spans many different areas of LilyPond.
>> And he design space is vast.
>>
>>
>> With Jacques Menu, we some had private discussions
>> about this. It may be feasible to implement XML export
>> by utilizing Jacque's musicformats library (see
>> his post). So far I only have rough ideas about
>> the LilyPond part, and it is not my current priority.
>>
>>
>> I think the most advanced solution so far is Jan-Peter's
>> https://github.com/openlilylib/lilypond-export
>> <https://github.com/openlilylib/lilypond-export>
>> https://lists.gnu.org/archive/html/lilypond-devel/2018-10/msg00068.html
>> <https://lists.gnu.org/archive/html/lilypond-devel/2018-10/msg00068.html>
>> (CCing him). One could start off from that.
>>
>>
>> It's something I will probably need soon.
>>
>>
>>
>>
>> By do means do try to help out, but don't
>> hold your breathe for it. It is a large
>> endeavor.
>>
>>
>> Best,
>> Jean
>>
>
>




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread Jan-Peter Voigt
Hello Peter,

yes, I still receive the messages from the list, but since I have
changed jobs, my commitment to Lilypond has fallen behind a bit.
But I hope to curate and update my code soon so that it can serve as a
starting point for further development. Of course, Jacque's work should
not be lost sight of, as native support would be nice. But maybe the
scheme-engraver based solution can push the issue a bit.
This topic has been on my mind for quite some time. Since Lilypond does
not offer XML export, its use is problematic in many areas. If I want to
offer something to a publisher, I can't get anywhere with Lilypond in
most cases. If I want to archive the notes in a structured way, I can
come up with 1001 solutions in Scheme that fill a database. But if I
have curated data in MEI format (or MusicXML), I can systematically feed
a database (e.g. eXist) with it and provide a REST API afterwards to
build fancy Webapps.

Best regards,

Jan-Peter



Am 07.10.21 um 11:30 schrieb Peter Toye:
> The potential need has gone away now - my Sibelius user has told me that
> he uses ScoreMuse to export the PDF into a suitable format for Sibelius.
> Looks to me like an expensive way of doing it, but if he can afford
> Sibelius he can probably afford ScoreMuse as well.
>
>  
>
> I agree that exchanging music information between different engravers is
> an extremely complex problem and I don't underestimate the difficulty.
>
>  
>
> I tried Jan-Peter's code on Github, but it seems to be broken on recent
> versions of LilyPond. I'm told it works on 19.0  but I don't have
> that version any more. And I don't have a contact for him to ask - is he
> on this mailing list?
>
>
> Best regards,
>
>
> Peter
>
> mailto:lilyp...@ptoye.com 
>
> www.ptoye.com 
>
>
> -
>
> Wednesday, October 6, 2021, 8:05:12 PM, Jean Abou Samra wrote:
>
>
> Le 05/10/2021 à 13:08, Peter Toye a écrit :
>
>
> Sorry - edited subject to get the linking correct
>
>
>  Harm,
>
>
> 
> https://music.stackexchange.com/questions/42315/lilypond-to-musicxml-to-sibelius#73706
> 
> 
>  >
> 
>  
> >
>  has
> > a discussion about this as well. I've started looking at >
> the OpenLilyLib solution at the bottom of the thread but it
> doesn't > work on later versions of LilyPond.
>
>
> It would seem to me that using LP's parsing mechanisms is the
> right > way to go about it, and I'd offer to help if my health
> allowed. Is > there anyone on this mailing list who knows about it?
>
>
>
>
> About the parsing? Certainly, but the potentiel
> project spans many different areas of LilyPond.
> And he design space is vast.
>
>
> With Jacques Menu, we some had private discussions
> about this. It may be feasible to implement XML export
> by utilizing Jacque's musicformats library (see
> his post). So far I only have rough ideas about
> the LilyPond part, and it is not my current priority.
>
>
> I think the most advanced solution so far is Jan-Peter's
> https://github.com/openlilylib/lilypond-export
> 
> https://lists.gnu.org/archive/html/lilypond-devel/2018-10/msg00068.html
> 
> (CCing him). One could start off from that.
>
>
> It's something I will probably need soon.
>
>
>
>
> By do means do try to help out, but don't
> hold your breathe for it. It is a large
> endeavor.
>
>
> Best,
> Jean
>




Frescobaldi and Lilypond on Apple Silicon

2021-01-12 Thread Jan-Peter Voigt
Hi list,

at the beginning of this year, I received a MacBookPro with Apple
Silicon. Have any of you used Lilypond and Frescobaldi successfully on
this hardware?
A preview version of Docker is running on the machine and with an ARM
Ubuntu it is indeed possible to start an ARM Lilypond. I will test this
out further and report back later.

Jan-Peter



Re: OLL and git

2020-10-12 Thread Jan-Peter Voigt
Thank you, Andrew!
Of course I can assist especially with the edition-engraver and the
lalily-templates ;-)

Jan-Peter

Am 11.10.20 um 11:19 schrieb Andrew Bernard:
> To all interested in OLL. as I am starting this anew, in effect, I am
> at the moment considering moving to Gitlab instead of Github. There is
> precedent for this - lilypond is there! (not that that is directly
> related to OLL). The current github organisation has been orphaned as
> far as I can see, and for me to do the work and make the improvements
> I see I prefer to move to Gitlab, so I can have complete management
> control. Likewise, openlilylib.org has been removed, and I have
> registered openlilylib.space and I am building a new website today,
> which will have documentation, a blog, and support material and so on,
> and anything else people may want.
>
> My career has been in UNIX software development and IT Enterprise
> Architecture. I am critically aware of the impact that changes can
> have on people and existing code. However, I have been unhappy, as an
> end user, with OLL git being fragmented into a number of repos. This
> makes it harder than need be for beginners and people, and part of the
> whole reason I am taking this on is to enhance the uptake and utility
> for lilypond users, so I want to unify the work into one repo. There's
> no criticism of what is there, but I think it 'just grew'. Now, making
> a change like this would mean people will have to re-org their code a
> bit, but on reflection I don't think this is a big deal or a big job,
> and to move forward sometimes breaking changes need to be made.
>
> I will of course keep all the very valuable existing code modules -
> nothing will change there, except I will complete the move to make all
> the snippets package compliant modules.
>
> Changes like this often cause an uproar, but the existing github will
> still be around, and people can move as and when they see fit, and all
> new development and contributions should occur on the new Gitlab repo.
> [It's not ready yet - I only started in on this with definite intent
> today.]
>
> Andrew
>




Re: openLilyLib git

2020-10-07 Thread Jan-Peter Voigt
Am 07.10.20 um 02:18 schrieb Andrew Bernard:
> Urs and all,
>
> What happens to orphaned git repos? Not a case I am familiar with.
>
> I'd be happy to fork the OLL repo and take over the management and
> development. Should I do that? Are you going to delete the existing
> repo?
>
> Andrew
>
Hi Andrew,

I would appreciate it, if you would take over the management. Let me
know, when created your own fork.

Jan-Peter



Re: Future of openLilyLib

2020-10-06 Thread Jan-Peter Voigt
Hi all,

I would like to repeat Urs' call to participate in the work of OLL. I
share the opinion that it is a very versatile and powerful toolbox. My
own contributions are mainly the edition-engraver and the
lalily-templates. If you have any questions about what they are and how
they work, feel free to contact me via this list or py pm.

Best,
Jan-Peter

Am 21.09.20 um 17:24 schrieb Urs Liska:
> Hi all,
>
> to begin with, I am of the (biased) opinion that openLilyLib is a
> powerful and useful extension infrastructure for LilyPond. There are a
> number of versatile and extended ready-to-use packages available, most
> notably probably edition-engraver, scholarLY and anaLYsis. But also the
> underlying oll-core is versatile and powerful, providing numerous
> building blocks without which I would not start any large-scale project
> anymore.
>
> I can understand why this view is not shared by everyone, most likely
> simply because too much about OLL is obscure or unknown, lacking proper
> documentation, although the general introduction at https://openlilylib
> .org should be a good start (and there are substantial manuals for the
> scholarLY and stylesheets packages, but only in (undocumentedly) self-
> compilable form).
>
> At this point openLilyLib is completely dependent on my availability,
> at least because I am the only person with knowledge of the basic code
> in oll-core.
>
> For several reasons which I won't discuss publicly I will have to
> reduce my availablity to work on openLilyLib (and other stuff) and may
> be forced to completely withdraw at any point within the next years.
>
> I would find it a pity if that would mean the end for openLilyLib.
> Therefore I'm looking not for a new maintainer but for more people
> engaging in the project, to build a community around it that can at
> some point continue without my aid.
>
> The aspects needing support most urgently AFAICT are (in descending
> order):
>
>  * getting more people familiar with oll-core (using the opportunity to
>maybe improve the coding where appropriate)
>  * complete the documentation system in order to make a more complete
>documentation feasible (here the most crucial part is integrating
>consistently scalable score examples in the web site output).
>  * getting more people familiar with the coding of scholarLY
>  * do maintenance of everything, maybe throwing out some less-than-
>useful packages
>  * write a Frescobaldi extension for managing (installing, updating the
>library or individual packages, preparing documents) openLilyLib and
>providing an API for secondary extensions (e.g. an annotation
>editor/viewer or a tool to graphically insert editionMods).
>
> If anything of this looks like your cup of tea you are welcome to
> contact me privately or discuss stuff on-list. Of course I am more than
> willing to help with any of these tasks.
>
> Best
> Urs
>
>




Re: Poster for music engraving conference

2020-01-12 Thread Jan-Peter Voigt
Hi Klaus,

this poster looks appealing and complete. The only comment I'd like to
give is what Urs already mentioned. Du you think the font-sizes are big
enough for A0 paper?

Jan-Peter

Am 12.01.20 um 00:54 schrieb Klaus Blum:
> Hi Jan-Peter, hi Werner,
>
> in cooperation with Urs Liska and Joram Berger, I have made a Poster
> about integrating LilyPond fragments into LibreOffice documents
> (OOoLilyPond / OLy) and into Wikipedia articles (MediaWiki).
> If anyone has suggestions what could be improved, I'm still open for
> anything.
> Especially for the MediaWiki part, I'm still unsure when to talk about
> the website "Wikipedia" or the software "Wikimedia" or the format
> "Wikitext" to be most comprehensible...
>
> Cheers,
> Klaus
>
>
>




Re: Poster for music engraving conference

2020-01-10 Thread Jan-Peter Voigt
Hello Fellows,

in December Werner asked for a poster for the conference. Did somebody
actually produce something?
The last days I tried something based on the baposter-LaTeX-class.
I'll not be able to finish the poster on my own until monday ... , but
if you'd like to collaborate on this topic or you have a poster, I can
donate some content to, please let me know!

Jan-Peter


Am 04.12.19 um 12:05 schrieb Werner LEMBERG:
>
> Folks,
>
>
> the music engraving conference in Salzburg (January 17.-19.) aims to
> present as much note engraving programs as possible.  While some
> companies send representatives (e.g., Dorico, Capella, Finale) – some
> even with talks – we don't have something similar for LilyPond in the
> main part of the conference.
>
> Instead, we would like to have a poster (in A0 format) that shows how
> LilyPond works, together with some showcase results.
>
> Now my question: Are there people who are willing to produce such a
> poster?  Has anyone already done something similar for other
> conferences?
>
>
> Werner
>




Re: Display the control points of a slur

2019-11-13 Thread Jan-Peter Voigt
Hi Aaron,

thank you for this nice snippet!

Jan-Peter

Am 13.11.19 um 16:00 schrieb Aaron Hill:
> On 2019-11-13 6:32 am, Paolo Prete wrote:
>> Hello,
>> I wonder if is there a script or a snippet for doing that without
>> using Frescobaldi
>
> Probably not perfect, but here's something you can fiddle with:
>
> 
> \version "2.19.83"
>
> showControlPoints = #(grob-transformer 'stencil (lambda (grob orig)
>   (define (draw-control-point pt)
>     #{ \markup \translate $pt \with-color #red \draw-circle #0.15 #0 ##t
> #})
>   (define (draw-control-segment pt1 pt2)
>     (let ((delta (cons (- (car pt2) (car pt1)) (- (cdr pt2) (cdr pt1)
>   #{ \markup \translate $pt1 \with-color #'(1 .5 0) \draw-line
> $delta #}))
>   (let* ((pts (ly:grob-property grob 'control-points))
>  (dots (map (lambda (pt)
>     (grob-interpret-markup grob (draw-control-point pt)))
>     pts))
>  (lines (map (lambda (pt1 pt2)
>     (grob-interpret-markup grob (draw-control-segment pt1 pt2)))
>     pts (cdr pts
>     (ly:stencil-add
>   (apply ly:stencil-add lines)
>   (apply ly:stencil-add dots)
>   orig
>
> \layout { \context { \Voice
>   \override PhrasingSlur.stencil = #showControlPoints
>   \override Slur.stencil = #showControlPoints
>   \override Tie.stencil = #showControlPoints
> } }
>
> \fixed c' { g4\( a b2~ | b2( e'8 d') c'4\) }
> 
>
>
> -- Aaron Hill




Re: 'Compressing' a 1 bar full bar rest

2019-11-06 Thread Jan-Peter Voigt
Am 06.11.19 um 09:43 schrieb Malte Meyn:
>
>
> Am 06.11.19 um 09:38 schrieb Jacques Menu:
>> Hello folks,
>>
>> I’d like to show that explicitly with a number, i.e. to have a ‘1’
>> above measure 2 in this example:
>>
>> \version "2.19.83"
>>
>> {
>>    \time 4/4
>>    \compressFullBarRests
>>
>>    R1*2 |
>>    R1*1 |
>>    c' |
>> }
>> How can that be achieved?
>> Thanks for your help!
>
> \set restNumberThreshold = 0
>

I guess, this is not what you want, but for completeness:

\override MultiMeasureRest.expand-limit = 0






Re: Scoped variables

2019-11-04 Thread Jan-Peter Voigt
Peter,

in the article Kieren mentioned, I tried to summarize some thoughts
around the multi-movement issue and some more.
You can find the corresponding templating engine at:
https://github.com/openlilylib/lalily-templates

That framework does a lot to do things automagically. But probably this
is too much for your needs. So one key point is that a template is
basically a music-function. If one defines variables like timothy proposed:

I.violinI = { ... }
I.violinII = { ... }
II.violinI = { ... }
II.violinII = { ... }

and defines a music-function

TwoVlns = #(define-music-function (mvt)(list?)
 #{
   <<
 \new Staff { $(assoc-get 'violinI mvt) }
 \new Staff { $(assoc-get 'violinII mvt) }
   >>
 #})

the music can instantiated like the following:

\score {
\TwoVlns #I
}
\score {
\TwoVlns #II
}

In the framework are functions defined for storing and getting music
that prevent a failure if some music is not defined (yet), but logs a
warning about missing music.

So if you have questions don't hesitate to contact me!

Best regards
Jan-Peter


Am 04.11.19 um 13:03 schrieb Peter Toye:
> Kieren,
>
> That looks great at a first skim-through. Thanks.
>
> Best regards,
>
> Peter
> mailto:lilyp...@ptoye.com
> www.ptoye.com 
>
> -
> Monday, November 4, 2019, 11:06:55 AM, Kieren MacMillan wrote:
>
> *> Hi Peter,
>
>>> If a publisher wanted to collect Mr. Lanfear's string quartets (assuming 
>>> that he has written more than one) into a single volume, the Lilypond code 
>>> would have to be changed to rename all of the variables to something like 
>>> QiIViolinI
>
>> In the engraving of my larger works (operas,
>> musicals, multi-movement concert works, etc.),
>> I’ve done exactly that. It’s only a small bit of extra effort.
>
>>> Now you can have a directory/file structure like:
>
>>> Book
>>>   Book.ly
>>>   Quartet1
>>>     Movement1
>>>       Score.ly
>>>       Violin1.ly
>>>       ...
>>>     Movement2
>>>       Score.ly
>>>      
>>> etc.
>
>> Have you looked at Jan-Peter’s templating
>> system (cf.
> *> http://lilypondblog.org/2014/07/trees-music-and-lilypond/
> 
> *> and other links)? I think it does exactly what you’re talking about.
>
>> Hope that helps!
>> Kieren.
>



Re: Edition Engraver master vs refactor override branch: changing bound-details

2019-05-05 Thread Jan-Peter Voigt
Hi Stefano,

Am 05.05.19 um 06:12 schrieb Stefano Troncaro:
> Hi Jan Peter,
>
> I tested the newly merged refactor-override branch a little bit. As
> far as I could tell it seems to be working fine and the problem I
> described in my original post (where there was an error when a
> grob-property-path consisted of a list) is solved.
>
> A minor issue I find is that the Edition Engraver is now printing a
> lot of superfluous warnings of the type "edition-engraver overriden by
> music!". I say superfluous because the overrides are clearly working
> as intended and there is nothing in the music overlapping with the
> overrides I want the EE to make
> However, I've been unable to replicate this problem in small contained
> examples. This happened in projects of some size, and when I try to
> extract the problematic measures to create a self-contained one or two
> bar example, then the warnings are not created anymore. Because of
> this I hesitated a bit about describing the problem, but since the
> same projects create no superfluous warnings when compiled with the
> current master branch I thought it might be useful to tell you about
> it either way.
>
> If I recall correctly this used to happen some time ago? Maybe it
> reappeared because it was still present in the refactor-override branch.
>
> I'll see if tomorrow I manage to narrow it down and create an example.
>
> I hope this was of some use,
o yes, it is of use. It reminds me of making this log message optional
and to narrow it down to really affected cases. The problem is that in
certain cases an override inside the music stream can override an
override injected by the EE. The problem may not obvious on first sight:
Some LilyPond constructs inject overrides into the music stream like for
example simultaneous music (<< .. \\ .. >>). Now when you have such a
section of simultaneous music and you want to affect stem-direction in
Voice "1" the EE-override will be overridden on the first moment the
simultaneous music is introduced.
I introduced this log message to identify possible cases. IIRC this was
the main reason to not merge into master yet.

I'll look into it the next days.

Jan-Peter

> Stéfano
>
> El sáb., 4 may. 2019 a las 14:13, Stefano Troncaro
> (mailto:stefanotronc...@gmail.com>>) escribió:
>
> Hi Jan Peter, I'll update and let you know if I find any problems
> with the updated refactor-override branch.
>
> Thank you for all your work in the Edition Engraver!
>
> El vie., 3 may. 2019 a las 3:37, Jan-Peter Voigt ( <mailto:jp.vo...@gmx.de>>) escribió:
>
> Hi Stefano,
>
> a lot of lilypond-unrelated business prevented me working on
> the edition-engraver and especially in the
> refactor-override-branch for quite a while.
> Meanwhile there where some small issues to fix in master so
> the two branches diverged.
> So the old and stale 'refactor-override-branch' is a
> development branch removing and changing code related to
> \override, \set et al..
> Now I merged master into 'refactor-override-branch' so it is
> up to date with master.
> For now I suggest using the updated branch. I am going to test
> it soon so that is fit to be merged into master.
> And the next development branch is 'absolute-timing' meant to
> introduce anchors and the correct handling of cadenza sections.
>
> If there are any problems with the 'refactor-override-branch'
> please let me know and I am going to fix it asap.
>
> Jan-Peter
>
>
> Am 30.04.19 um 17:16 schrieb Stefano Troncaro:
>> Hi Jan-Peter,
>>
>> Sure! Please let me know if you manage to solve it so I can
>> update.
>>
>> Thank you!
>>
>> El dom., 28 abr. 2019 a las 16:05, Jan-Peter Voigt
>> (mailto:jp.vo...@gmx.de>>) escribió:
>>
>> Hi Stefano,
>>
>> sorry for the delay. I've been away for several days.
>> I have to look into this deeper ... I guess it is related
>> to the
>> grob-property-path 'bound-details.left.text'.
>> Hopefully I can solve this issue soon.
>>
>> Best
>> Jan-Peter
>>
>> Am 21.04.19 um 20:42 schrieb Stefano Troncaro:
>> > Hi all, long time since I posted here, hope you all
>> have been well!
>> >
>> > While using the Edition Engraver today I noticed that
>> the following
>>

Re: Edition Engraver master vs refactor override branch: changing bound-details

2019-05-03 Thread Jan-Peter Voigt
Hi Stefano,

a lot of lilypond-unrelated business prevented me working on the
edition-engraver and especially in the refactor-override-branch for
quite a while.
Meanwhile there where some small issues to fix in master so the two
branches diverged.
So the old and stale 'refactor-override-branch' is a development branch
removing and changing code related to \override, \set et al..
Now I merged master into 'refactor-override-branch' so it is up to date
with master.
For now I suggest using the updated branch. I am going to test it soon
so that is fit to be merged into master.
And the next development branch is 'absolute-timing' meant to introduce
anchors and the correct handling of cadenza sections.

If there are any problems with the 'refactor-override-branch' please let
me know and I am going to fix it asap.

Jan-Peter


Am 30.04.19 um 17:16 schrieb Stefano Troncaro:
> Hi Jan-Peter,
>
> Sure! Please let me know if you manage to solve it so I can update.
>
> Thank you!
>
> El dom., 28 abr. 2019 a las 16:05, Jan-Peter Voigt ( <mailto:jp.vo...@gmx.de>>) escribió:
>
> Hi Stefano,
>
> sorry for the delay. I've been away for several days.
> I have to look into this deeper ... I guess it is related to the
> grob-property-path 'bound-details.left.text'.
> Hopefully I can solve this issue soon.
>
> Best
> Jan-Peter
>
> Am 21.04.19 um 20:42 schrieb Stefano Troncaro:
> > Hi all, long time since I posted here, hope you all have been well!
> >
> > While using the Edition Engraver today I noticed that the following
> > override works in the old refactor override branch, while on the
> > current master it prints a textless spanner and a warning:
> >
> > \version "2.19.80" \include "oll-core/package.ily" \loadPackage
> edition-engraver \consistToContexts #edition-engraver Voice
> \addEdition test \editionMod test 1 0 Voice.A { \override
> TextSpanner.bound-details.left.text = "span this" <>\startTextSpan
> } \editionMod test 2 3/4 Voice.A \stopTextSpan \new Staff { \new
> Voice \relative { c' d e f g a b c } }
> >
> > Said warning is
> >
> > warning: type check for `bound-details' failed; value `"span this"'
> > must be of type `list'
> >
> > In the current master I could set this like this:
> > \override TextSpanner.bound-details = #'((left . ((text . "span
> this"
> > but this has the undesirable effect of resetting all the other
> > settings of the bound-details alist
> >
> > Without having been able to dive down into the code, this looks
> like a
> > simple issue with type checking, but I realize this may have been
> > implemented this way to circumvent other problems.
> >
> > So, how can I achieve this with the current master? Or should I go
> > back to using the earlier branch until this is solved?
> >
> > Thanks for your help,
> > Stéfano
> >
> > ___
> > lilypond-user mailing list
> > lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org <mailto: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: MIDI instrument for oboe d'amore

2019-04-30 Thread Jan-Peter Voigt
Hi Aaron,

just a question: Did you set "\transposition a"?
(http://lilypond.org/doc/v2.19/Documentation/notation/displaying-pitches.html#instrument-transpositions)

HTH
Jan-Peter

Am 30.04.19 um 09:33 schrieb Jacques Menu:
> Thanks Lukas and Aaron for your help.
>
> In fact, my use case is merely to listen to the MIDI file from within 
> Frescobaldi, to ear-proof the score. I don’t have any MIDI equipment, and 
> organ sound is fine for that purpose.
>
> I got the surprise that transposing a voice for the oboe d’amore in A, in 
> Lully’s « Dormez beaux yeux » for the needs of our oboes band, lead to quite 
> modern music being heard...
>
> What would best suit my need is a way to counter-balance the effect of 
> \transpose in the \midi block. This way, one would get both the printed score 
> and the MIDI pitches alright, even for instruments unknown to standard MIDI.
>
> Can that be done?
>
> JM
>
>> Le 29 avr. 2019 à 20:53, Aaron Hill  a écrit :
>>
>> On 2019-04-29 9:28 am, Jacques Menu wrote:
>>> Hello,
>>> I find oboe and french horn, but no oboe d’amore in A.6 MIDI instruments.
>>> Which other setting can I use for this instrument in A?
>>
>> General MIDI does not define such an instrument in the standard, and neither 
>> did GS nor XG.  In fact, the reed section of GM Level 2 has no extended 
>> patches at all.  (GS and XG do have variations like the "bass clarinet" and 
>> some alternate saxophone patches.)
>>
>> While it would not be standards-compliant, you could certainly select an 
>> alternate bank for the oboe patch with the intention that it means an oboe 
>> d'amore.  For your own usage, it would require you to manually configure 
>> your synth to load a suitable sound for the instrument.  For other folks 
>> using your MIDI file, their synths should fall back using a standard oboe 
>> patch which might work, except for lower notes that could be outside the 
>> playable range.
>>
>> From what I understand, an oboe d'amore has a timbre between the normal oboe 
>> and the cor anglais.  What I would do in my virtual instrument software is 
>> load up an oboe patch but then apply some EQ to soften the sound a bit so it 
>> is not quite as assertive.  For the fact that the playable range is lower, I 
>> might also need to mix in a little of the English horn patch to fill out the 
>> lower notes, which will require blending to balance the timbre.  But it must 
>> be noted that this work is beyond the scope of MIDI.
>>
>>> There’s no clarinet in A either.
>>
>> For better or worse, a "clarinet in A" is simply a clarinet as far as 
>> General MIDI is concerned.  In MIDI you typically specify the pitch you want 
>> played, not the note that is written that may sound higher or lower 
>> depending on the instrument.  As such, MIDI note 60 would most often refer 
>> to the equal-tempered middle C whose fundamental is approximately 261.63 Hz, 
>> and one should expect that any GM-compliant synth to render the pitch 
>> properly.  That said, I have encountered some sound libraries that 
>> intentionally transpose samples from their nominal pitches; and that 
>> requires manually transposing a MIDI track to compensate.  I dislike this 
>> practice as it is not very portable.
>>
>>
>> -- Aaron Hill
>>
>> ___
>> 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
>


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


Re: Edition Engraver master vs refactor override branch: changing bound-details

2019-04-28 Thread Jan-Peter Voigt
Hi Stefano,

sorry for the delay. I've been away for several days.
I have to look into this deeper ... I guess it is related to the
grob-property-path 'bound-details.left.text'.
Hopefully I can solve this issue soon.

Best
Jan-Peter

Am 21.04.19 um 20:42 schrieb Stefano Troncaro:
> Hi all, long time since I posted here, hope you all have been well!
>
> While using the Edition Engraver today I noticed that the following
> override works in the old refactor override branch, while on the
> current master it prints a textless spanner and a warning:
>
> \version "2.19.80" \include "oll-core/package.ily" \loadPackage 
> edition-engraver \consistToContexts #edition-engraver Voice \addEdition test 
> \editionMod test 1 0 Voice.A { \override TextSpanner.bound-details.left.text 
> = "span this" <>\startTextSpan } \editionMod test 2 3/4 Voice.A \stopTextSpan 
> \new Staff { \new Voice \relative { c' d e f g a b c } }
>
> Said warning is
>
> warning: type check for `bound-details' failed; value `"span this"'
> must be of type `list'
>
> In the current master I could set this like this:
> \override TextSpanner.bound-details = #'((left . ((text . "span this"
> but this has the undesirable effect of resetting all the other
> settings of the bound-details alist
>
> Without having been able to dive down into the code, this looks like a
> simple issue with type checking, but I realize this may have been
> implemented this way to circumvent other problems.
>
> So, how can I achieve this with the current master? Or should I go
> back to using the earlier branch until this is solved?
>
> Thanks for your help,
> Stéfano
>
> ___
> 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: Edition engraver verbosity

2019-03-18 Thread Jan-Peter Voigt
Hi Andrew, Urs,

Am 17.03.19 um 13:07 schrieb Urs Liska:
> Hi Andrew,
> 
> Am 17.03.19 um 12:34 schrieb Andrew Bernard:
>> Voluminous output of
>>
>> trying
>> \break
>>
>> hundreds of lines.

yes, this message is annoying ...

>>
> 
> OK, now I see what you mean.
> 
> 
>> I just commented out the ly:message call, but I think a switch would
>> be good.
> 
> 
> I find the message "trying \break" pretty useless without any context
> (like measure number, context and input location), so I have the
> impression this is just a development debut message randomly forgotten
> to be commented out.

and yes, I forgot to comment it.
I'll push a fix soon.

> I think a switch would be good (=> should be implemented using
> (getOption '(edition-engraver debug-messages)) (or any other useful
> option name list). But only if the produced output is of actual use.
> 
> Another suggestion would be to replace ly:message with oll:debug here.
> What do you think, Jan-Peter?

For now I'd just leave it commented out. I inserted it while coding and
testing the broadcast event part.
If we need that information again, it shall be an optional log message
containing measure and moment.

BTW I noticed some action around the EE and especially around the
documentation recently - thank you very much :-)
I hope that my schedule allows to take part again and to promote
development soon!

Best
Jan-Peter



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


Re: Creating custom articulation using regular text font

2019-02-20 Thread Jan-Peter Voigt
Hi Urs,

in an articulation event the font is emmentaler and not a normal one.
So in the trill-list part you have to switch back to normal text with
\markup \normal-text "T"

HTH
Jan-Peter

Am 20.02.19 um 17:23 schrieb Urs Liska:
> Hi,
> 
> I haven't got any further, but ...
> 
> Am 20.02.19 um 11:53 schrieb Urs Liska:
>>
>> I'm trying to create an articulation printing a glyph from the
>> "regular" text font.
>>
>> ...
> 
> 
> I moved all the relevant code into an MWE, which might trigger more
> ideas than the abstract excerpt I originally posted.
> 
> The problem is that I can create a custom articulation using a stencil
> made from \markup \musicglyph "something" but not from \markup "Something".
> 
> I'd be really thankful about any push in the right direction, since I
> have no clue as to where even start searching.
> 
> Best
> Urs
> 
> \version "2.19.82"
> 
> % The "asterisk" *does* work properly
> #(define asterisk-list
>`("asterisk"
>   . ((stencil . ,ly:text-interface::print)
>  (text . ,#{ \markup \musicglyph "pedal.*" #})
>  ; any other properties
>  (padding . 0.5)
>  (avoid-slur . around)
>  (direction . ,DOWN)
>  (script-priority . 125)
>  )))
> 
> % The "trill" fails, complaining in a programming error that it "Cannot get a 
> text stencil from this font"
> #(define trill-list
>`("trill"
>   . ((stencil . ,ly:text-interface::print)
>  (text . ,#{ \markup "T" #})
>  ; any other properties
>  (padding . 0.5)
>  (avoid-slur . around)
>  (direction . ,DOWN)
>  (script-priority . 75)
>  )))
> 
> %% A macro setting the lists from above in the copy of `default-script-alist´
> %% For now, every new script has to be inserted in a single run.
> %% TODO
> %% Probably better to do simpler list processing with append, cons etc
> #(define-macro (set-my-script-alist! ls-1 ls-2)
>"Creates a new key-value-pair, taken from ls-2, in ls-1"
>`(set! ,ls-1
>   (if (and (pair? ,ls-2) (pair? (cadr ,ls-2)))
>   (assoc-set! ,ls-1 (car ,ls-2) (cdr ,ls-2))
>   (begin
>(ly:warning (_"Unsuitable list\n\t~a \n\tdetected, ignoring. 
> ") ,ls-2)
>,ls-1
> 
> #(set-my-script-alist! default-script-alist asterisk-list)
> #(set-my-script-alist! default-script-alist trill-list)
> 
> \layout {
>   \context {
> \Score
> scriptDefinitions = #default-script-alist
>   }
> }
> 
> asterisk-artic = #(make-articulation "asterisk")
> trill-artic = #(make-articulation "trill")
> 
> 
> 
> tt =
> #(define-event-function ()()
>#{
>  -\trill-artic
>#})
> 
> asterisk =
> #(define-event-function ()()
>  #{
>-\tweak font-size 0
>-\asterisk-artic
>  #})
> 
> 
> \relative {
>   c'' \asterisk
>   c \tt
> }
> 
> 
> ___
> 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: Rotated StaffGroup InstrumentName?

2019-01-28 Thread Jan-Peter Voigt
Hi Andrew,

you might try something like this:

\new StaffGroup = "Staff_soloists" \with {
  \consists "Instrument_name_engraver"
  instrumentName = \markup \rotate #90 "Solo"
} <<
...
>>

HTH
Jan-Peter

Am 28.01.19 um 15:38 schrieb N. Andrew Walsh:
> Hi List,
> 
> quick general question:
> 
> if I have a StaffGroup, like this in my score:
> --
> \new StaffGroup = "Staff_soloists"
>     <<
>       \new Staff = "Staff_oboe_solo" <<
>           \global \exTwoOboeMusic
>         >>
>       \new Staff = "Staff_guitar_solo" <<        
>         \global \exTwoGuitarMusic
>       >>
>       \new StaffGroup = "Staff_percussion_solo" \with {
>         systemStartDelimiter = #'SystemStartSquare
>         instrumentName = #"Perc. Solo"
>         shortInstrumentName = #"S.Prc."
>       }
>       <<
>         \new Staff = "percSoloOneUpper" <<
>           \global \exTwoPercSoloOneMusicUpper 
>         >>
>         \new Staff = "percSoloOneLower" <<
>           \global \exTwoPercSoloOneMusicLower 
>         >>
>       >>
> 
>        \new Staff = "exTwoCbsSolo" <<
>           \global \exTwoBassSoloMusic
>         >>
>     >>
> ---
> Is there a way to put the group InstrumentName for that whole group, but
> rotated 90°? This is something that would be useful, for example, in a
> piece for orchestra with both chorus and soloists, or a concerto with
> more than one soloist (in this case, these are four soloists within a
> larger ensemble. The content is in a separate file, triggered by the
> variables, and \global defining Staff settings).
> 
> What I would like would be for the toplevel StaffGroup "Staff_soloists"
> to have a name, rotated 90° and extending to the left of the individual
> instrument names. Is there any way to do that?
> 
> Cheers,
> 
> A
> 
> ___
> 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: edition-engraver and \cadenzaOn

2019-01-18 Thread Jan-Peter Voigt
Hi Urs,

happy new year!

This is on my agenda for quite some time. It will be possible and I have
an idea how to make it possible, but ...
I try to push the priority a little bit.

Jan-Peter

Am 18.01.19 um 14:04 schrieb Urs Liska:
> Hey all,
> 
> it seems that after \cadenzaOn all events have the same "zero" moment -
> which makes sense, given that \cadenzOn completely suppresses all Timing
> consideration.
> 
> So is there *any* chance to addres specific notes or slurs or whatever
> that occur at some point in the cadenza?
> 
> 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: lilypond.org Productions page

2018-12-05 Thread Jan-Peter Voigt
Hi there,

2017/2018 Ortus published the "Markus Passion" by Johann Sebastian Bach
in a reconstructed version by Andreas Fischer:
http://www.ortus-musikverlag.de/en/musik-elbe-oder/om212
(right now the introduction is only available in german, sorry)

LilyPond is not mentioned there, but I created the scores (full-score,
piano-reduction, vocal-score, instrument-parts) with the Gonville font,
using the edition-engraver and with my own templating engine.
If there would be some time I would write an article for
http://lilypondblog.org/ ...

Jan-Peter




Am 03.12.18 um 09:22 schrieb Urs Liska:
> Hi Federico,
> 
> Am 03.12.18 um 08:53 schrieb Federico Bruni:
>> Hello
>>
>> I was about to send a patch to add a website in the Productions page
>> (sheets are CC licensed, subscription required):
>> https://www.baroquemusic.it/
>>
>> Then I realized that 3 out of 4 projects listed under "Published sheet
>> music" section are discontinued.
>> Should we just delete them?
>> http://lilypond.org/website/productions.html
> 
> 
> You're right, this is quite embarrassing. However, if we remove
> everything but Mutopia, it will look even more embarrassing, isn't it? I
> have problems with such pages (applies equally to "News" pages) that
> reveal more a *lack* of content and activity.
> 
> I think we should rather try to do a general collection among users (but
> this should reach more channels than just this list) to get a number of
> new entries for the page that makes it a little more impressive.
> 
>> Which are the requirements (if any) to be listed on that page? Should
>> we link only projects following Free Software principles?
> 
> 
> Yes. When Janek and I wanted to use the award for our Oskar Fried
> edition to put some spotlight on LilyPond we could not get it added to
> this page. All we could get agreement to was adding a News item about
> the fact that we used a crowdfunding campain trying to make it possible
> to open source the edition.
> 
> 
>>
>>
>> If you know of any other project which may be listed there please let
>> me know.
>>
> 
> I will have two projects, but it will need a number of months before
> they are ready and (in one case) can be publicly disclosed.
> 
> Best
> Urs
> 
> 
>> Thanks
>> Federico

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


Re: Use String to reference Variable

2018-12-04 Thread Jan-Peter Voigt
Hello Pedro,

Am 04.12.18 um 04:28 schrieb Pedro Pessoa:
> Hello!
> I want a function that takes a string as arg an from that produces a valid
> variable reference, as follows:
> 
> %%% pseudo 
> Nabc={a1 d e f}
> Nxyz={b1 e a d}
> 
> fun=
> #(define-music-function (x)(string?)
>#{
>  <<
>#(concat x "abc")
>\\
>#(concat x "xyz")
>  >>
>#})
> 
> \fun "N" %produces parallel music with Nabc and Nxyz
> %%%
> 
> ---
> 
> I've ran this test:
> 
> %%%
> \Nabc={some music}
> (display (string->symbol (string-append "N" "abc")))
> %%%
> 
> It outputs "Nabc", not the music content of Nabc, as I expected.
> Why is that? How do I make it point to the actual music?
The string is converted to a symbol and a symbol is a primitive datatype
in guile-scheme. To receive the value of the variable you have to ask
the parser. To place the result in the music you should use an instant
scheme expression (introduced by '$' not '#').

HTH:

fun=
#(define-music-function (x)(string?)
   #{
 <<
   $(ly:parser-lookup (string->symbol (string-append x "abc")))
   \\
   $(ly:parser-lookup (string->symbol (string-append x "xyz")))
 >>
   #})


Jan-Peter

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


Re: simple scheme in lilypond

2018-11-27 Thread Jan-Peter Voigt
Hello,

the $ sign has a special meaning of "instant scheme-expression". An
instant scheme expression is evaluated instantly *and* the result is
observed so that lilypond can decide what to do with it. When lily
receives something that can be treated as a markup from an instant
scheme expression it is handled like \markup {}. But a pure string is
not a core lily-expression like music or markup. Thats the reason (3)
fails with an error. The result of a plain scheme-exression introduced
with # is simply ignored in root context.

HTH
Jan-Peter


Am 27.11.18 um 09:14 schrieb Gianmaria Lari:
> Probably these are very trivial things. Sorry to ask them but would like
> to understand.
> 
> If I write (1):
> 
> 
> \version "2.19.82"
> $(object->string (+ 3 2))
> 
> 
> Lilypond is happy and compile to a pdf file showing "5".
> 
> Even this simpler code works... (2)
> 
> \version "2.19.82"
> $"Hello"
> 
> 
> and generate a pdf file showing "Hello".
> 
> It is clear to me that $ introduce a scheme expression that is
> evaluated. And in the previous two examples the scheme code is evaluated
> to strings. But I don't understand why lilypond outputs them. If I write
> (3):
> 
> \version "2.19.82"  
> "Test"
> 
> 
> this does not compile. So I would think that the "correct" code to
> output evaluated expression in the pdf file should be (4)
> 
> 
> \version "2.19.82"
> \markup $(object->string (+ 3 2))
> 
> 
> or this (5)
> 
> \version "2.19.82"
> \markup $"Hello"
> 
> 
> Why the behaviour of (1) and (2) ?
> 
> * * *
> 
> I tried to rewrite (1) and (2) with the hash mark instead of dollar (6):
> 
> \version "2.19.82"
> #(object->string (+ 3 2))
> 
> 
> and (7):
> 
> \version "2.19.82"
> #"Hello"
> 
> 
> This time, there is no output in the pdf file. Why this difference?
> 
> Thank you, g.
> 
> ___
> 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: Edition Engraver in 2.19

2018-11-18 Thread Jan-Peter Voigt
Hello Carlo,

yes it is possible to add fingerings with the EE:
\editionMod theTarget 1 2/4 path.to.context.Voice <>-3

So if you enter the fingering with a single editionMod command you just
have to add it to an empty chord.
To make it convenient you should create a shortcut for the editionMod
command. Otherwise there is far too much boilerplate for a probably very
long list of fingerings.
If you need help with that don't hesitate to ask again ;-)

HTH

Jan-Peter



Am 18.11.18 um 01:43 schrieb Stemby:
> Hello,
> just a simple question: is it possible/convenient to use EE for entering
> fingering instructions?
> 
> Thank you!
> 
> Carlo
> 
> 
> 
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 


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


Edition Engraver in 2.19

2018-11-13 Thread Jan-Peter Voigt
Hi all,

just a few hours away ... ;-)
Kieren already mentioned, the edition engraver is an external library.
It is part of my own toolchain, but once made its way into public,
because it fitted a question/a use case of Kieren. So I started to make
it available. Now there came Urs' OpenLilyLib infrastructure into the
arena to provide a standard API to add and load modules to the LilyPond
toolchain.
Let me explain shortly what and why the EE is:
There where several cases where I needed a full score and parts for
instruments and choir. During a smaller first project I thought, it is
quite messy to tag overrides and breaks for every different target (full
score, part). In frescobaldi one can easily jump to the code of a single
element and than add the desired override, but I wished for a tool to
write down "in measure X at moment Y" I need to shape a slur or add a
line-break or whatever. In fact I was sitting with a printout marking
elements to tweak. Now paper doesn't do point-and-click ...
Right now my time does not allow for writing down an adequate elaborate
documentation, but I try to jump in if there are questions.
And of course I am very thankful for the text Stefano Troncaro wrote
down!
(http://lists.gnu.org/archive/html/lilypond-user/2018-01/msg00603.html)
Thank you for bringing this up again - I have to admit that I lost the
track to place store into the Wiki of the GitHub-page.

The EE uses two coordinates to identify when and where to tweak
something. First there is the time noted with measure and moment. The
second part identifies the context, where the tweak is to be applied.
Every modification is marked with an edition-tag to separate different
targets.

\version "2.19.82"
% load OpenLilyLib
\include "oll-core/package.ily"
% load edition-engraver package
\loadPackage edition-engraver

% activate a target/edition "test" - this might also be "fullscore" or
"violinI" or whatever
\addEdition test

% add an override in measure 1 at the second quarter (it counts from
zero, so it is 1 quarters to move from the beginning of measure 2)
% apply the override to the second Voice context with edition-id
'sing.with.bach.along'
\editionMod test 1 1/4 sing.with.bach.along.Voice.B \once \override
NoteHead.color = #red

% add/consist the edition-engraver to the desired Context-types
\consistToContexts #edition-engraver Score.Staff.Voice

% create a Staff with an editionID
\new Staff \with {\editionID ##f sing.with.bach.along }
<< { bes'4 a' c'' b' } \\ { es'4 e' f' fis' } >>

I can't speak for the average user because I made it the way *I* think
about all this stuff.
And yes, there is absolutely need for documentation.

@Marten: I think if you understand the basic concept and got familiar
with the commands it can be useful even for small scores like Urs
already wrote. Of course I am used to using the EE so my opinion is
biased, but I think it is useful for a lot of (not all) tasks.

HTH
Jan-Peter

Am 13.11.18 um 08:30 schrieb m.tarensk...@zonnet.nl:
> Hi,
> I, like the original poster, was also intrigued, by people's
> enthusiastic comments about the power of OpenLilyLib and the Edition
> Engraver. And like the O.P. I never really got started.
> I guess the question is: How complex a LilyPonds score has to be
> before EE really starts making things easier instead of just adding
> more difficulties?
>
> MT
>
> Verzonden vanaf mijn Huawei mobiele telefoon
>
>
>  Oorspronkelijk bericht 
> Onderwerp: Re: Edition Engraver in 2.19
> Van: Kieren MacMillan
> Aan: Reggie
> Cc: Lilypond-User Mailing List
>
>
> Hi Reggie,
>
> > is that all the documentation for such a powerful tweak tool in
> lilyPond?
>
> Yes, unfortunately.
> And, to be accurate, it’s not "in" Lilypond — it’s a separate library.
>
> > How do new users learn this tool and all its possibilites?
>
> I learned by looking at the examples, trial and error, and asking
> Jan-Peter (the author) every now and then. =)
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
> ___
> 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


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


Re: Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread Jan-Peter Voigt
Hello Joel,

when I typeset choir scores, which I do most often, I use the
self-alignment-X override for long syllables:

words = \lyricmode {
  Breathes | \once \override LyricText.self-alignment-X = #-.5 \markup {
\with-color #red breathes } |
  br | \markup { \with-color #green breathes } |
  \once \override LyricText.self-alignment-X = #-.6 breathes | br |
breathes |
}

That harmonizes spacing. If you read some of my former posts you will
know I do inject those overrides with the edition-engraver because it
would be very tedious to place them alll inside the lyrics.
But with a small command
sax = #(define-music-function (parser location v)(number?) #{ \once
\override LyricText.self-alignment-X = #v #})

(or shorter in the V2.19 form - this doesn't work 2.18.2)
sax = \once \override LyricText.self-alignment-X = \etc

its not that much text, if you place them inside the lyrics:
   Breathes | \sax #-.5 \markup { \with-color #red breathes } |


I hope this small hint helps
Cheers,
Jan-Peter


Am 31.10.18 um 17:58 schrieb joelhamme:
> My fellow singers in choir have been asking me to improve the visual chunking
> of choir staves. They wanted to have closed bar lines on the right edge of
> each choir staff.
> 
> Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
> results in collisions with the lyrics, which is particularly unappealing
> with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
> to `Lyrics` and hiding them as described in ^[notation lyrics].
> 
> However, for aesthetical reasons I prefer removing all span bars, except
> non-defaults and single bar bars at the end of each line. So this would
> leave all repeats and double bar lines but no single bars unless there's a
> line break, much like ^[semi choir staff snippet]
> 
> I've found a way to do this, except that there's some spacing issue with the
> lyrics at single bars that aren't even shown. In choir staves, lyrics can
> move below a bar line to take up the available space, which leaves a more
> pleasing appearance and saves space on the page. Sadly, I could either make
> the lyrics avoid all bar lines or not at all, but not only the ones that are
> actually shown.
> 
> To the point:
> I would like to make the lyrics avoid some span bars while not avoiding the
> bar lines I've omitted using a call back.
> 
> To illustrate I've compiled a somewhat minimal example using long words to
> trigger some collisions. For convenience I've also uploaded it to
> ^[lilybin].
> 
>  
> 
> ```lilypond
> \version "2.18.2"
> 
> link = {
>   \once \override Score.RehearsalMark.self-alignment-X = #LEFT
>   \mark \markup \normalsize {
>   \with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
>   }
> }
> 
> redspn = \once \override Score.SpanBar.color = #red
> grnbar = \once \override Score.BarLine.color = #green
> 
> notes = {
>   \link
>   c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
> }
> 
> words = \lyricmode {
>   Breathes | \markup { \with-color #red breathes } |
>   br | \markup { \with-color #green breathes } |
>   breathes | br | breathes |
> }
> 
> \score {
>   \new ChoirStaff <<
> \new Staff \relative c'' \notes \addlyrics \words
> \new Staff \relative c'' \notes
>   >>
> 
>   \layout {
> indent = 0
> \context { \ChoirStaff
>   \consists "Span_bar_engraver"
>   \override BarLine.after-line-breaking =
> #(lambda (grob)
>   (if
> (and (= 0 (ly:item-break-dir grob))
>  (string=? (ly:grob-property grob 'glyph-name) "|") )
> (ly:grob-set-property! grob 'allow-span-bar #f)))
> }
>   
>   % \context { \Lyrics
> % \consists "Bar_engraver"
> % \hide BarLine
> % \override BarLine.after-line-breaking =
> %   #(lambda (grob)
> % (if
> %   (and (= 0 (ly:item-break-dir grob)))
> %(string=? (ly:grob-property grob 'glyph-name) "|")
> %   (ly:grob-set-property! grob 'stencil #f))
> %   )
> % }
>   }
> }
> ```
> 
> The red colour indicates an unacceptable collision, whereas the green colour
> indicates the desired loose spacing under bars that are not spanned across
> staves. The commented-out section removes the relevant bar line stencils
> from the lyrics, but fails to loosen the spacing where there are no longer
> any bars to avoid.
> 
> Can I conditionally add bar lines to lyrics without otherwise affecting
> their spacing?
> 
> Sorry this got so long, any help would be much appreciated.
> 
> Cheers,
> Joel
> 
> [notation lyrics]:
> http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
> [semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
> [lilybin]: http://lilybin.com/wmw4xx/6
> 
> 
> 
> 
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
> 
> 

Re: Edition Engraver regex/wildcard bug

2018-10-26 Thread Jan-Peter Voigt
Hi Mark,

thank you for bringing this up! Until now I wasn't aware of this issue,
but in fact it is one.
And I have an idea where the problem is buried.
For now I opened an issue:
https://github.com/openlilylib/edition-engraver/issues/26

Hope to solve it soon!

Jan-Peter

Am 25.10.18 um 21:28 schrieb Mark Knoop:
> Apologies if this is a known issue, but I think I've found a bug in the 
> regex/wildcard handling of edition engraver paths.
>
> It seems that mixing editionMods with normal paths together with those formed 
> with wildcards and/or regular expressions causes the wildcard/regex 
> editionMods to break. This is using code adapted from 
> usage-examples/development-3.ly. 
>
> A workaround is of course to simply use wildcards or regexes in all 
> editionMods, but this seems arcane.
>
> %%%
> \version "2.19.82"
> \include "oll-core/package.ily"
> \loadPackage edition-engraver
> \consistToContexts #edition-engraver Score.Staff.Voice.Lyrics
> \addEdition test
>
> % { comment this block for green noteheads
> \editionMod test 1 0/4 la.Voice \once \override NoteHead.color = #red
> \editionMod test 2 0/4 le.Voice \once \override NoteHead.color = #blue
> %}
> \editionMod test 3 0/4 "{l*}".Voice \once \override NoteHead.color = #green
> \editionMod test 4 0/4 "/l.*/".Voice \once \override NoteHead.color = #green
>
> %{ workaround using regular expressions
> \editionMod test 1 1/4 "/^la$/".Voice \once \override NoteHead.color = #red
> \editionMod test 2 1/4 "/^le$/".Voice \once \override NoteHead.color = #blue
> %}
> %{ workaround using wildcards
> \editionMod test 1 2/4 "{la}".Voice \once \override NoteHead.color = #red
> \editionMod test 2 2/4 "{le}".Voice \once \override NoteHead.color = #blue
> %}
>
> <<
>   \new Staff \with {
> \editionID le
>   } \repeat unfold 24 e''4
>   \new Staff \with {
> \editionID la
>   } \repeat unfold 24 e''4
> %%%
>


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


Re: Edition Engraver suppress log files

2018-10-16 Thread Jan-Peter Voigt
Hi Craig,

I merged to master, but added a comment, that the names of the option
and the file will change, like Urs and I discussed.

This change shall be integrated soon, but right now I have to do some
other jobs with higher priority.

Jan-Peter


Am 15.10.2018 um 22:00 schrieb Craig Dabelstein:
> The new branch worked perfectly for me Jan-Peter.
> 
> Craig
> 
> 
> On Mon, 15 Oct 2018 at 21:53, Craig Dabelstein
> mailto:craig.dabelst...@gmail.com>> wrote:
> 
> You two are amazing. I don't know where any of us would be without you.
> 
> Craig
> 
> On Mon., 15 Oct. 2018, 7:19 pm Jan-Peter Voigt,  <mailto:jp.vo...@gmx.de>> wrote:
> 
> Am 15.10.2018 um 11:13 schrieb Urs Liska:
>         >
> >
> > Am 15.10.2018 um 11:07 schrieb Jan-Peter Voigt:
> >> Hi Urs,
> >>
> >> I combine the answers:
> >> The *.edition.log file might be named differently - not .log
> - as this
> >> file has a purpose outside the debug-log realm. And this is
> the reason
> >> I'd vote against writing the edition-context-information in a
> global log
> >> file.
> >
> > Yes, that points in the right direction. In that sense the EE
> "log" is
> > comparable to scholarLY's export files.
> >
> >> But for all debug-logs piping them into one (optional) files
> makes
> >> absolutely sense. How this file should be formatted is
> another question.
> >> And sometimes it is helpful if the log is written before Lily
> crashes
> >> ;-) so it might be worth writing immediatly.
> >
> > That's also true, and I had thought about this. But with your
> previous
> > comment we can solve the issue. If we're separating package
> specific
> > export files from traditional logs the logs don't have to be
> sectioned.
> > So we can format them similarly to usual log files, have a package
> > identifier at the beginning of each entry and simply write
> them out
> > immediately.
> >
> > And if I think of it, most of that is already implemented in
> oll-core.
> > There we have the functions  oll:log, oll:debug, oll:warn
> etc., combined
> > with the possibility to set the log-level. The only things
> we'd need is
> > the option to write the log or not, and the tagging of
> messages with the
> > package prefix.
> >
> > So I suggest you rename both the export filename and the
> option in the
> > EE, and we'll do the other thing separately.
> > OK I'll do that later and will think about the edition-context
> file
> structure. The paths shall be copyable ...
> 
> Jan-Peter
> 
> 
> 
> -- 
> *Craig Dabelstein*
> Maxime's Music
> craig.dabelst...@gmail.com <mailto:craig.dabelst...@gmail.com>
> /http://maximesmusic.com/


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


Re: Edition Engraver suppress log files

2018-10-15 Thread Jan-Peter Voigt
Am 15.10.2018 um 11:13 schrieb Urs Liska:
> 
> 
> Am 15.10.2018 um 11:07 schrieb Jan-Peter Voigt:
>> Hi Urs,
>>
>> I combine the answers:
>> The *.edition.log file might be named differently - not .log - as this
>> file has a purpose outside the debug-log realm. And this is the reason
>> I'd vote against writing the edition-context-information in a global log
>> file.
> 
> Yes, that points in the right direction. In that sense the EE "log" is
> comparable to scholarLY's export files.
> 
>> But for all debug-logs piping them into one (optional) files makes
>> absolutely sense. How this file should be formatted is another question.
>> And sometimes it is helpful if the log is written before Lily crashes
>> ;-) so it might be worth writing immediatly.
> 
> That's also true, and I had thought about this. But with your previous
> comment we can solve the issue. If we're separating package specific
> export files from traditional logs the logs don't have to be sectioned.
> So we can format them similarly to usual log files, have a package
> identifier at the beginning of each entry and simply write them out
> immediately.
> 
> And if I think of it, most of that is already implemented in oll-core.
> There we have the functions  oll:log, oll:debug, oll:warn etc., combined
> with the possibility to set the log-level. The only things we'd need is
> the option to write the log or not, and the tagging of messages with the
> package prefix.
> 
> So I suggest you rename both the export filename and the option in the
> EE, and we'll do the other thing separately.
> OK I'll do that later and will think about the edition-context file
structure. The paths shall be copyable ...

Jan-Peter


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


Re: Edition Engraver suppress log files

2018-10-15 Thread Jan-Peter Voigt
Hi Urs,

I combine the answers:
The *.edition.log file might be named differently - not .log - as this
file has a purpose outside the debug-log realm. And this is the reason
I'd vote against writing the edition-context-information in a global log
file. But for all debug-logs piping them into one (optional) files makes
absolutely sense. How this file should be formatted is another question.
And sometimes it is helpful if the log is written before Lily crashes
;-) so it might be worth writing immediatly.

Jan-Peter

Am 15.10.2018 um 10:51 schrieb Urs Liska:
> Hi Jan-Peter,
> 
> I've just arrived back at my computer.
> 
> 
> Am 15.10.2018 um 10:40 schrieb Jan-Peter Voigt:
>> Hi Urs and all,
>>
>> I created a branch 'addOptionHandling' for the edition-engraver. It
>> contains an option 'write-log', which is true by default, but can be set
>> to false to prevent writing of *.edition.log files.
>> I'd prefer default to true, but can change it if there are reasonable
>> votes against it.
> 
> One thing I wanted to ask for is having a consistent naming for such an
> option in any OLL package that may choose to write log files. But I'm
> totally OK with 'write-log' so that is already accepted.
> 
> I understand that the edition-engraver should by default write the log
> since that is often an essential tool to set up the addressing scheme of
> edition mods. For oll-core in general this looks different: there the
> logs are usually only interesting for debugging purposes if something
> goes wrong (actually I've never made use of that features so far).
> 
> What do you think: is it confusing if different OLL package provide the
> option to write log files but have different defaults?
> 
> ###
> 
> I had another thought over the weekend that I'd like to present for
> discussion. What about unifying the log files and write all log entries
> to *one* log file to reduce cluttering of the output directory? In that
> case packages wouldn't have to deal with writing the files on their own
> but would defer that to the logging module in oll-core. A function would
> then at the end of the compilation process write the log file from
> entries passed to it along the way. It would write them to sections,
> similar to a config file.
> 
> What do you think? Is that worth the effort?
> 
> Best
> Urs
> 
>> If someone could have a look and test it I can merge this change soon.
>>
>> Jan-Peter
>>
>> Am 14.10.2018 um 08:32 schrieb Urs Liska:
>>>
>>> Am 14. Oktober 2018 08:29:46 MESZ schrieb Jan-Peter Voigt
>>> :
>>>> Hi Craig,
>>>>
>>>> not right now, but I will implement a switch ASAP!
>>>>
>>> Please use the \setOption syntax for that.
>>>
>>>> Jan-Peter
>>>>
>>>> Am 14. Oktober 2018 07:30:44 MESZ schrieb Craig Dabelstein
>>>> :
>>>>> Hi all,
>>>>>
>>>>> Quick question: Is it possible to stop the edition-engraver creating
>>>>> log
>>>>> files?
>>>>>
>>>>> Craig
>>>>>
>>>>>
>>>>> -- 
>>>>> *Craig Dabelstein*
>>>>> Maxime's Music
>>>>> craig.dabelst...@gmail.com
>>>>> *http://maximesmusic.com <http://maximesmusic.com>*
> 


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


Re: Edition Engraver suppress log files

2018-10-15 Thread Jan-Peter Voigt
Hi Urs and all,

I created a branch 'addOptionHandling' for the edition-engraver. It
contains an option 'write-log', which is true by default, but can be set
to false to prevent writing of *.edition.log files.
I'd prefer default to true, but can change it if there are reasonable
votes against it.
If someone could have a look and test it I can merge this change soon.

Jan-Peter

Am 14.10.2018 um 08:32 schrieb Urs Liska:
> 
> 
> Am 14. Oktober 2018 08:29:46 MESZ schrieb Jan-Peter Voigt :
>> Hi Craig,
>>
>> not right now, but I will implement a switch ASAP!
>>
> 
> Please use the \setOption syntax for that.
> 
>> Jan-Peter
>>
>> Am 14. Oktober 2018 07:30:44 MESZ schrieb Craig Dabelstein
>> :
>>> Hi all,
>>>
>>> Quick question: Is it possible to stop the edition-engraver creating
>>> log
>>> files?
>>>
>>> Craig
>>>
>>>
>>> -- 
>>> *Craig Dabelstein*
>>> Maxime's Music
>>> craig.dabelst...@gmail.com
>>> *http://maximesmusic.com <http://maximesmusic.com>*


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


Re: Edition Engraver suppress log files

2018-10-14 Thread Jan-Peter Voigt
Hi Craig,

not right now, but I will implement a switch ASAP!

Jan-Peter

Am 14. Oktober 2018 07:30:44 MESZ schrieb Craig Dabelstein 
:
>Hi all,
>
>Quick question: Is it possible to stop the edition-engraver creating
>log
>files?
>
>Craig
>
>
>-- 
>*Craig Dabelstein*
>Maxime's Music
>craig.dabelst...@gmail.com
>*http://maximesmusic.com *

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Markup and Score from scheme function

2018-10-12 Thread Jan-Peter Voigt
Hello Sebastian,

what do you mean with "return"? Do want to add the score immediatly or
do you want to return an object containing both?
You used the parser-location arguments in your scheme-function, so I
guess you are using stable (2.18). I created an example for 2.18
(incomplete) and one for 2.19.82. For three possible functions.

HTH
Jan-Peter


Am 11.10.2018 um 10:22 schrieb Sebastian Käppler:
> Hello,
> 
> I wonder if it is possible to return markup AND score from a single
> scheme function, something like this:
> 
> example = #(define-scheme-function (parser location) ()
> #{
>     \markup "Test"
>     \score {
>        c'4
>     }
> #}
> )
> 
> I created some scripts for teaching and want to include task-markup
> before each score. Using markup and my functions outside of scheme
> works, but I couldn't get  it to work from a single function.
> 
> Kind regards
> 
> 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 

\version "2.19.82"


% What do you want to achieve with this function?

% return an object containing markup and score
exampleA =
#(define-scheme-function ()()
   ; create a
   (list
(cons
 'mup
 #{
   \markup "Test"
 #})
(cons
 'mus
 #{
   \score {
 c'4
   }
 #})
))

exA = \exampleA

\exA.mup
\exA.mus



% add the markup and the score immediatly
exampleB =
#(define-scheme-function () ()
   (add-score
(list #{
  \markup "Test"
  #}))
   (add-score
#{
  \score {
c'4
  }
#}
))

\exampleB




% return a function that adds markup and score
exampleC =
#(define-scheme-function (mup mus) (markup? ly:score?)
   (define-void-function ()()
 (add-score
  (list mup))
 (add-score mus)
  ))

exC = \exampleC Test \score { c'4 }

\exC

\version "2.18.2"


% What do you want to achieve with this function?

% return an object containing markup and score
exampleA =
#(define-scheme-function (parser location) ()
   ; create a
   (list
(cons
 'mup
 #{
   \markup "Test"
 #})
(cons
 'mus
 #{
   \score {
 c'4
   }
 #})
))

exA = \exampleA

% this is much nicer in 2.19.82 ...
$(ly:assoc-get 'mup exA)
$(ly:assoc-get 'mus exA)



% add the markup and the score immediatly
exampleB =
#(define-scheme-function (parser location) ()
   (add-score (ly:parser-clone parser)
 (list #{
   \markup "Test"
   #}))
   (add-score (ly:parser-clone parser)
 #{
   \score {
 c'4
   }
 #}
 ))

\exampleB




% return a function that adds markup and score
exampleC =
#(define-scheme-function (parser location) ()
   (define-void-function (parser location)()
 (add-score (ly:parser-clone parser)
   (list #{
 \markup "Test"
 #}))
 (add-score (ly:parser-clone parser)
   #{
 \score {
   c'4
 }
   #}
   )))

exC = \exampleC

\exC

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


Re: 3/2 unusual writing

2018-10-04 Thread Jan-Peter Voigt
Hello,

an engraver can set the duration-log property conditionally as a tweak:

%%
\version "2.19.82"

\layout {
  \context {
\Voice
\consists #(make-engraver
(listeners
 ((note-event engraver event)
  (let ((durlog (ly:duration-log (ly:event-property
event 'duration
(if (> durlog 1) (ly:event-set-property! event
'tweaks '(((NoteHead . duration-log) . 1)) ))

  }
}

\relative d {
  \clef bass \key d \major
  \time 3/2
  d1. | e1. | fis2 b,8*2[ cis d b] |
  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
  e2. d8*2 cis2
}


HTH
Jan-Peter


Am 04.10.2018 um 20:20 schrieb Pierre Perol-Schneider:
> Hi All,
> Another option:
> 
> \version "2.19.82"
> 
> \relative d {
>    \clef bass \key d \major
>    \time 3/2
>    d1. | e1.
>    \override NoteHead.duration-log = #1
>    | fis2 b,8*2[ cis d b] |
>    \once\revert NoteHead.duration-log
>    e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>    e2. d8*2 cis2
> }
> 
> Cheers,
> Pierre
> 
> Le jeu. 4 oct. 2018 à 14:32, Jacques Menu  > a écrit :
> 
> Hello Graham & Aaron,
> 
> Thanks, both your solutions work fine. Lily is really great!
> 
> Avoiding to use multiplying factors as in b,8*2 has the advantage
> that Frescobaldi can select the code from the glyphs and vice-versa
> alright.
> 
> A nice day!
> 
> JM
> 
>> Le 4 oct. 2018 à 13:29, Aaron Hill > > a écrit :
>>
>> On 2018-10-04 2:09 am, Jacques Menu wrote:
>>> Hello folks,
>>> I’ve found this in Charpentier’s Te Deum, as engraved by the
>>> Centre de Musique Baroque de Versailles, which I had never seen
>>> before:
>>> It’s quite readable indeed, maybe more than using the modern
>>> notation with quarters, and I’ve wondered if there a way to obtain
>>> that with Lily.
>>
>> Simplest option is to use a note scaling fraction:
>>
>> d2*1/2
>>
>> This produces a "half note" but it has been scaled in half so it
>> only lasts as long as a quarter note.  The note head, however,
>> will still render as a half.
>>
>> The problem is that this does not let you do beaming:
>>
>> d2*1/2[ e f g]
>>
>> You will get an error because half notes do not support beams.
>>
>> One way to get around this is to use something like an eighth note
>> (which does support beams) and then scale it so it lasts as long
>> as a quarter (which is what the music in question needs):
>>
>> d8*2[ e f g]
>>
>> But now we are back at the problem where the note heads are
>> showing as solid.  Graham has provided a way to force the note
>> head to render however you want.  Allow me to provide an alternative:
>>
>> 
>> \version "2.19.82"
>>
>> \relative d {
>>  \clef bass \key d \major
>>  \time 3/2
>>  \override NoteHead.stencil = #(lambda (grob)
>>    (let* ((dur (ly:event-property (event-cause grob) 'duration))
>>   (dur? (and (eqv? (ly:duration-log dur) 3) (eqv?
>> (ly:duration-scale dur) 2
>>  (if dur? (ly:grob-set-property! grob 'text (markup
>> #:musicglyph "noteheads.s1")))
>>  (if dur? ly:text-interface::print ly:note-head::print)))
>>  d1. | e1. | fis2 b,8*2[ cis d b] |
>>  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>>  e2. d8*2 cis2
>> }
>> 
>>
>> What I am doing here is providing a function that checks to see if
>> you are using the 8*2 duration specifically and only then
>> adjusting the way the note head is displayed.
>>
>> -- Aaron Hill
>>

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


crash running translator

2018-09-17 Thread Jan-Peter Voigt
Dear all,

I stumbled over something that looks like a bug.
If one uses ly:run-translator to process some music a dotted rest
crashes lilypond:

\version "2.19.82"
#(ly:run-translator #{ r2. #} #{ \layout {} #})

The error message is:
Wrong number of arguments to #

Does anybody know a way to circumvent this?

Jan-Peter

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


Re: Edition Engraver and staff changes

2018-09-05 Thread Jan-Peter Voigt
Am 05.09.2018 um 15:01 schrieb Urs Liska:
> 
> 
> Am 5. September 2018 14:27:06 MESZ schrieb Simon Albrecht 
> :
>> On 15.08.2018 07:50, Jan-Peter Voigt wrote:
>>> yes you are right, \change Staff cannot be used with the EE. Some
>> time
>>> ago I tried to make it possible, but it results in a fatal crash of
>>> lilypond if the EE sends such an event. I add this to the issues.
>>
>> Maybe with a minimal example this should also be added 
> 
> Yes.
> 
>> to the LilyPond 
>> issue tracker?
> 
> No, here: https://GitHub com/openlilylib/edition-engraver/issues
https://github.com/openlilylib/edition-engraver/issues/24

But still it might be added to the lilypond issue tracker because it is
a reproducible crash not dependent of the EE.

Jan-Peter


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


Re: Edition Engraver and \markLengthOn

2018-08-30 Thread Jan-Peter Voigt
Hi Craig,

it should work. \markLengthOn just consists of some overrides, which are
directed to the Score Context.
So Maybe you should address the Score context with
\editionMod parts 626 0/4 hallager.partIII.Score \markLengthOn

or you use (I don't know your current setup, so this is a guess)
\editionMod parts 626 0/4 hallager.partIII.clarinetI.Staff \markLengthOn

because the overrides are directed to the Score context anyway.

HTH
Jan-Peter

Am 29.08.2018 um 21:15 schrieb Craig Dabelstein:
> Hi all,
> 
> Can the EE be used to add \markLengthOn? Maybe I've got the context
> wrong but the following line is having no effect:
> 
> \editionMod parts 626 0/4 hallager.partIII.clarinetI.Score \markLengthOn
> 
> Craig
> 
> 
> -- 
> *Craig Dabelstein*
> Maxime's Music
> craig.dabelst...@gmail.com 
> /http://maximesmusic.com/
> 
> 
> ___
> 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: Edition Engraver and staff changes

2018-08-14 Thread Jan-Peter Voigt
Hello Auke,

yes you are right, \change Staff cannot be used with the EE. Some time
ago I tried to make it possible, but it results in a fatal crash of
lilypond if the EE sends such an event. I add this to the issues.

Jan-Peter




Am 14.08.2018 um 21:51 schrieb Partitura Organum:
> Hello all,
> 
> In organ music it is quite common that one of the hands plays a part
> that is either to high or to low for the  'common' clefs, but that can
> be perfectly rendered with the alto clef. Not many organists are still
> able to read the alto clef, so I usually make to versions, one with the
> alto clef, and one with the part distributed over two staves (see images
> for an example).
> 
> 
> 
> 
> 
> 
> 
> 
> Since the notes do not change, only the way they are rendered, I thought
> it would be a good use case for the edition engraver.  Problem however
> is that the Edition Engraver references contexts and I cannot tell one
> context to become another. The command 'change Staff' cannot be used
> with the Edition Engraver. Below is my (not so minimal) not-working
> example. Is there a way to tell the Edition Engraver that a part should
> switch Staff? Or is the Edition Engraver not suitable for my use case
> (which means that I should continue to do it manually)?
> 
> 
> %==
> \include "/oll-core/package.ily"
> \loadPackage edition-engraver
> %\addEdition alto
> \addEdition nonalto
> \consistToContexts #edition-engraver Score.Staff.Voice
> 
> righthand = \relative c''{
>   a2 a |
>   b1 |
>   c4 b a2\trill
> }
> 
> lefthand = \relative c'{
>   f8 e d c d c b a |
>   gis8 a b c d e fis gis |
>   a8 a, b cis d d, e fis |
> }
> 
> pedal = \relative c {
>   b2 d  |
>   e1  |
>   a,2 c
> }
> 
> lefthandnonalto=\relative c'{
>   \clef bass
>   \change Staff="right" \voiceTwo f8 e d c d c \change Staff="left"
> \oneVoice b a |
>   gis a b c \change Staff="right" \voiceTwo d e fis gis |
>   a \change Staff="left" \oneVoice a, b cis d d, e fis |
> }
> 
> 
> \editionMod alto 1 0/4 left.Voice.A \clef alto
> 
> \editionMod nonalto 1 0/4 right.Voice.A \voiceOne
> \editionMod nonalto 1 0/4 left.Voice.A \change Staff="right"
> \editionMod nonalto 1 0/4 left.Voice.A \voiceTwo
> 
> \score {
>   <<
>     \new Staff = "right" \with {
>   \editionID right
>     }
>     \new Voice {  \righthand }
>   
>    \new Staff = "left" \with {
>   \editionID left
>     }
>     %\new Voice { \lefthand}
>     \new Voice { \lefthandnonalto}
>    
>     \new Staff {
>   \clef bass \pedal
>     }
>   >>
> }
> %===
> 
> Regards,
> Auke
> 
> 
> 
> ___
> 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: Is it possible to replace a number with variable inside a pair?

2018-07-26 Thread Jan-Peter Voigt
Hi Risto,

you might go this way:

lineThickness = 5
\markup \override #`(thickness . ,lineThickness) \draw-hline

That is semi-quote the pair with ` (instead of ') and then "unquote" the
variable to retrieve the value with a comma (,)

HTH
Jan-Peter

Am 26.07.2018 um 09:35 schrieb Risto Vääräniemi:
> Hi,
> 
> I tried the following:
> 
> lineThickness = 5
> \markup \override #'(thickness . #lineThickness) \draw-hline
> 
> But it seems I cannot give the variable inside the pair. This works:
> 
> lineThicknessPair = #'(thickness . 5)
> \markup \override #lineThicknessPair \draw-hline
> 
> Is there any way to make it work with just a single number variable? I
> even tried the variable without the '#' or replaced it with a '\'. I
> just got different errors.
> 
> BR,
> Risto
> 
> 
> ___
> 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: how to refer to partial first bar using edition-engraver

2018-07-23 Thread Jan-Peter Voigt
Hello Mason,

once again I have to dive deep into this. It is an issue I thought it
was solved, but obviously it isn't. The right way to address a time in a
partial bar would be
\editionMod all 1 #(ly:make-moment -1/8) score.Score \mark "mark3"

but this doesn't work here (anymore) ... I hope to find the solution soon!

Cheers,
Jan-Peter

Am 23.07.2018 um 00:09 schrieb Mason Hock:
> I have a score beginning with an 8th note pickup and want to place a \mark 
> above the first note using edition-engraver. Edition-engraver appears to 
> consider the first complete bar to be bar "1" and the timing mark "2 0/4" 
> places tweaks at the beginning of the second complete bar. Therefore, my 
> instinct was to use "0 7/8" for the bar/beat timing, but nothing appeared 
> whether I used \mark or \markup. Next I tried "0 0/4" and got the same 
> result. Interestingly, "1 0/4" places a \markup above the first complete bar, 
> which is what I expected, but it places \mark in two locations, over the 
> first note and over the clef. Placing a \mark over the first complete bar 
> directly in the music, as opposed to using edition-engraver, places it as 
> expected.
> 
> What is the correct way to place an editionMod in a partial bar? Here is a 
> minimal example of the resutls described above:
> 
> --
> \version "2.21.0"
> 
> \include "oll-core/package.ily"
> \loadPackage edition-engraver
> 
> \editionMod all 2 0/4 score.staff.Voice ->
> \editionMod all 2 0/4 score.staff.Voice \f
> \editionMod all 0 0/4 score.Score ^\markup { "markup1" }
> \editionMod all 0 0/4 score.Score \mark "mark1"
> \editionMod all 0 7/8 score.Score ^\markup { "markup2" }
> \editionMod all 0 7/8 score.Score \mark "mark2"
> \editionMod all 1 0/4 score.Score ^\markup { "markup3" }
> \editionMod all 1 0/4 score.Score \mark "mark3"
> 
> \consistToContexts #edition-engraver Score.Staff.Voice
> \addEdition all
> 
> \score {
>   <<
>   \new Staff \with { \editionID staff }
> \relative c' {
>   \partial 8 d8 |
>   d4\mark "mark4" d d d |
>   d d d d
> }
>   >>
>   \layout {
> indent = 18\mm
> \context {
>   \Score
>   \editionID score
> }
>   }
> }
> --
> 
> Thanks,
> 
> Mason
> 
> 
> 
> ___
> 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: Some openLilyLib packages/modules open for testing

2018-07-15 Thread Jan-Peter Voigt
Hi Urs,

Am 13.07.2018 um 17:59 schrieb Urs Liska:
> In recent weeks (as you'll have noticed) I had the wonderful opportunity
> to work on it on a partially paid basis: I had to implement some
> functionality and was in essence paid to work on that for 7x8 hours.
> What had to be created amounted to "half" an openLilyLib package, so I
> decided to aim at the whole thing, working of course more than these
> seven full days but also achieving substantially more. But maybe most
> important is that I managed to write comprehensive manuals along the
> way. They are authored in Markdown (which is good) but so far only work
> in a Markdown=>Pandoc=>LuaLaTeX=>PDF chain (which is less good because
> it should also be possible to produce HTML sites). But they do exist,
> and if the list rules allow you will see them attached to this post.
> 

just a thought on the toolchain:
http://pandoc.org/lua-filters.html
The usage of a pandoc-lua-filter *might* help to create an html-version
including the lilypond-snippets.

Best
Jan-Peter

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


Re: Software playing lilypond's music sheets

2018-07-13 Thread Jan-Peter Voigt
Hi Sam,

thanks a lot for sharing this!

Best
Jan-Peter

Am 12.07.2018 um 23:48 schrieb Samuel DA MOTA:
> Hi everyone!
> 
> I wrote a software a while ago that would play a music sheet generated
> by lilypond. It shows the music sheet and follows it with a cursor. I
> made a video to demo the end-result. You can watch it at
> https://s-d-m.github.io/lilydumper/intro_assets/lilyplayer-demo.webm
> 
> The soft is mainly based on the event listener. If you are interested
> in knowing how I extracted pieces of information from lilypond to know
> e.g. where on the music sheet the cursor is and at which time, you can
> read the documentation at https://s-d-m.github.io/lilydumper/
> 
> The tool to extract the data and generate a "playable" music sheet is
> lilydumper: https://github.com/s-d-m/lilydumper and the one that
> actually plays it is lilyplayer: https://github.com/s-d-m/lilyplayer
> 
> If you think adding a new output to lilypond for that use case would
> be nice and have questions, let me know.
> 
> Kindest regards
> 
> Sam
> 
> ___
> 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: Global Variable vs Edition Engraver

2018-07-09 Thread Jan-Peter Voigt
Hi Craig, Kieren,

I actually use kind of a global variable for the global time line. So
all repeat signs, time-signatures *and* key-signatures there. Before I
implemented the EE I started with a template-engine where the tamplates
take care of creating the simultaneous music ( << \getMusic meta
\getMusic instrument >> ):
https://github.com/openlilylib/lalily-templates

It takes care of transposing instruments per score. I guess I have to
deal very seldom with changing instruments inside a movement compared to
you. Though it should be possible with an auto-transposer that tracks
for changing transpositions. That way the change of the instrument is
only a matter of setting properties and therefore would be EE compatible:
(I don't remember the state of this snippet ...)
https://github.com/openlilylib/snippets/tree/master/editorial-tools/auto-transpose

Btw, if I am transcribing a piece rehearsal marks found in the original
are placed in that global variable. For other pieces where I insert
rehearsal marks as an editorial addition I use the EE.

Best,
Jan-Peter



Am 09.07.2018 um 05:24 schrieb Kieren MacMillan:
> Hi Craig,
> 
>> As I get more confident with using the Edition Engraver I was wondering if 
>> you had some advice on when to use a global variable and when to use the EE, 
>> especially with scores that use transposing instruments.
> 
> Boy, this is something I’m also struggling with as I level up. I've been 
> using the EE since Jan-Peter let it out of his private stash (aka "Day One"), 
> and I'm still moving stuff over to the EE pile on an ongoing basis. Most 
> recently, I've moved all rehearsal marks and barlines to my EE code; the move 
> before that was clefs.
> 
>> ATM I put all my concert key signatures, barlines, repeats etc in a global 
>> variable that has to be combined with the notes of every instrument in the 
>> staff; e.g.
>>
>> <<
>> \global
>> \fluteNotes

>>
>> Can the EE be used to replace the global variable by inserting repeats, 
>> double bar lines etc.
> 
> Short answer: Yes.
> 
> Long answer: It really depends on the scope of the project, and your 
> workflow/toolchain. If you’re putting together a one-page lead sheet for a 
> jazz song, I'm not sure you need the overhead; if you’re putting together an 
> opera with upwards of a dozen different score targets, etc., then it’s almost 
> certainly worth putting *most* things in the EE.
> 
>> How would a key signature work with transposing instruments.
> 
> That’s something I haven’t come back to since David K and I talked through 
> some options a few years ago. In the musical theatre world, where pit 
> musicians (esp. wind players) can have 6 or more transposing instruments of 
> different kinds and transpositions in a single book, this is a huge question 
> that I still need to answer definitively.
> 
> Not sure that helps (?), except maybe to let you know you’re not alone on the 
> front lines.  =)
> 
> Best,
> K.
> 
> 
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info



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


Re: edition-engraver: multiple editions

2018-07-01 Thread Jan-Peter Voigt
Hi Mason,

thank you for the hint what has to be explained more concisely in the
docs that are still waiting for there incarnation.

In you examples activation of the editions is done with
`\addEdition first`. To only apply edition `second` you can omit
`\addEdition first` or comment that out.
The command `\editionMod first ...` does not need `\addEdition first` to
compile.
Now the idea of the edition-engraver is to separate layout-mods and
editorial stuff from the content. So in a real project one or more files
containing the bare music definitions, e.g. `wind.fluteI = \relative {
c''8 b a ... }`, are included in a file starting the typesetting for a
specific edition.
All editionMods (for all editions) may be placed in another
include-file. Now in the file to typeset the specific edition either
`\addEdition first` for each needed collection of mods is added or in
one command `\setEditions first.second`.
So any edition receives is typeset from its own source file. Those files
are quite short containing the paper, layout and edition settings and
the actual score-creating command.

IIRC I once created one file to create multiple PDFs with different
editions activated and different paper sizes, but that is really tricky.
And in production I always use different files for separate editions.

HTH
Jan-Peter

Am 30.06.2018 um 18:30 schrieb Mason Hock:
> I'm slowly getting a handle on edition-engraver, largely thanks to this[1] 
> guide, which very clearly explains basic usage for a single edition. However, 
> neither the guide nor the usage examples in the repo demonstrate the use of 
> multiple editions, and I'm confused as to how that would be done in a useful 
> way. For example, these two snippets
> 
> --
> \version "2.19.82"
> 
> \include "oll-core/package.ily"
> \loadPackage edition-engraver
> 
> \addEdition first
> \editionMod first 1 0/4 the-staff.Voice ^\markup { 1 }
> \editionMod first 1 2/4 the-staff.Voice ^\markup { 2 }
> 
> \consistToContexts #edition-engraver Staff.Voice
> 
> \score {
>   \new Staff \with { \editionID the-staff } {
> \relative c' {
>   c d e f
> }
>   }
> }
> --
> 
> --
> \version "2.19.82"
> 
> \include "oll-core/package.ily"
> \loadPackage edition-engraver
> 
> \addEdition first
> \editionMod first 1 0/4 the-staff.Voice ^\markup { 1 }
> 
> \addEdition second
> \editionMod second 1 2/4 the-staff.Voice ^\markup { 2 }
> 
> \consistToContexts #edition-engraver Staff.Voice
> 
> \score {
>   \new Staff \with { \editionID the-staff } {
> \relative c' {
>   c d e f
> }
>   }
> }
> --
> 
> produce identical output, so, in the way I've been using edition-engraver so 
> far, defining multiple editions does not appear to have a different effect 
> from placing all edition-mods in one edition. It is true that I could put the 
> edition-mods for each edition in a separate .ily file and only include the 
> one I want to use when I compile, but even then there is no reason that the 
> edition in each file could be called "first" instead of giving the editions 
> different names.
> 
> My expectation would be that there is a way of specifying which editions(s) 
> should have their edition-mods observed and which should be ignored, but I 
> can't find any information about this. Can anyone provide an example of 
> correct usage of edition-engraver to maintain multiple editions?
> 
> Thanks,
> 
> Mason
> 
> 
> [1] https://lists.gnu.org/archive/html/lilypond-user/2018-01/msg00603.html
> 
> 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 


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


Re: openLilyLib

2018-06-27 Thread Jan-Peter Voigt

Hi Urs, Aaron,

Am 27.06.2018 um 08:35 schrieb Urs Liska:

Hi Aaron,

thank you for the interest in openLilyLib.



> ...
>
pre-alpha state, which does explain things. 


Unfortunately this is true, and basically because the project didn't 
really gain traction. Progress is usually been made when someone has a 
reason to contribute something, usually a package or some functionality 
for a package. In many cases that someone is me, but there are a few 
major contributors to different packages.
Wait a second ... oll-core with its package management is working very 
well so what are the issues preventing from naming the core a RC? or at 
least beta?
The great thing about it is that anything is modularized so any package 
or module that is not in that state should be marked alpha. But the 
core? AFAICS a desired feature list naming all the core elements already 
available is missing to name it beta. Then a testing phase would make it 
a RC and then stable.


What is missing is a "community" with the intent of bringing openLilyLib 
into a more generally usable state. Which is a pity because I'm 
convinced it is a very useful toolkit worth of being more widely known 
and used.
I believe it very important to name it something more then pre-alpha. I 
know Its a bit funny if I say so, because I didn't promote my work that 
way ... but! Few people want to be beta-tester so it should be called 
"use it! here's how to install"


Documentation would be a good start with this - unfortunately at the 
same time a vital goal, a vicious circle ...

+1

> ...

The newer one is the "package" system, which essentially means that 
after \include "oll-core/package.ily" further package and/or modules can 
be loaded through \loadPackage and \loadModule. (BTW: this ensures that 
modules are parsed only once ...This is IMO a very usable infrastructure. The thing is that installing a 
package means `git clone https://`. That is easy if you are 
familiar with git, but it may disturb users that are not. So a 
package-manager that installs packages would be great thing to help 
those who are not familiar with git. But this is for now just an idea.


What services does oll-core provide to packages/modules?  Basically, 
if I were to come up with an idea for an extension to LilyPond, how 
would I best evaluate whether openLilyLib would make a good platform 
on which to build and how would I go about integrating it?


...


The edition-engraver is an extremely powerful 
tool and we can't thank Jan-Peter enough for having provided it. But the 
openLilyLib structure makes it possible to create new packages that 
*use* the edition-engraver and provide very simple interfaces for tools 
that would otherwise have to be handled in rather complex manner if 
you'd directly use the edition-engraver. The 
page-layout.conditional-breaks module is a good example for this.
Thank you Urs! It would still reside in my own cosmos and wouldn't be 
available without your package manager!


Jan-Peter





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


Re: music-function name shadowing a Scheme keyword

2018-06-27 Thread Jan-Peter Voigt

Am 27.06.2018 um 11:15 schrieb Urs Liska:



Am 27.06.2018 um 11:09 schrieb Urs Liska:

Hi Jan-Peter,


Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt:

Hi Urs,

you might import the SRFI-1 span-function and give that a new name. 
The counterpart-function to span is break, which "conflicts with the 
break binding established by while (see while do). Applications 
wanting to use break from within a while loop will need to make a new 
define under a different name."

You might provide such an alternative name for "span".

Personally I'd prefer another name for your function, because 
srfi-1-span is "prior art" ;-)

and *now* you can give it a name that does not conflict.



Hm, I was afraid of that comment. I agree that asking users using my 
module to change any occurence of "span" to 
"span-saved-from-openlilylib" is no viable option ...


However, what *would* be a suitable name, then? \span is just perfect. 
\markup would be good, or \tag, but of course ...


  * \class ("\class new" as shorthand for ) (maybe
also too generic?)
  * \tagSpan
  * \markupSpan

?

Yes, class is quite generic. I don't know, if it conflicts.
IMO \tagSpan is a viable name.




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


Re: music-function name shadowing a Scheme keyword

2018-06-27 Thread Jan-Peter Voigt

Am 27.06.2018 um 11:09 schrieb Urs Liska:

Hi Jan-Peter,


Am 27.06.2018 um 10:48 schrieb Jan-Peter Voigt:

Hi Urs,

you might import the SRFI-1 span-function and give that a new name. 
The counterpart-function to span is break, which "conflicts with the 
break binding established by while (see while do). Applications 
wanting to use break from within a while loop will need to make a new 
define under a different name."

You might provide such an alternative name for "span".

Personally I'd prefer another name for your function, because 
srfi-1-span is "prior art" ;-)

and *now* you can give it a name that does not conflict.



Hm, I was afraid of that comment. I agree that asking users using my 
module to change any occurence of "span" to 
"span-saved-from-openlilylib" is no viable option ...


However, what *would* be a suitable name, then? \span is just perfect. 


Hm, I doubt that. Not all  Lilyponders are HTML-natives. So to me it 
seems like a function that adds style-attributes to music elements. Am I 
right? Then you might give it a name like applyStyleAttributes ... OK, 
that is of course way too long, but ...

I just received your proposals and I will answer that ;-)


\markup would be good, or \tag, but of course ...

Urs




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


Re: music-function name shadowing a Scheme keyword

2018-06-27 Thread Jan-Peter Voigt

Hi Urs,

you might import the SRFI-1 span-function and give that a new name. The 
counterpart-function to span is break, which "conflicts with the break 
binding established by while (see while do). Applications wanting to use 
break from within a while loop will need to make a new define under a 
different name."

You might provide such an alternative name for "span".

Personally I'd prefer another name for your function, because 
srfi-1-span is "prior art" ;-)

and *now* you can give it a name that does not conflict.

Jan-Peter


Am 26.06.2018 um 22:43 schrieb Urs Liska:

Hi all,

I've mostly completed the implementation of a "span" module that 
provides the \span music-function, which is roughly the same as the HTML 
 element.


Nearly everything works fine by now, and I've been very happy with the 
name - until I realized that a music-function \span can be invoked from 
Scheme with (span), and that this shadows the Scheme procedure span from 
SRFI-1.


Am I right to assume that this *can* work - as long as no user of my 
package will think of using the original Scheme function?


Is there any way to get around this without renaming my music function?

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: Function template (or whatever it's called)

2018-06-20 Thread Jan-Peter Voigt

Hi Urs,

just one pointer on Davids message (thank you!): in my example the code 
has to be a singular expression, which is the case in most of my cases 
where I use let or begin. If you want to use more than one statement use 
the optional-argument-dot (define-my-custom-function . code) and unquote 
splice ,@code


Jan-Peter

Am 20.06.2018 um 11:42 schrieb Urs Liska:

Hi Jan-Peter,

thanks for the quick response!


Am 20.06.2018 um 11:35 schrieb Jan-Peter Voigt:

Hi Urs,

define-macro is the method you are looking for:


Indeed, that's what I need.
I might have managed to look that up myself, but I think that with the 
quoting stuff in place it would have driven me crazy before I'd reached 
anything ;-)




%%%
\version "2.19.80"

% define macro
#(define-macro (define-my-custom-function code)
    ; all wrapping code is (semi)quoted
   `(define-music-function
 (mus)(ly:music?)
 (let*
  ((elts (ly:music-property mus 'elements))
   (cnt (length elts)))

  ,code ; insert (unquoted) user generated code

  mus)))


% use macro
myFunc =
#(define-my-custom-function
   (ly:message "The music has ~a elements" cnt))

% use function
{
  \myFunc { c' e' }
}
%%%

HTH


It does, and I think I can go from here myself.

Thanks
Urs


Jan-Peter

Am 20.06.2018 um 11:18 schrieb Urs Liska:
I'm providing users with the option to configure some behaviour by 
providing custom styling functions. These functions must have a 
certain interface and will typically retrieve the same information 
from their arguments. I would like to simplify this task by providing 
a "function template". I think this may be achieved by macros or some 
other syntactic extension mechansim, but I have no idea about how to 
go forward with that.


This is what currently a user would have to do:

\version "2.19.80"

myFunc =
#(define-music-function (mus)(ly:music?)
    (let*
 ((elts (ly:music-property mus 'elements))
  (cnt (length elts)))
 (ly:message "The music has ~a elements" cnt)
 mus))

{
   \myFunc { c' e' }
}

Create a music function with one ly:music? argument and extract some 
information from the music expression (of course this is just an 
example, in the real case it's a custom object attached to the music).


What I would like to have is what define-music-function does here but 
with a pre-set argument list and essentially the let* bindings 
transparently done so that something like this is possible:


userFunc =
#(define-my-custom-function
    (ly:message "The music has ~a elements" cnt))

where one ly:music? argument is implicitly expected and the bindings 
like 'cnt' have already been prepared.


Is this possible? I would assume so, and I'd also would assume it's 
quite easy - once you know what to look for.


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



___
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: Function template (or whatever it's called)

2018-06-20 Thread Jan-Peter Voigt

Hi Urs,

define-macro is the method you are looking for:

%%%
\version "2.19.80"

% define macro
#(define-macro (define-my-custom-function code)
; all wrapping code is (semi)quoted
   `(define-music-function
 (mus)(ly:music?)
 (let*
  ((elts (ly:music-property mus 'elements))
   (cnt (length elts)))

  ,code ; insert (unquoted) user generated code

  mus)))


% use macro
myFunc =
#(define-my-custom-function
   (ly:message "The music has ~a elements" cnt))

% use function
{
  \myFunc { c' e' }
}
%%%

HTH
Jan-Peter

Am 20.06.2018 um 11:18 schrieb Urs Liska:
I'm providing users with the option to configure some behaviour by 
providing custom styling functions. These functions must have a certain 
interface and will typically retrieve the same information from their 
arguments. I would like to simplify this task by providing a "function 
template". I think this may be achieved by macros or some other 
syntactic extension mechansim, but I have no idea about how to go 
forward with that.


This is what currently a user would have to do:

\version "2.19.80"

myFunc =
#(define-music-function (mus)(ly:music?)
    (let*
     ((elts (ly:music-property mus 'elements))
  (cnt (length elts)))
     (ly:message "The music has ~a elements" cnt)
     mus))

{
   \myFunc { c' e' }
}

Create a music function with one ly:music? argument and extract some 
information from the music expression (of course this is just an 
example, in the real case it's a custom object attached to the music).


What I would like to have is what define-music-function does here but 
with a pre-set argument list and essentially the let* bindings 
transparently done so that something like this is possible:


userFunc =
#(define-my-custom-function
    (ly:message "The music has ~a elements" cnt))

where one ly:music? argument is implicitly expected and the bindings 
like 'cnt' have already been prepared.


Is this possible? I would assume so, and I'd also would assume it's 
quite easy - once you know what to look for.


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: avoid orphan

2018-06-20 Thread Jan-Peter Voigt

Hi Gianmaria,

like Malte already pointed out, you can use the header field piece. If 
your intention is something else, I guess you are looking for \noPageBreak:


\score {
{a b c' d'}
\layout {}
\header { piece = "Etude" }
}

\markup "Etude"
\noPageBreak
{a b c' d'}


HTH
Jan-Peter

Am 20.06.2018 um 10:15 schrieb Gianmaria Lari:

I have a code similar to this

\version "2.19.81"
\markup "Etude"
{a b c' d'}

\markup "Etude"
{a b c' d'}
[.]

Is there any way to keep the markup and score together?


___
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: Binary Search Tree in Scheme

2018-06-18 Thread Jan-Peter Voigt

Am 18.06.2018 um 11:16 schrieb Urs Liska:



Am 18.06.2018 um 10:57 schrieb Jan-Peter Voigt:

Hi Urs,

there are self balancing trees like AVL or Red-Black, but I'd say 
implementation cost is quite for this purpose to sort n<1000 elements. 
I might be wrong, but I'd prefer the sort method.


OK, this is why I ask.
(I assume with "implementation" cost you mean the additional time needed 
for insertion/balancing, not the time *I* need for the implementation?)
Yes I mean insertion cost, but I also mean weight of the code. You have 
a complex structure to maintain.


The EE uses a tree that sorts by measure on the first level, by moment 
on second and then by the edition-id-path. So there is a tree 
structure, but on each level the child-list for each node is sorted by 
the guile method sort, when it is displayed in order. To access the 
elements it uses a hashtable.
In your case annotations should be at least partially sorted. The 
question is, where/when do you need the sorted list?


When exporting annotations.

So this is a one time sorting task. Or twice, if you have two views.

While typesetting music, you need to insert access the elements by a 
path moment/context or the like.


Yes. When an acknowledged grob has an annotation attached it will be 
prepended to the list or inserted into the tree.
The list will be sorted for one view. I assume `reverse` a quite cheap 
function.


To export a summary the order might be given by a path 
piece/movement/measure/moment/context.


So do I get this right: you're suggestion that I *do* use a tree 
structure, but not a BST but one where the hierarchy matches the musical 
one > This means that assuming my current movement has 1000 measures, and an
average of five annotations per measure I wouldn't have one list of 5000 
annotations but one of 1000 (to sort) and 1000 of five each.
And when I have 1000 measures where only 37 include 1-2 annotations I'd 
have that list of 37 measures with sublists of 1-2 each.?
Yes. The tree-structure is for creating different views and for 
directory lookup. If all annotations are fetched by an engraver it might 
be OK to first collect them in one large list. And if you drop them into 
a tree with the scheme of the desired view you don't need to sort the 
list, but just the tree. If you already know the scheme of the view 
while fetching the annotation events you can of course insert the 
annotations immediatly in the tree. That insertion might be hidden 
behind a method of an insert-collect-object. That way you can 
interchange the implementation without touching the engraver ... and 
perhaps I didn't study the ScholarLY code and that is already the case ;-)



To give a different view on the data I'd build another tree with the 
desired scheme like type/mvmt/measure. If you have the primary tre in 
insertion order you would have to visit some nodes more than twice so 
a copy should be cheaper. (That is not a proof but an assumption!)


You mean: walk over the initial tree and insert each element into a new 
tree with its own hierarchical structure matching the desired output 
hierarchy?

Yes



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


Re: Binary Search Tree in Scheme

2018-06-18 Thread Jan-Peter Voigt

Hi Urs,

there are self balancing trees like AVL or Red-Black, but I'd say 
implementation cost is quite for this purpose to sort n<1000 elements. I 
might be wrong, but I'd prefer the sort method.
The EE uses a tree that sorts by measure on the first level, by moment 
on second and then by the edition-id-path. So there is a tree structure, 
but on each level the child-list for each node is sorted by the guile 
method sort, when it is displayed in order. To access the elements it 
uses a hashtable.
In your case annotations should be at least partially sorted. The 
question is, where/when do you need the sorted list? While typesetting 
music, you need to insert access the elements by a path moment/context 
or the like. To export a summary the order might be given by a path 
piece/movement/measure/moment/context.
To give a different view on the data I'd build another tree with the 
desired scheme like type/mvmt/measure. If you have the primary tre in 
insertion order you would have to visit some nodes more than twice so a 
copy should be cheaper. (That is not a proof but an assumption!)


HTH
Jan-Peter


Am 18.06.2018 um 10:18 schrieb Urs Liska:

Hi all,

as you know I'm currently reviewing the scholarLY package, not only for 
new features but also for its coding - which blatantly shows how it was 
initially done directly from within my learning curve ;-)


One thing I'd like to change is the storage/handling of annotations. The 
current implementation does the following:


  * an engraver creates an annotation (an alist) and appends it to a
global "annotations" variable (OK, simple improvement: don't append
but cons to the beginning)
  * in a later stage sort this "annotations" list and export the
annotations.

This looks very inefficient, and I think it should be much better to 
store the annotations in a binary search tree and have them sorted upon 
insertion already. (Or am I misunderstanding this? One thing I'm unaware 
of is how efficient Guile's "stable-sort" works on a simple (linked) list).


On https://gist.github.com/tushar-sharma/c476003598c03373e52c I found a 
clean and simple implementation of a BST which looks like I can very 
easily make if work in LilyPond (I can't test because I'm not at my PC 
at the moment, but I'm talking about the general algorithms anyway).


This should let me insert the annotations in sorted order (replacing the 
<, >, and = with appropriate functions to sort annotations according to 
the configured requests), and it's not hard to add a function to walk 
the tree from left to right.


However - and now the question starts - if I'm not mistaken the 
annotations encountered by the engraver will be somewhat (or 
completely?) sorted by musical moment, which will be the requested sort 
order most of the time but not always. And if elements that are inserted 
in that BST are already sorted the tree will be totally unbalanced, and 
the insertion time is as bad (or worse) as simply appending to a list.


So if annotations would always be sorted by moment I would probably go 
back to the simple linked list, but they may be sorted differently and 
also by multiple keys (e.g. first by part, then by annotation type and 
only then by moment).


I could make a switch and choose the storage data structure based on the 
requested sorting (moment => list, everything else => BST), or I could 
use a BST that realigns itself after each insertion.


I would be glad about any opinions/recommendations:

  * Is it worth the effort looking into this (often there will be only a
couple of dozens of annotations per score, but three-digit numbers
shouldn't be unusual, and I have already encountered scores with
four-digit numbers of annotations)?
  * Is my idea of a self-balancing BST the right direction?
  * If so, which type of BST would be good to investigate (both in terms
of performance and implementation complexity)?

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: MusicXML

2018-05-29 Thread Jan-Peter Voigt

ah yes ofcourse, I forgot to mention that.

Am 29.05.2018 um 14:53 schrieb Karlin High:

On 5/29/2018 7:45 AM, David Kastrup wrote:

Varun Soontornniyomkij  writes:


Is it possible, using Lilypond, to save/export a score as a MusicXML
file?


Not at the current point of time.


No MusicXML export from LilyPond itself. But there are supporting 
programs for LilyPond that may or may not be enough for your needs.


Hidden experimental feature in Frescobaldi...


...which uses the python-ly library.





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


Re: MusicXML

2018-05-29 Thread Jan-Peter Voigt

Hello Varun,

currently this is not natively supported. I have been working on some 
code that is able to write some XML for simple scores and I am going to 
extend that: https://github.com/jpvoigt/lilypond-export/
To try it you have to prepare/install open-lilylib: 
https://github.com/openlilylib/oll-core


There have been some other attempts I don't recall right now.

HTH
Jan-Peter

Am 29.05.2018 um 08:09 schrieb Varun Soontornniyomkij:

Is it possible, using Lilypond, to save/export a score as a MusicXML file?


___
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: Format LilyMusic as string

2018-05-24 Thread Jan-Peter Voigt

ah, and you don't need o #{#}:

lilystring =
#(define-scheme-function (mus)(ly:music?)
   (with-output-to-string
(lambda () (displayLilyMusic mus))
))
test = \lilystring \relative { c'4 }
#(display test)


Am 24.05.2018 um 17:42 schrieb Jan-Peter Voigt:

lilystring =
#(define-scheme-function (mus)(ly:music?)
    (with-output-to-string
     (lambda () #{ \displayLilyMusic #mus #})
     ))
test = \lilystring \relative { c'4 }
#(display test)



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


Re: Format LilyMusic as string

2018-05-24 Thread Jan-Peter Voigt

Hi Urs,

I guess you are missing the wrapping lambda:

lilystring =
#(define-scheme-function (mus)(ly:music?)
   (with-output-to-string
(lambda () #{ \displayLilyMusic #mus #})
))
test = \lilystring \relative { c'4 }
#(display test)

HTH
Jan-Peter

Am 24.05.2018 um 17:33 schrieb Urs Liska:
I have a ly:music? argument and want to store the LilyPond 
representation as a string, that is I want to have a string with the 
content that \displayLilyMusic prints to the console.


 From what I know I have to provide a port to which \displayLilyMusic's 
output is redirected and that I can then store. But For some reason 
(well, that includes the "conciseness" of the Guile reference manual 
...) I don't get it done.



\version "2.19.80"
#(define format-ly-music (mus)
   (dont-know-what-to-do-here))

#(define my-var (format-ly-music #{ c' #}))

looks like a MWE for what I need.
 From the reference I would have thought that call-with-output-string 
would be what I need, but I don't get it to work as it complains about 
the "unspecified" argument.


Any pointers?
Thanks in advance
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: Programmatically inject an \editionID in a staff

2018-05-24 Thread Jan-Peter Voigt

Hi Urs,

Am 24.05.2018 um 12:29 schrieb Urs Liska:
...


Well, with the above changes (where the first was a real issue of 
understanding and the other two just glitches) the MWE works as 
expected. Unfortunately it doesn't seem to work in the real-world 
context. The log still only reports the creation of Score contexts. I'm 
now using

     (list 'assign 'edition-id (list 'ICEID part))
to insert the edition-id (where part is a symbol identifying the current 
part).

The log reports
     (masses three kyrie Score A) ""
lines for each of the movements(scores).

...

in you MWE you assigned the Score-editionID in a global layout block. If 
you there are multiple scores in one compilation they will all receive 
the same editionID. You can either use \new Score \with { \editionID 
movmtpath } or use a layout-block inside: \score{ \layout { \editionID 
... } }. Though I have once tested the second pattern - it should work - 
but I have only tested the first one.


You know that I use my own templating framework 
(https://github.com/openlilylib/lalily-templates). There is a lot of 
code dealing with those issues.


HTH
Jan-Peter

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


Re: Programmatically inject an \editionID in a staff

2018-05-24 Thread Jan-Peter Voigt

Hi Urs,

here we have three problems:
1. The symbol 'ICEID is a magic token to inherit the edition-id of the 
parent context, so you don't need to add the base path here.
2. \editionID creates a symbol-list, but the name is a string, so you 
have to turn it into a symbol, if you want to use it there.
3. In your MWE you add the editionID to the Staff and not the Score. So 
you can't address compile.with.Score here.


I quickly adapted your example:

%%%
\version "2.19.80"

\include "oll-core/package.ily"
\loadPackage edition-engraver

\consistToContexts #edition-engraver Score.Staff.Voice

\addEdition part
\editionMod part 1 0/4 compile.with.hello-staff.Staff \once \override 
NoteHead.color = #red
\editionMod part 1 1/4 compile.with.Score \once \override NoteHead.color 
= #red


makeStaff =
#(define-music-function (name content)(string? ly:music?)
   ;#{
   ;  \new Staff = $name \with { \editionID #(list (string->symbol 
name)) } { #content }

   ;#})
% {
 (make-music
  'ContextSpeccedMusic 'create-new #t
  'property-operations
  (list
   (list 'assign 'edition-id (list 'ICEID (string->symbol name))) )
  'context-id name 'context-type 'Staff
  'element content))
%}
\displayMusic \makeStaff "hello-staff" { c' d' }

\layout {
  \context {
\Score
\editionID ##f compile.with
  }
}
%%%

BTW you should reconsider using #{ ... #}. It is semantically the same 
and is much easier to read.


HTH
Jan-Peter




Am 24.05.2018 um 11:35 schrieb Urs Liska:

This is a -- similar -- MWE:

\version "2.19.80"

\include "oll-core/package.ily"
\loadPackage edition-engraver

\consistToContexts #edition-engraver Score.Staff.Voice

makeStaff =
#(define-music-function (name content)(string? ly:music?)
  (make-music
   'ContextSpeccedMusic 'create-new #t
   'property-operations
   (list
    (list 'assign 'edition-id (append '(ICEID compile with) (list 
name

   'context-id name 'context-type 'Staff
   'element content))

\makeStaff "hello-staff" { c' d' }

\layout {
   \context {
     \Staff
     \editionID ##f compile.with
   }
}

\addEdition part
\editionMod part 1 0/4 compile.with.hello-staff.Staff.A \once \override 
NoteHead.color = #red
\editionMod part 1 0/4 compile.with.Score.A \once \override 
NoteHead.color = #red


However, in this case it seems *both* mods won't have any effect ...

Urs

Am 24.05.2018 um 11:17 schrieb Urs Liska:
I'm trying to "install" the edition engraver in a programmatically 
generated score construction.


I have this code somewhere in the function to create a score:

  (ly:score-add-output-def! score
    #{
  \layout {
    \context {
  \Score
  #(editionID #f movement-path)
    }
  }
    #})

where movement-path is a symbol list identifying the current 
movement's score, e.g. #'(masses three kyrie)


I know this is working because the page-layout openLilyLib package 
properly uses that successfully. So I know each score has its own 
edition-id.


Now in order to make it possible to use \editionMod and friends I need 
to add the \editionID to each staff. I tested


\displayMusic
\new Staff \with { \editionID test } { c' }

and got

(make-music
  'ContextSpeccedMusic
  'create-new
  #t
  'property-operations
  (list (list 'assign
  'edition-id
  (list (quote ICEID) (quote test
  'context-type
  'Staff
  'element
  (make-music
    'SequentialMusic
    'elements
    (list (make-music
    'NoteEvent
    'pitch
    (ly:make-pitch 0 0)
    'duration
    (ly:make-duration 2)

as a result.

So I thought I could inject the edition-id simply with

(list 'assign 'edition-id (append (list 'ICEID) path))

with 'path' being e.g. #'(masses three kyrie violin-one)
This is the current version of that (sub-)function:

 ;; Create a named Staff context with the appropriate
 ;; context modifications.
 ;; content is a variable number of music expressions
 (make-staff
  (lambda (name . content)
    (make-music
 'ContextSpeccedMusic 'create-new #t
 'property-operations
 (list
  (list 'assign 'edition-id (append (list 'ICEID) path))
  (list 'assign 'instrumentName (car instrument-names))
  (list 'assign 'shortInstrumentName (cdr 
instrument-names))

  (list 'assign 'midiInstrument
    (getOption `(kayser instruments ,base-part 
midi-instrument)))
  (list 'assign 'instrumentTransposition 
transposition-from)

  frenched-score
  lyric-mods)
 'context-id name 'context-type 'Staff
 

Re: Need edition-engraver-compatible extended glissandi, will pay for solution if necessary

2018-05-19 Thread Jan-Peter Voigt

Hello Mason,

I just have an idea how I *would* try to approach a solution. Once I 
needed a lyrics syllable attached to an extender line at a given time. 
So I used the extender stencil and first attached the syllable on top of 
it at a given x-offset. Then I added a property to the corresponding 
note to receive an accurate x-offset. I'll have a look into that code later.
I can't say if it is easy to apply this technique on the 
*non*-horizontal glissando-line. We'll see.


Jan-Peter


Am 19.05.2018 um 23:16 schrieb Mason Hock:

In my music, I frequently use
- glissandi during which the performer rearticulates with a particular rhythm, 
represented with headless steams
- glissandi that extend longer than a bar or otherwise require intermediate 
headless stems to clarify duration, with a slur indicating that the performer 
should not rearticulate

My current solution is based on the hack[1] recommended in the documentation. 
Here is an example:


\version "2.19.81"
\language "english"

% starts an extended glissand
glon = {
   \override NoteColumn.glissando-skip = ##t
   \hide NoteHead
   \override NoteHead.no-ledgers = ##t
   \override Stem.thickness = #0.5
   \override Accidental #'stencil = ##f
}
% terminates an extended glissando
gloff = {
   \revert NoteColumn.glissando-skip
   \undo \hide NoteHead
   \revert Glissando #'stencil
   \revert NoteHead.no-ledgers
   \revert Stem.thickness
   \revert Accidental #'stencil
}
% slightly increase slope of glissando so that line is
% not perfectly horizontal when glissing between notes
% on same staff line/space
glup = { \once\override Glissando.extra-dy = #0.5 }
gldown = { \once\override Glissando.extra-dy = #-0.5 }

\relative c' {
   \glup c8 \glissando \glon c-_ d-_ e-_ \tuplet 5/4 { e-_ f-_ g g a } |
   \gloff a a \gldown a \glissando \glon a a a \gloff af4 |
   \gldown af2 \glissando \gldown g4( \glissando \glon f |
   e) \gloff e r2 |
}


This hack has several flaws.
- The stems are all different distances from the glissando line.
- Articulations have a noticably inconsistent slope.
- Selecting the least-bad pitch for each hidden note is tedious.
- Even slight changes to horizontal spacing can ruin the vertical position of 
the hidden notes.
- The position of a stem is not musical content and should not be represented 
by a pitch.

These flaws add up to a serious problem: Not only is the stem placement 
regardless of which hidden pitches I choose, but because horizontal spacing 
affects which pitches are least-bad, there is no way to choose the hidden 
pitches to be optimal for multiple editions. In order to fix this with edition 
engraver, I would have to tweak each stem individually for each edition, which 
would not realistically be maintainable.

A proper implementation of extended glissandi would place each intermediate 
stem a fixed distance from the gliss line. It would also be nice to tweak the 
slope of all gliss lines globally, something I can not do now because the 
extra-dy value is different for ascending and descending glissandi, but this 
would be a convenience, not a necessity.

The ideal syntax would resemble this:

c8 \gliss-end c c c c \gliss-end f

and result in a gliss from c to f, where
- the intermediate eighth note stems are all exactly the same distance from the 
gliss line
- the slope of the gliss line is slightly increased like in my example above

However, the bare minimum I need is for the stems to be automatically 
positioned vertically, and (if I need to tweak the slope manually) for them to 
be positioned relative to the gliss line *after the slope tweak*.

I don't understand Scheme or Lilypond's internals well enough to do this 
myself. If the solution is non-trivial for someone who does know Scheme and and 
Lilypond well, enough, I am willing to pay them for their time spent on the 
solution. The solution could be in the form of an include, or a feature of 2.19.

If anyone can help me with this, please let me know approximately how many 
hours of work you would expect it to take and what you would consider fair 
compensation for the amount of time spent.

Thanks,

Mason

[1] 
http://lilypond.org/doc/v2.19/Documentation/notation/expressive-marks-as-lines#glissando



___
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: Is there a way to generate a QR code inside a \markup block?

2018-05-16 Thread Jan-Peter Voigt

Hi Vinicius,

I did it once. I am on Linux so it is straightforward to install 
imagemagick, qrencode, potrace and idn. These are used to create an 
EPS-file to include in the markup. If you on a different OS with other 
tools to create the EPS then you have to adjust the commands.
The base idea is to trigger creation of an EPS, include that as an 
EPS-stencil and then (optionally) remove the temporary EPS-file.


HTH
Jan-Peter



Am 16.05.2018 um 07:55 schrieb Vinicius Mascarenhas:

Hi everybody,

I’m making a huge manual for my group with dozens of pages full of QR codes 
pointing to examples on YouTube and whatnot. For the time being I’m inserting 
them via \epsfile, but then I have to generate, properly name and organize each 
one beforehand. It takes much longer than actually finding the links I need.

Is there by any chance a command or function to generate a code by directly 
pasting the link as a parameter?

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



\version "2.19.80"

#(define-markup-command (qr-code layout props str size idn)(string? number? boolean?)
   "create QR-Code markup from  with width . Use IDN for international domain names.
It needs qrencode, imagemagick convert, potrace and optionally idn commands installed in PATH."
  (let ((tmp (format "~A-~2A.eps" (strftime "%Y%m%d%H%M%S" (localtime (current-time))) (random 100)))
(qr-stencil (interpret-markup layout props (markup #:with-color red #:filled-box (cons 0 size) (cons 0 size) 0.7)))
(quali (chain-assoc-get 'qr-quality props "L")))
(if (symbol? str)(let ((tmp (chain-assoc-get str props #f)))
   (if tmp (set! str tmp
(system (format (if idn
"echo \"~A\" | idn --quiet | qrencode -o - -m 0 -l ~A | convert PNG:- BMP:- | potrace -a -1 -o \"~A\""
"echo \"~A\" | qrencode -o - -m 0 -l ~A | convert PNG:- BMP:- | potrace -a -1 -o \"~A\"")
  str quali tmp))
(set! qr-stencil (eps-file->stencil X size tmp))
(system (format "rm -v \"~A\"" tmp))
qr-stencil
))

\markup { \qr-code #"https://www.lilypond.org/; #50 ##f }
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Need someone testing XML file in Finale and Sibelius (and Dorico)

2018-05-11 Thread Jan-Peter Voigt

Hi Urs,

I was just curious what the lilypond-export OLL-module 
(https://github.com/jpvoigt/lilypond-export/) is doing with this 
pattern. It seems the final beam closing is not fetched correctly. At 
least in MuseScore the last note with automatic beams is not beamed.


Best
Jan-Peter


Am 05.05.2018 um 08:25 schrieb Urs Liska:

Hi,

I'm trying to add support to python-ly for exporting manual beams to 
MusicXML.


I managed to export the commands to start and end a beam, but that's not 
sufficient. In theory 
(https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-beam.htm) 
the beaming pattern is described in detail in MusicXML, and when I 
export something from MuseScore this is also what I get.


I don't see it as reasonable to properly implement this in the python-ly 
exporter (at least for now) because that would essentially mean 
re-implementing the whole beaming-pattern code from LilyPond (which even 
isn't fully correct either).


However, I realized that when I have the beam start and end encoded by 
python-ly and then (so far manually) add


     continue

to each note, regardless of the actual beaming pattern situation, 
MuseScore will correctly import the XML file (and add the correct 
encoding when re-exporting to XML).


While I know this is not a correct export I think it would be a good 
start and in any case better than nothing. But I would like to know what 
the other programs will do with the code.


So I'd be happy if people could import the attached .xml file to Finale, 
Sibelius and (if possible) Dorico, and tell me about the results. Also 
attached is the reference image of what it should look like.

(Note that the .xml is manually tweaked at this point).

TIA
Urs



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





export-example2.pdf
Description: Adobe PDF document

http://www.musicxml.org/dtds/partwise.dtd;>



Part 1


Part 2





1024



A
4

512
1
eighth
begin



B
4

256
1
16th
continue



A
4

256
1
16th
end



G
4

512
1
eighth
begin



A
4

128
1
32nd
continue



B
4

128
1
32nd
continue



C
5

256
1
16th
end



B
4

448
1
16th


begin



A
4

64
1
64th
continue



G
4

256
1
16th
continue



A
4

128
1
32nd
end



G
4

128
1
32nd






1024



A
4

512
1
eighth
begin



B
4

256
1
16th
continue



A
4

256
1
16th
end



G
4

512
1
eighth
begin



A
4

128
1
32nd
continue



B
4

128
1
32nd
continue



C
5

256
1
16th
end



B
4

448
1
16th


begin



A
4

64
1
64th
continue



G
4

256
1
16th
continue



A
4

128
1
32nd
continue



G
4

128
1
32nd
end




\version "2.19.80"
%%%
% %
% This file is part of openLilyLib,   %
%  ===%
% the community library project for GNU LilyPond  %
% (https://github.com/openlilylib)%
%  ---%
% %
% Library: lilypond-export%
%  ===%
% %
% export foreign file formats with LilyPond   %
% %
% lilypond-export is free software: you can redistribute it and/or modify %
% it under the terms of the GNU General Public License as published by%
% the Free Software Foundation, either version 3 of the License, or   %
% (at your option) any later version. %
% %
% lilypond-export is distributed in the hope that it will be useful,  %
% but WITHOUT ANY WARRANTY; without even the implied warranty of  %
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   %
% GNU General Public License for more details.%
% %
% You should have received a copy of the GNU General Public License   %
% along with openLilyLib. If not, see <http://www.gnu.org/licenses/>. %
% %
% openLilyLib is maintained by Urs Liska, u...@openlilylib.org  %
% lilypond-export is maintained by Jan-Peter Voi

Re: disabling \break

2018-05-08 Thread Jan-Peter Voigt

Hi Herbie,

this is *the* use case for the edition-engraver:
https://github.com/openlilylib/edition-engraver/
or the page-layout package
https://github.com/openlilylib/page-layout
(which is using the edition-engraver for the conditional breaks)

If you install openLilyLib (https://github.com/openlilylib/oll-core), 
you can make use of these packages quite easily. That way you can 
separate breaks and page-layout from the music-content.


So the short answer is: Yes, it is possible to add a command that avoids 
certain breaks for certain commands.


If you want to know more about these tools don't hesitate to ask!

HTH
Jan-Peter



Am 08.05.2018 um 07:50 schrieb Herbert Liechti:

Hello

I searched a long time in the forum an internet and could not find an 
answer for my issue.


I write all my music with lilypond and at the end I have two output 
targets. One is the paper form and one
is a page layout for the tablet. The latter layout is optimized so that 
the screen of the table is used with small

margins. I use two book sections for this

I often do a line break at the end of each part (i.E. part A, part B, 
part C). For the paper output this is useful for

the tablet it is wasting place.

Is it possible to add a command that skips/disables/avoids the manual 
breaks when creating the tablet version?


Thanks & best regards
Herbie



___
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: alternative and slur

2018-05-04 Thread Jan-Peter Voigt

Hi,

you might use \repeatTie.
That is a tie, not a slur, but it looks OK.

HTH
Jan-Peter

Am 04.05.2018 um 09:57 schrieb Gianmaria Lari:

Have a look to this code and the resulting engraving:

\version "2.19.81"
{
   \repeat volta 2 {a( a a a}
   \alternative { {b1)} {c'1}}
}



Is there any way to indicate that the second alternative should be 
slurred like the first one - "a( a a a c1)" ?  Maybe an half slur? It's 
just a curiosity.


Thank


___
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: Make TOC entries available to LaTeX

2018-04-20 Thread Jan-Peter Voigt

Hi Urs,

the OLY way is the way to go, but for inspiration I share my little hack 
that was doing its job quite well on short notice.


Jan-Peter

Am 19.04.2018 um 23:23 schrieb Thomas Morley:

2018-04-19 16:19 GMT+02:00 Urs Liska :

Hi all,

I'm preparing an automated edition process using LuaLaTeX, Pandoc and
LilyPond.

After some experimentation I have come to the conclusion that I'll have to
insert the multi-movement score as a single PDF created by LilyPond (but
through lyluatex to make use of caching and the layout mechanics).

I first had used lyluatex's facility to include the score's system by system
and print all the titles with LaTeX, but this didn't work out - for the
first time I realized that lilypond-book-preamble.ly makes the vertical
staff-staff spacing as tight as possible, which often makes the page layout
pretty bad. Creating the movements separately is not an option either
because not all movements will start on a new page.

So now I have included a multi-movement score in the LaTeX document and
don't know how to add TOC entries (in LaTeX) for the movements. I can see
two possible ways, but don't know if they are really possible and if so how
to approach them:

Is it possible to insert something in the PDF output that LaTeX can pick up
as TOC entries?
(actually I doubt this is possible, but since it would be the easiest way I
thought I'd ask anyway)
Can I reliably retrieve the current page number of a given score's title
block?
With that information I could write them to a log file and read that later
in LaTeX.

TIA
Urs

PS: I don't know if it matters but the file is produced using
ly:book-process etc.




Doesn't
http://lilypond.org/doc/v2.19/Documentation/usage-big-page#sharing-the-table-of-contents
do what you want?

Cheers,
   Harm

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



\version "2.19.80"

#(define-markup-command (export-toc layout props file)(string?)
   (let* ((gauge-stencil (interpret-markup layout props ""))
  (x-ext (ly:stencil-extent gauge-stencil X))
  (y-ext (ly:stencil-extent gauge-stencil Y)))

 ; produce delayed stencil
 (ly:make-stencil
  `(delay-stencil-evaluation
,(delay (ly:stencil-expr ; this will be run, when all pages are calculated
  (let ((table (ly:output-def-lookup layout 'label-page-table)))
(with-output-to-file file
  (lambda ()
(display "Seite\tTitel\r\n\r\n")
(for-each (lambda (toc-item)
(format #t "~A\t~A\r\n"
  (if (list? table) (assoc-get (car toc-item) table) "???")
  (markup->string (caddr toc-item))
  )) (toc-items))
))
empty-stencil)
  )))
  x-ext y-ext)
 ))
exportTocMarkup = #(define-scheme-function ()()
 #{
   \markup \export-toc #(format "~A.inhalt.txt" (ly:parser-output-name))
 #})


\header {
  title = \markup { Hallo Welt! \exportTocMarkup }
}
\tocItem "Hallo Welt!"
\relative { c'' }
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Make TOC entries available to LaTeX

2018-04-19 Thread Jan-Peter Voigt
Hi Urs, I don't know either how to extract the toc from the PDF. But it should 
be easy to write the toc into some text file. Recently I did something similar 
to provide that info to those who compiled a book in inDesign.
I will extract it later, when I am back at my Workstation.

Jan-Peter 

Am 19. April 2018 16:19:49 MESZ schrieb Urs Liska :
>Hi all,
>
>I'm preparing an automated edition process using LuaLaTeX, Pandoc and 
>LilyPond.
>
>After some experimentation I have come to the conclusion that I'll have
>
>to insert the multi-movement score as a single PDF created by LilyPond 
>(but through lyluatex to make use of caching and the layout mechanics).
>
>I first had used lyluatex's facility to include the score's system by 
>system and print all the titles with LaTeX, but this didn't work out - 
>for the first time I realized that lilypond-book-preamble.ly makes the 
>vertical staff-staff spacing as tight as possible, which often makes
>the 
>page layout pretty bad. Creating the movements separately is not an 
>option either because not all movements will start on a new page.
>
>So now I have included a multi-movement score in the LaTeX document and
>
>don't know how to add TOC entries (in LaTeX) for the movements. I can 
>see two possible ways, but don't know if they are really possible and
>if 
>so how to approach them:
>
>  * Is it possible to insert something in the PDF output that LaTeX can
>pick up as TOC entries?
>(actually I doubt this is possible, but since it would be the
>easiest way I thought I'd ask anyway)
>  * Can I reliably retrieve the current page number of a given score's
>title block?
>   With that information I could write them to a log file and read that
>later in LaTeX.
>
>TIA
>Urs
>
>PS: I don't know if it matters but the file is produced using 
>ly:book-process etc.

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver -- Bar 1

2018-04-10 Thread Jan-Peter Voigt

Hi Craig, hi Stéfano,

like Stéfano already pointed out this is related to an issue I still 
have to fix. I hope the hints given are already helpful to work around it!
The example didn't compile in my setup either. This was happening in the 
development branch for this issue (refactor-override). I pushed a fix so 
that it compiles. This branch shall receive more pushes to solve this 
issue before it is merged to master.


Jan-Peter


Am 08.04.2018 um 19:32 schrieb Stefano Troncaro:

Hi Craig,

As I suspected, the problem was in how your code was structured. I run 
into the same issues when I started using the EE. Look at the attached file.


I recognize that not every change that I made may be necessary, I made 
changes while I was trying to make the snippet  work (the file as you 
sent it wouldn't compile at all for me), and currently don't have time 
to strip it to the minimum. But I hope that at least a working example 
will be useful to you.


The basic problem is that you were placing many overrides to the same 
property in the same moment, which caused problems: the EE can't 
overwrite an override that is already present in the music input. 
However, if you move your general override (named \gossecDynamics in 
your file) in the layout settings, then there is no conflict since there 
are not two overrides present at the same time, and the latter (created 
by the EE) overwrites the general one. You should have gotten warnings 
for this I think? Do you have the Edition Engraver on the latest version?


Hope you find this useful,
Stéfano


2018-04-08 6:43 GMT-03:00 arnepe >:


hello Craig,

this is the output I get from your file:
ee_problem.pdf
>
The "ff" at 1 0/4 looks different than the same mod at 3 0/4.

However - if I change the style at line 28, and comment out line 65
or line
89,
the change takes effect only on 1 0/4, and the mod at 3 0/4 is not
affected
at all.
My knowledge of EE is marginal at best (and virtually nil with
Scheme) so I
am afraid I can't be of any help here...

cheers
Arne




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


Re: Edition Engraver -- Bar 1

2018-04-07 Thread Jan-Peter Voigt
Hi Craig,

I'll investigate that on Monday. I thought I fixed this issue a while ago, but 
if you are facing it now there still needs to be something to be done.

Jan-Peter 

Am 7. April 2018 08:22:52 MESZ schrieb Craig Dabelstein 
:
>Hi all,
>
>Is there something strange about trying to reference the first beat of
>the
>first bar of a piece of music. My mods are all working except the one
>on
>the first beat of bar 1.
>
>\editionMod global 1 0/4 gossec.simphonie.clarinetII.Voice etc...
>
>Any ideas?
>
>Craig
>
>
>-- 
>*Craig Dabelstein*
>Maxime's Music
>craig.dabelst...@gmail.com
>*http://maximesmusic.com *

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-04 Thread Jan-Peter Voigt
... there is a function
ly:score-add-output-def!
to add layout- and midi-blocks to a score object.

Cheers
Jan-Peter

Am 3. April 2018 11:34:58 MESZ schrieb Urs Liska :
>I ran into an issue with the edition-engraver, targeting individual 
>scores when multiple scores are compiled within a bookpart.
>
>It's actually within the 'page-layout' or rather the 'breaks' 
>openLilyLib package, and I can imagine that my issue is related to 
>another one that was raised recently (that either of these packages 
>didn't work well with independent edition-engraver targets).
>
>The 'breaks' package 
>(https://github.com/openlilylib/breaks/blob/master/package.ily)
>installs 
>itself like this:
>
>% Install editionID
>\layout {
>   \context {
> \Score
> \editionID ##f breaks
>   }
>}
>
>which can later (e.g. in the page-layout.conditional-breaks package: 
>https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113)
>
>be addressed with (for example)
>
>% insert invisible barlines to enable breaks within measures
>\editionModList conditional-breaks breaks.Score.A
>\bar "" #in-measure-breaks
>
>This works perfectly - as long as there is only one score to be 
>compiled. However, if more than one score is compiled (at least in the 
>same bookpart) it seems that all the mods for all scores are merged 
>together, with the result that in each score all the line breaks for
>all 
>scores are applied.
>
>Am I understanding it right that I would have to use \editionID in a 
>layout block that only affects an individual score, giving them 
>individual names?
>
>And how could I do that if I don't have a literal \score {} block but 
>generate the scores like the following 
>(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)
>
> (ly:book-process
>  workgroup-book ; a \book {} object
>  #{ \paper {} #}  ; non-functional, placeholder
>  $defaultlayout ;; merged from all layout definitions
>  (get-output-name
>
>where 'workgroup-book' is a \book to which multiple bookparts are added
>with
>
>(ly:book-add-bookpart! workgroup-book
>  (ly:make-book-part
>(let ((movements (get-movement-list work-path)))
>  (reverse
>  (append-map
>   list
>   (map (lambda (mvt)
>  (list (makeMovementTitle (append work-path (list mvt)
> movements)
>   (map (lambda (mvt)
> (make-score (append work-path (list mvt
> movements))
>
>where a list of alternating title markups and scores are added to the 
>bookpart, and the scores are created with (at its core)
>
> (ly:make-score
>  (make-music 'SimultaneousMusic 'elements
>(filter
> (lambda (l) (not (null? l)))
> (map (lambda (elt) (staff elt)) elements
>
>
>So IIUC it boils down to the question: how can I apply \editionID (or 
>some equivalent code) to a score that is created with ly:make-score. As
>
>far as I have seen ly:make-score will only accept the music expression 
>and not the \layout {} or \midi {} blocks I can nest within a \score {}
>
>written in LilyPond language.
>And: if I manage to "install" an edition ID within that expression, is 
>it true that I can later address this score specifically?
>
>Thanks for any hints or explanations
>Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-03 Thread Jan-Peter Voigt
... and to add the editionID with ly:make-score there are parameters to achieve 
that. The editionID is also a context prop. You might look up the code of 
editionID. And maybe the lalily templates give some inspiration. (I moved it 
oll recently)


Am 3. April 2018 11:34:58 MESZ schrieb Urs Liska :
>I ran into an issue with the edition-engraver, targeting individual 
>scores when multiple scores are compiled within a bookpart.
>
>It's actually within the 'page-layout' or rather the 'breaks' 
>openLilyLib package, and I can imagine that my issue is related to 
>another one that was raised recently (that either of these packages 
>didn't work well with independent edition-engraver targets).
>
>The 'breaks' package 
>(https://github.com/openlilylib/breaks/blob/master/package.ily)
>installs 
>itself like this:
>
>% Install editionID
>\layout {
>   \context {
> \Score
> \editionID ##f breaks
>   }
>}
>
>which can later (e.g. in the page-layout.conditional-breaks package: 
>https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113)
>
>be addressed with (for example)
>
>% insert invisible barlines to enable breaks within measures
>\editionModList conditional-breaks breaks.Score.A
>\bar "" #in-measure-breaks
>
>This works perfectly - as long as there is only one score to be 
>compiled. However, if more than one score is compiled (at least in the 
>same bookpart) it seems that all the mods for all scores are merged 
>together, with the result that in each score all the line breaks for
>all 
>scores are applied.
>
>Am I understanding it right that I would have to use \editionID in a 
>layout block that only affects an individual score, giving them 
>individual names?
>
>And how could I do that if I don't have a literal \score {} block but 
>generate the scores like the following 
>(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)
>
> (ly:book-process
>  workgroup-book ; a \book {} object
>  #{ \paper {} #}  ; non-functional, placeholder
>  $defaultlayout ;; merged from all layout definitions
>  (get-output-name
>
>where 'workgroup-book' is a \book to which multiple bookparts are added
>with
>
>(ly:book-add-bookpart! workgroup-book
>  (ly:make-book-part
>(let ((movements (get-movement-list work-path)))
>  (reverse
>  (append-map
>   list
>   (map (lambda (mvt)
>  (list (makeMovementTitle (append work-path (list mvt)
> movements)
>   (map (lambda (mvt)
> (make-score (append work-path (list mvt
> movements))
>
>where a list of alternating title markups and scores are added to the 
>bookpart, and the scores are created with (at its core)
>
> (ly:make-score
>  (make-music 'SimultaneousMusic 'elements
>(filter
> (lambda (l) (not (null? l)))
> (map (lambda (elt) (staff elt)) elements
>
>
>So IIUC it boils down to the question: how can I apply \editionID (or 
>some equivalent code) to a score that is created with ly:make-score. As
>
>far as I have seen ly:make-score will only accept the music expression 
>and not the \layout {} or \midi {} blocks I can nest within a \score {}
>
>written in LilyPond language.
>And: if I manage to "install" an edition ID within that expression, is 
>it true that I can later address this score specifically?
>
>Thanks for any hints or explanations
>Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-03 Thread Jan-Peter Voigt
Hi Urs,

I am not at my desk right now, but IISC you named the right thing: Every score 
needs its own ID so that the EE is able to target the right score. 
We might *additionally* store mods as a Score context prop. for certain use 
cases. But still I strongly vote for IDs per score.

Jan-Peter

Am 3. April 2018 11:34:58 MESZ schrieb Urs Liska :
>I ran into an issue with the edition-engraver, targeting individual 
>scores when multiple scores are compiled within a bookpart.
>
>It's actually within the 'page-layout' or rather the 'breaks' 
>openLilyLib package, and I can imagine that my issue is related to 
>another one that was raised recently (that either of these packages 
>didn't work well with independent edition-engraver targets).
>
>The 'breaks' package 
>(https://github.com/openlilylib/breaks/blob/master/package.ily)
>installs 
>itself like this:
>
>% Install editionID
>\layout {
>   \context {
> \Score
> \editionID ##f breaks
>   }
>}
>
>which can later (e.g. in the page-layout.conditional-breaks package: 
>https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113)
>
>be addressed with (for example)
>
>% insert invisible barlines to enable breaks within measures
>\editionModList conditional-breaks breaks.Score.A
>\bar "" #in-measure-breaks
>
>This works perfectly - as long as there is only one score to be 
>compiled. However, if more than one score is compiled (at least in the 
>same bookpart) it seems that all the mods for all scores are merged 
>together, with the result that in each score all the line breaks for
>all 
>scores are applied.
>
>Am I understanding it right that I would have to use \editionID in a 
>layout block that only affects an individual score, giving them 
>individual names?
>
>And how could I do that if I don't have a literal \score {} block but 
>generate the scores like the following 
>(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)
>
> (ly:book-process
>  workgroup-book ; a \book {} object
>  #{ \paper {} #}  ; non-functional, placeholder
>  $defaultlayout ;; merged from all layout definitions
>  (get-output-name
>
>where 'workgroup-book' is a \book to which multiple bookparts are added
>with
>
>(ly:book-add-bookpart! workgroup-book
>  (ly:make-book-part
>(let ((movements (get-movement-list work-path)))
>  (reverse
>  (append-map
>   list
>   (map (lambda (mvt)
>  (list (makeMovementTitle (append work-path (list mvt)
> movements)
>   (map (lambda (mvt)
> (make-score (append work-path (list mvt
> movements))
>
>where a list of alternating title markups and scores are added to the 
>bookpart, and the scores are created with (at its core)
>
> (ly:make-score
>  (make-music 'SimultaneousMusic 'elements
>(filter
> (lambda (l) (not (null? l)))
> (map (lambda (elt) (staff elt)) elements
>
>
>So IIUC it boils down to the question: how can I apply \editionID (or 
>some equivalent code) to a score that is created with ly:make-score. As
>
>far as I have seen ly:make-score will only accept the music expression 
>and not the \layout {} or \midi {} blocks I can nest within a \score {}
>
>written in LilyPond language.
>And: if I manage to "install" an edition ID within that expression, is 
>it true that I can later address this score specifically?
>
>Thanks for any hints or explanations
>Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: an open question

2018-03-28 Thread Jan-Peter Voigt

Hello Jacques,

yes, you are right. Any information without a "first class citizen" will 
not be exported right. One might think of additional properties to give 
an export specific attribute - that is to say: this markup shall 
indicate swing tempo in MusicXML. But before that I want to be able to 
export the major exportable elements. And like Libre Office warns when 
you save an MS Word document that there might be elements that cannot be 
exported as expected this export function should do the same ;-)


Jan-Peter



Am 28.03.2018 um 08:47 schrieb Jacques Menu Muzhic:

Hello Jan-Peter,

Thanks for the information.

Exporting to MusicXML is difficult, also because there are things that 
need to be done in LP with Scheme code since there’s no ‘first class 
citizen’ to do the job.


This leads for example to the use of markup for things such as the swing 
tempo indication:


tempoRelationshipStaffReduce = #-3

tempoRelationship =
#(define-music-function (parser location label parenthesized musicI musicII)
    (string? boolean? ly:music? ly:music?)
    (let* (
            (left-paren (if parenthesized "(" ""))
            (right-paren (if parenthesized ")" ""))
            )
      #{
        \tempo \markup {
          \line \general-align #Y #DOWN {
            % 1st column in line
            $label

            % 2nd column in line

            $left-paren

            \score {
              \new Staff \with {
                % reduce the font size a la cue
                fontSize = #tempoRelationshipStaffReduce
                \override StaffSymbol.staff-space = #(magstep 
tempoRelationshipStaffReduce)

                % hide the staff lines
                \override StaffSymbol.line-count = #0
                % align horizontally
                \override VerticalAxisGroup.Y-extent = #'(-0.85 . 0)
              }

              {
                % \override 
Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/2) % 
super-tight
                % \override 
Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 1/4) % 
tight
                % \override 
Score.SpacingSpanner.common-shortest-duration = #(ly:make-moment 3/16) % 
even
                \override Score.SpacingSpanner.common-shortest-duration 
= #(ly:make-moment 5/32) % even


                % the left music
                \relative c' { \stemUp $musicI }

                % the equivalence sign
                \once \override Score.TextScript.Y-offset = #-0.4
                s4.^\markup{
                  \halign #-1 "="
                }

                % the right music
                \relative c' { \stemUp $musicII }
              }

              \layout {
                indent = 0
                \context {
                  \Staff
                  \remove "Clef_engraver"
                  \remove "Time_signature_engraver"
                }
              } % layout end
            } % score end

            $right-paren

          } % line end
        } % markup end
      #}))


     \tempoRelationship #"Swing" ##t
     \fixed b' {
       b8 [ b8 ]
     }
     \fixed b' {
       \tuplet 3/2 { b4 b8 }
     }

while they can be described natively in MusicXML:

      
         
           Swing
         
         
           relative-x="26">

             
               eighth
               begin
             
             
               eighth
               end
             
             equals
             
               quarter
               type="start">

                 3
                 2
                 eighth
               
             
             
               eighth
               
                 3
                 2
                 eighth
               
             
           
         
       

I’m not at ease enough currently with the Scheme/Lilypond interaction to 
be of any help, unfortunately.


JM

Le 26 mars 2018 à 07:29, Jan-Peter Voigt <jp.vo...@gmx.de 
<mailto:jp.vo...@gmx.de>> a écrit :


Hello Jacques,

last year I have been working on an export module for lilypond:
https://github.com/jpvoigt/lilypond-export/
This is in an early stage, a proof of concept. I had to put this 
project aside for a while, but it is still on my agenda and hopefully 
it develops further soon.


So if anyone is interested in joining this challenge you may contact 
via the list or private mail.


Jan-Peter


Am 24.03.2018 um 17:47 schrieb Jacques Menu Muzhic:

Hello,
Joe, what do mean exactly by pure data?
Jan-Peter, I’m interested in the MusicXML export from LP, can you 
tell us more?

A nice day!
JM





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


Re: Writing score definition in Scheme

2018-03-26 Thread Jan-Peter Voigt

OK
here's a short hint created with the help of displayMusic:

% a dummy definition of create-staff
#(define (get-staff what)
   (make-music 'ContextSpeccedMusic
 'create-new #t
 'property-operations '()
 'context-type 'Staff
 'element #{ c''4 #}))

% a scheme representation of \new StaffGroup
$(make-music
  'ContextSpeccedMusic
  'create-new #t
  'property-operations '()
  'context-type 'StaffGroup
  'element (make-music
'SimultaneousMusic
'elements (map get-staff '(oboe flute

HTH Jan-Peter

Am 26.03.2018 um 18:23 schrieb Urs Liska:


Am 26. März 2018 15:35:42 MESZ schrieb Jan-Peter Voigt<jp.vo...@gmx.de>:

Hi Urs,

I assume you know to build the music-expression for the score in
scheme.

No, not really.
I can replace \score {} with (ly:make-score) but that doesn't really help me.
I have no idea how to map the nesting of the parallel contexts to Scheme 
expressions within a single expression.

(get-staff returns Staff objects, but at a later (or earlier) point I will also 
want to create the Staff with Scheme (the music itself will stay in LilyPond 
language files).




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


Re: Writing score definition in Scheme

2018-03-26 Thread Jan-Peter Voigt

Hi Urs,

I assume you know to build the music-expression for the score in scheme. 
With that you can make use of #(scorify-music mymusic).
That creates a score object *and* creates the necessary music for << \\ 
>> constructs an thew like. If you don't need that you can simply use 
#(ly:make-score mymusic).


HTH
Jan-Peter

Am 26.03.2018 um 14:51 schrieb Urs Liska:

Hi all,

I'm embarrassed to admit I don't know where to start looking in the 
manuals.


I have a scheme-function that returns a \score expression, and I'm 
sure I wouldn't have to hop around between LilyPond and Scheme syntax 
like this:


make-score =
#(define-scheme-function (movement-path)(symbol-list?)
   #{
 \score {
   <<
 \new GrandStaff <<
   #(get-staff movement-path 'clarino-one)
   #(get-staff movement-path 'clarino-two)
   #(get-staff movement-path 'corno-one)
   #(get-staff movement-path 'corno-two)
 >>

 #(get-staff movement-path 'tympano)

 \new ChoirStaff <<
   #(get-staff movement-path 'soprano)
   #(get-staff movement-path 'alto)
   #(get-staff movement-path 'tenor)
   #(get-staff movement-path 'bass)
 >>
 \new StaffGroup <<
   \new GrandStaff <<
 #(get-staff movement-path 'violin-one)
 #(get-staff movement-path 'violin-two)
 #(get-staff movement-path 'viola)
   >>
   #(get-staff movement-path 'bc)
 >>
   >>
   \midi {}
   \layout {}
 }
   #})


The function is also called from within Scheme code, so I would like 
to write the same using Scheme only, without switching to LilyPond 
with #{ #} but also back to Scheme within these expressions.


How would I go about this and/or where would I look up the reference 
for this?


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: an open question

2018-03-25 Thread Jan-Peter Voigt

Hello Jacques,

last year I have been working on an export module for lilypond:
https://github.com/jpvoigt/lilypond-export/
This is in an early stage, a proof of concept. I had to put this project 
aside for a while, but it is still on my agenda and hopefully it 
develops further soon.


So if anyone is interested in joining this challenge you may contact via 
the list or private mail.


Jan-Peter


Am 24.03.2018 um 17:47 schrieb Jacques Menu Muzhic:

Hello,

Joe, what do mean exactly by pure data?

Jan-Peter, I’m interested in the MusicXML export from LP, can you tell 
us more?


A nice day!

JM

Le 24 mars 2018 à 06:48, Jan-Peter Voigt <jp.vo...@gmx.de 
<mailto:jp.vo...@gmx.de>> a écrit :


Hello Joe,

this is touching a subject I have been working on last year. I created 
some kind of proof of concept to export other file formats from 
lilypond. I can export musicXML and Humdrum with some limitations. It 
is based on an infrastructure that exports via format-plugins so it 
should be possible to create one for pd.

If you are interested I can send more informations.

Jan-Peter



Am 24. März 2018 02:08:28 MEZ schrieb Joe Davenport 
<joedavnp...@gmail.com <mailto:joedavnp...@gmail.com>>:


Hello,

When another user inquired about composing without midi playback, i found 
encouragement to ask something from the technical side. Maybe i have some 
healthy curiousity about coding language, which follows:

Is it possible to integrate .ly with other musical coding languages? It 
would be very beneficial to write music that integrates the quick engraving of 
lilpond (other software is too slow for me) with the sound fonts and modulation 
of pure data.

i may have read this being used in rosegarden. however, it took time for me 
to integrate .pd with my soundcard- so i could use some pointers or insurance 
on integrating these two languages!

thank you,

joe

Sent from my iPhone


lilypond-user mailing list
lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
https://lists.gnu.org/mailman/listinfo/lilypond-user


--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
___
lilypond-user mailing list
lilypond-user@gnu.org <mailto: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: an open question

2018-03-23 Thread Jan-Peter Voigt
Hello Joe,

this is touching a subject I have been working on last year. I created some 
kind of proof of concept to export other file formats from lilypond. I can 
export musicXML and Humdrum with some limitations. It is based on an 
infrastructure that exports via format-plugins so it should be possible to 
create one for pd.
If you are interested I can send more informations.

Jan-Peter



Am 24. März 2018 02:08:28 MEZ schrieb Joe Davenport :
>Hello,
>
>When another user inquired about composing without midi playback, i
>found encouragement to ask something from the technical side. Maybe i
>have some healthy curiousity about coding language, which follows:
>
>Is it possible to integrate .ly with other musical coding languages? It
>would be very beneficial to write music that integrates the quick
>engraving of lilpond (other software is too slow for me) with the sound
>fonts and modulation of pure data.
>
>i may have read this being used in rosegarden. however, it took time
>for me to integrate .pd with my soundcard- so i could use some pointers
>or insurance on integrating these two languages!
>
>thank you,
>
>joe
>
>Sent from my iPhone
>___
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: get current bar number

2018-03-23 Thread Jan-Peter Voigt

Hi Kevin,

yes, you need to get a context object. If you want to use it inside some 
music expression \applyContext is the key:



doSomething =
\applyContext #(lambda (context)
 (display
  (ly:context-property context 'currentBarNumber)
  ))

{ c''4 \doSomething d'' }


If you are going to write an engraver you can find some informations in 
the archive.


HTH
Jan-Peter


Am 23.03.2018 um 01:55 schrieb Kevin Barry:

Hi All,

I would like to be able to get the current bar number context property 
so that I can do something with it (like printing it in markup for example).


I have tried the following scheme function:
(ly:context-property 'Score 'currentBarNumber)
but it errors out, telling me that Score is not a context. Do I need to 
get the context object somehow?


Any help appreciated.

Kevin



___
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: predicate for \lyricmode

2018-03-20 Thread Jan-Peter Voigt
Yes, but you might write one that checks if the music expression does contain 
elements of a certain type. It is possible, but I can't tell if its reasonable.


Am 20. März 2018 17:35:44 MEZ schrieb David Kastrup :
>Urs Liska  writes:
>
>> Hi all,
>>
>> is there a LilyPond predicate for a \lyricmode expression?
>>
>> \version "2.19.80"
>>
>> test =
>> #(define-void-function (text)(ly:music?)
>>(display text))
>>
>> text = \lyricmode { a b c }
>> \test \text
>>
>> does work, so ly:music? accepts the lyricmode expression. But is
>there
>> a narrower predicate I can use to expect lyrics to be arguments for a
>> function?
>
>No.  It's just an ordinary music expression containing different
>elements conveniently entered with \lyricmode .
>
>-- 
>David Kastrup
>
>___
>lilypond-user mailing list
>lilypond-user@gnu.org
>https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Edition Engraver bug?

2018-03-15 Thread Jan-Peter Voigt

Hi Stéfano,

I tested with the force-rebel-tie.ly file you sent earlier in this 
thread. What I meant was that \tieDown still does have no effect, when 
there is a \voiceOne statement - maybe hidden via << \\ >>. So the first 
tie is not changed with the EE-mod in the demo.

Do you think the warnings are too verbose?

Am 14.03.2018 um 21:47 schrieb Stefano Troncaro:
I wanted to let you know that I have tried the refactor-override 
branch and the overrides seem to be working fine! I do get a lot of 
warnings as you explained, but it does not appear the the EE overrides 
are getting overwritten, or maybe I'm misunderstanding your explanation?


2018-03-13 13:50 GMT-03:00 Stefano Troncaro <stefanotronc...@gmail.com 
<mailto:stefanotronc...@gmail.com>>:


Hi Jan-Peter,

Thank you for your work! I will test the changes later today and
let you know how it results.

2018-03-13 7:47 GMT-03:00 Jan-Peter Voigt <jp.vo...@gmx.de
<mailto:jp.vo...@gmx.de>>:

Am 13.03.2018 um 11:37 schrieb David Kastrup:

Jan-Peter Voigt <jp.vo...@gmx.de <mailto:jp.vo...@gmx.de>>
writes:

Hi Stefano,

I have been looking into the issue and created a branch
'refactor-override' for the edition-engraver.
The following is changed in there:
* Overrides are not applied "by hand" but send as a
StreamEvent so
that once is handled by lily and not the EE
* Override (and Revert, Set, Unset) sent by the EE are
marked so that
they can be distinguished from other overrides

That means once-overrides are note reverted wrong
anymore and the EE
gives a warning if an overrides supersedes/overwrites
an EE mod. This
is still not completely satisfactory when the EE shall
override all
other settings. But at least it doesn't revert wrong.

If this branch is tested more thoroughly I will merge
it into master.
Now I am looking for a way to let the EE be the last
broadcaster so
that it will not be overridden by overrides sent from
the actual music
stream.


How do you trigger the EE?  Overrides from the music
stream are sent by
the iterators.  That's after start-translation-timestep
and before
process-music.


The EE broadcasts overrides (events) inside
start-translation-timestep. I tried to do it in process-music,
but then they were applied too late.
The EE is looking in its internal mod-store if there is
something to do for this timestep (for this context). Is there
a way to act between those slots - the latest action before
process-music?


___
lilypond-user mailing list
lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
https://lists.gnu.org/mailman/listinfo/lilypond-user
<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: Edition Engraver bug?

2018-03-13 Thread Jan-Peter Voigt

Am 13.03.2018 um 11:37 schrieb David Kastrup:

Jan-Peter Voigt <jp.vo...@gmx.de> writes:


Hi Stefano,

I have been looking into the issue and created a branch
'refactor-override' for the edition-engraver.
The following is changed in there:
* Overrides are not applied "by hand" but send as a StreamEvent so
that once is handled by lily and not the EE
* Override (and Revert, Set, Unset) sent by the EE are marked so that
they can be distinguished from other overrides

That means once-overrides are note reverted wrong anymore and the EE
gives a warning if an overrides supersedes/overwrites an EE mod. This
is still not completely satisfactory when the EE shall override all
other settings. But at least it doesn't revert wrong.

If this branch is tested more thoroughly I will merge it into master.
Now I am looking for a way to let the EE be the last broadcaster so
that it will not be overridden by overrides sent from the actual music
stream.


How do you trigger the EE?  Overrides from the music stream are sent by
the iterators.  That's after start-translation-timestep and before
process-music.


The EE broadcasts overrides (events) inside start-translation-timestep. 
I tried to do it in process-music, but then they were applied too late.
The EE is looking in its internal mod-store if there is something to do 
for this timestep (for this context). Is there a way to act between 
those slots - the latest action before process-music?


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


Re: Edition Engraver bug?

2018-03-13 Thread Jan-Peter Voigt

Hi Stefano,

I have been looking into the issue and created a branch 
'refactor-override' for the edition-engraver.

The following is changed in there:
* Overrides are not applied "by hand" but send as a StreamEvent so that 
once is handled by lily and not the EE
* Override (and Revert, Set, Unset) sent by the EE are marked so that 
they can be distinguished from other overrides


That means once-overrides are note reverted wrong anymore and the EE 
gives a warning if an overrides supersedes/overwrites an EE mod. This is 
still not completely satisfactory when the EE shall override all other 
settings. But at least it doesn't revert wrong.


If this branch is tested more thoroughly I will merge it into master.
Now I am looking for a way to let the EE be the last broadcaster so that 
it will not be overridden by overrides sent from the actual music stream.


Jan-Peter


Am 26.02.2018 um 15:26 schrieb Stefano Troncaro:
Hi everyone! I tried to isolate the issue with Tie directions that I 
posted earlier and I'm fairly confident I've stumbled upon a bug.


Look at the output of this snippet (Sorry for the length, I made it as 
short as I could)


\version  "2.19.80" \language  "english" \include  "oll-core/package.ily" 
\loadPackage  edition-engraver
\addEdition  test
\consistToContexts  #edition-engraver Voice

\layout  { \context  { \Score \time  6/4
 \omit  TimeSignature \omit  Clef } } forceRebelTie =
#(define-music-function  (dir) (ly:dir?)
#{
  \override  Tie.before-line-breaking  =
  #(lambda  (grob)
 (ly:grob-set-property!  grob 'direction dir)) #} )

ovA =\once  \tieDown ovB =\once \override  Tie.direction  = #DOWN ovC =\once  \forceRebelTie  #DOWN formA =\new  Staff  \with  {  instrumentName  ="All V1"  } << \new  Voice  \relative  c''{  \voiceOne  b~  4 4~  4 4~  4} >> formB =\new  Staff  \with  {  instrumentName  ="1V V1"  } << \new  Voice  \relative  c''{  b~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  } >> controlA =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovA  b~  4 4~  4 4~  4  } >> controlB =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovB  b~  4 4~  4 4~  4  } >> controlC =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovC  b~  4 4~  4 4~  4  } >> \markup  "Results with \\tieDown" \editionMod  test1 0  Voice.A\ovA \editionMod  test1 0  Voice.B\ovA \score  { \new  StaffGroup  << \formA \formB \controlA >> } \markup  "Results with \\override Tie.direction" \editionMod  test1 0  Voice.D\ovB \editionMod  test1 0  Voice.E\ovB \score  { \new  StaffGroup  << \formA \formB \controlB >> } \markup  "Results with ly:grob-set-property!" \editionMod  test1 0  Voice.G\ovC \editionMod  test1 0  Voice.H\ovC \score  { \new  StaffGroup  << \formA \formB \controlC >> } \markup  "No overrides (default behavior for comparison)" \score  { \new  StaffGroup  << \formA \formB >> } 



When \voiceOne is in full effect, both \once \tieDown and\once \override 
Tie.direction seem to have a permanent effect that kicks in after the 
moment they are used, which is exactly the opposite to what they should 
do (take effect only in the moment they are called and revert to the 
previous behavior after). This is very clear when you compare the All V1 
Staff with the No EE Staff: the All V1 behaves in the exact opposite way.


I have absolutely no idea about why this may be happening, but I'm 
certain that one should expect the EE to achieve the same results that 
manually writing the code in the desired place and moment would.


Hopefully Jan-Peter or someone more knowledgeable than I can look into it!

I hope this "research" can be useful!
Stéfano


___
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


edition-engraver commit error (was Re: Edition Engraver tweak error)

2018-03-06 Thread Jan-Peter Voigt

Hi Craig,

Kieren already answered, but I want to assure that you where not caught 
by I mistake I made on Monday: There is a commit that ought to be in its 
own branch for development that accidentally disabled overrides. So 
please do switch to the previous commit (Feb 1 "issue #19") if this is 
the case.


I am sorry for any inconvenience for any user of the edition-engraver!

I repaired the repository, so any users that did not pull between Monday 
5. Mar 21h CET and 7. Mar 8:30h CET should not be affected by this mistake.


Best
Jan-Peter



Am 06.03.2018 um 23:41 schrieb Craig Dabelstein:

Hi all,

When trying to apply a tweak to a hairpin with the EE I get an 
"unterminated crescendo" error. If I leave out the crescendo \< from the 
EE (but include it in the content file which is where it thought it 
should belong) it doesn't work at all. Is there a different way I should 
be trying to do this?


\editionMod global 57 2/4 wagner.trauermusik.fluteI.Voice -\tweak 
minimum-length #5 \<


Thanks in advance,

Craig


--
*Craig Dabelstein*
Maxime's Music
craig.dabelst...@gmail.com 
/http://maximesmusic.com/


___
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: bookparts

2018-03-06 Thread Jan-Peter Voigt

Am 06.03.2018 um 13:12 schrieb David Kastrup:

IISC a major change to the codebase would be needed to allow something
like this: \bookpart { music = { c''4 } { \music } }
but there are a lot users who would like to use it this way.
I don't want to talk about scopes and coding style, but want to show
how I deal with it:
Using void-functions is a great thing because the can be called
anywhere. So if you want to define something inside a file that is to
be included inside curly brackets you can use a function like this:
--
\version "2.19.80"

def = #(define-void-function (sym val)(symbol? scheme?)
  (ly:parser-define! sym val))

\bookpart {
   \def music { c''4 } % this might be part of an included file
   { \music }
}

It would be utterly trivial to make assignments work like that void
function in the parser.

OK> It still would not introduce scoping, so people would be surprised that

assignments made in one book overrode assignments in an earlier book or
at top level.



People would expect to set the same named variables in different books
to different values and it would not work.

Essentially I talked about that in the second paragraph.


A generic function like "def" is about as useful as a generic opener for
child-proof bottle caps: the only person needing it is one you don't
want to have it.
You may be right. But still, *sometimes* I use such a function for files 
which are included and which *might* throw an error otherwise.



Now books and bookparts actually have a \header with associated scopes.
Anything wrong with doing assignments in there?

That might look like this?
--
\version "2.19.80"

headerVal =
#(define-scheme-function (name)(symbol?)
   (let ((alist (ly:module->alist (ly:book-header $current-bookpart
 (assoc-get name alist)
 ))

\bookpart {
  \header {
thevoice = \relative { a'4 c g f }
thelyrics = \lyricmode { la la la la }
  }
  <<
\new Voice = "heinz" { \headerVal thevoice }
\new Lyrics \lyricsto "heinz" { \headerVal thelyrics }
  >>
}
--

This might be useful and essentially lead to something. Now, I am used 
to my own toolchain and prefer delegating score- and bookpart-creation 
to music- and scheme-functions. And I really don't like using the header 
for content. (Btw. I didn't follow the whole thread so maybe nobody was 
asking for that)


Jan-Peter


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


Re: bookparts

2018-03-06 Thread Jan-Peter Voigt

Hi all,

in this mail the thing with defining variables inside of curly brackets 
popped up the first time in this thread - so I hook here. (If it was 
mentioned in the former mails it doesn't matter ;-) )


IISC a major change to the codebase would be needed to allow something 
like this: \bookpart { music = { c''4 } { \music } }

but there are a lot users who would like to use it this way.
I don't want to talk about scopes and coding style, but want to show how 
I deal with it:
Using void-functions is a great thing because the can be called 
anywhere. So if you want to define something inside a file that is to be 
included inside curly brackets you can use a function like this:

--
\version "2.19.80"

def = #(define-void-function (sym val)(symbol? scheme?)
 (ly:parser-define! sym val))

\bookpart {
  \def music { c''4 } % this might be part of an included file
  { \music }
}
--
(In lily stable (<2.19) you have to add the parser and location arguments)

Still we have the global scope (OK, I do talk about scope) of the 
current parser. Now if you want to use some kind of templating mechanism 
you have two competing needs for the variable names. One approach to 
create templates is to prepare files to include which use well-named 
variables. For the piano the file might reference the variables 
piano_left and piano_right which have to be assigned beforehand. My 
first scores where for choir. So I was looking for a more flexible 
templates and I started to write music-functions which store the music 
in a tree so that my template functions are called "inside" or "on" a 
base branch. The branches of the tree are the scopes in which the 
template functions are called. This has the advantage that I can define 
several pieces of music with several instruments and then can quite 
easily create a book with several pieces all with there own 
instrumentation. You can have a look on the result here: 
https://github.com/jpvoigt/lalily-templates

(I am going to move this OLL-module to the OLL-GitHub-organization)


These are some very rough and quite unstructured thoughts ...
To conclude:
1. defining variables with music- or void-functions is a way to overcome 
the obstacle of defining variables only on the top-level
2. if the store behind the function allows for hierarchical storage 
templates (files or functions) can make use of a scope that is not on 
coding but on a semantic level ... or the like. This should be reworded 
somehow - I hope you get what I mean.


Jan-Peter



Am 05.03.2018 um 18:24 schrieb Kieren MacMillan:

Hi David,


Q: Included files just behave as if the content was inserted at the same
  position?
Q: Includes must be at top level?


Yes x 2.


Second yes is wrong.


Even if the included file has variable definitions?

Thanks,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
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: Edition Engraver bug?

2018-03-05 Thread Jan-Peter Voigt

Thank you, David! Sometimes I need a pointer to the obvious ...
* I will refactor the EE to also broadcast overrides.
* Of course I can listen to Overrides (and SetProperty) and check if 
there are editionMods and music colliding - the reason they didn't show 
up when I listened to StreamEvent was that I was looking for 
music-cause, but that isn't set.

* The EE might export overrides and such to another file for use with the EE

There first point should clean up and shorten some code. I will need 
some days but will deliver an update ASAP.


Jan-Peter


Am 05.03.2018 um 12:18 schrieb David Kastrup:

Jan-Peter Voigt <jp.vo...@gmx.de> writes:


Hi David,

Am 05.03.2018 um 10:42 schrieb David Kastrup:

This is a failure that can happen whenever there are (implicit)
overrides in the music. I'll try to track/fetch overrides generated
outside the EE to avoid this issue.

Any chance to actually use the equivalent of "\once" here?  It's
protected against reverting the wrong override, but this functionality
is not exposed at the Scheme level.


The EE is written entirely in scheme so I don't see a chance.


It can still send override events rather than setting properties by
itself.


How would it be possible to listen to overrides? They are not caught
when I listen to StreamEvent.


What?  They are definitely sent as events.




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


Re: Edition Engraver bug?

2018-03-05 Thread Jan-Peter Voigt

Hi David,

Am 05.03.2018 um 10:42 schrieb David Kastrup:

This is a failure that can happen whenever there are (implicit)
overrides in the music. I'll try to track/fetch overrides generated
outside the EE to avoid this issue.

Any chance to actually use the equivalent of "\once" here?  It's
protected against reverting the wrong override, but this functionality
is not exposed at the Scheme level.


The EE is written entirely in scheme so I don't see a chance. But 
probably I just don't see it right now.


*the following is just a brainstorm*

The overrides given by \editionMod are applied early in the 
start-translation-timestep slot and therefore before overrides inside 
the music are applied (inside process-music ?). If the EE applies 
overrides inside process-music it is to late.
The once-overrides managed by the EE are stored in a list until they are 
reverted inside stop-translation-timestep. Of course it would be better 
to give the once-attribute once and let lilypond revert the right property.
How would it be possible to listen to overrides? They are not caught 
when I listen to StreamEvent. Maybe it is to prevent me from 
implementing bad patterns.


I will later produce a more concise chart on how and when the EE is 
applying overrides.


Jan-Peter


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


Re: Edition Engraver bug?

2018-03-05 Thread Jan-Peter Voigt

Hi Stefano,

thanks again for bringing up this issue! Now I identified it an EE-bug 
and I was able to reproduce the failure with:

--
\version "2.19.80"
\include "oll-core/package.ily"
\loadPackage edition-engraver
\consistToContexts #edition-engraver Voice

\addEdition test

\editionMod test 1 0/4 Voice.A \once \tieDown

<<
  \relative { a'4~ a~ a~ a } \\
  \relative { e'~ e~ e~ e }
>>
--

If \tieDown is is set to moment 1/4 it is applied as expected - so the 
affected \editionMod at moment 0/4 is scheduled to happen at the moment 
\voiceOne is applied. This issue produces some kind of a race condition 
where Tie.direction is modified by \voiceOne after \editionMod comes 
into action. The EE does a \revert for all \overrides when the timestep 
is finished, but the top of the override stack is the override 
introduced by \voiceOne, so that is reverted to the \tieDown state.
(Btw. \tieDown is just an equivalent shortcut for \override 
Tie.direction = #DOWN)
Using ly:grob-property is not affected here, because there are no 
overrides to Tie.after-linebreak inside the music expression and 
ly:grob-property is applied late.


This is a failure that can happen whenever there are (implicit) 
overrides in the music. I'll try to track/fetch overrides generated 
outside the EE to avoid this issue.


Jan-Peter



Am 26.02.2018 um 15:26 schrieb Stefano Troncaro:
Hi everyone! I tried to isolate the issue with Tie directions that I 
posted earlier and I'm fairly confident I've stumbled upon a bug.


Look at the output of this snippet (Sorry for the length, I made it as 
short as I could)


\version  "2.19.80" \language  "english" \include  "oll-core/package.ily" 
\loadPackage  edition-engraver
\addEdition  test
\consistToContexts  #edition-engraver Voice

\layout  { \context  { \Score \time  6/4
 \omit  TimeSignature \omit  Clef } } forceRebelTie =
#(define-music-function  (dir) (ly:dir?)
#{
  \override  Tie.before-line-breaking  =
  #(lambda  (grob)
 (ly:grob-set-property!  grob 'direction dir)) #} )

ovA =\once  \tieDown ovB =\once \override  Tie.direction  = #DOWN ovC =\once  \forceRebelTie  #DOWN formA =\new  Staff  \with  {  instrumentName  ="All V1"  } << \new  Voice  \relative  c''{  \voiceOne  b~  4 4~  4 4~  4} >> formB =\new  Staff  \with  {  instrumentName  ="1V V1"  } << \new  Voice  \relative  c''{  b~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  } >> controlA =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovA  b~  4 4~  4 4~  4  } >> controlB =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovB  b~  4 4~  4 4~  4  } >> controlC =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovC  b~  4 4~  4 4~  4  } >> \markup  "Results with \\tieDown" \editionMod  test1 0  Voice.A\ovA \editionMod  test1 0  Voice.B\ovA \score  { \new  StaffGroup  << \formA \formB \controlA >> } \markup  "Results with \\override Tie.direction" \editionMod  test1 0  Voice.D\ovB \editionMod  test1 0  Voice.E\ovB \score  { \new  StaffGroup  << \formA \formB \controlB >> } \markup  "Results with ly:grob-set-property!" \editionMod  test1 0  Voice.G\ovC \editionMod  test1 0  Voice.H\ovC \score  { \new  StaffGroup  << \formA \formB \controlC >> } \markup  "No overrides (default behavior for comparison)" \score  { \new  StaffGroup  << \formA \formB >> } 



When \voiceOne is in full effect, both \once \tieDown and\once \override 
Tie.direction seem to have a permanent effect that kicks in after the 
moment they are used, which is exactly the opposite to what they should 
do (take effect only in the moment they are called and revert to the 
previous behavior after). This is very clear when you compare the All V1 
Staff with the No EE Staff: the All V1 behaves in the exact opposite way.


I have absolutely no idea about why this may be happening, but I'm 
certain that one should expect the EE to achieve the same results that 
manually writing the code in the desired place and moment would.


Hopefully Jan-Peter or someone more knowledgeable than I can look into it!

I hope this "research" can be useful!
Stéfano


___
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: Including tweaks in a variable

2018-03-01 Thread Jan-Peter Voigt

Hello Michael,

it works if you add \etc to the variable (in lily-dev 2.19.x IIRC):
smNote = \tweak font-size #-2 \etc
That way smNote becomes a music-function that takes the note as argument 
and the tweak is applied.

If you are using 2.18 you have to create the function like this:
smNote = #(define-music-function (m)(ly:music?) #{ \tweak font-size #-2 
#m #})


HTH
Jan-Peter

Am 01.03.2018 um 15:33 schrieb Michael Stickles:
This should be simple, but I just can't seem to get it to work.  I'm 
working on re-doing a lot of our church music, and use variables 
extensively to help make the .ly files more readable. There are a lot 
of places where one vocal part splits and we want the "secondary" 
notes to be smaller, resulting in code like this:


1

What I want to do is replace the "tweak" section with a variable, like 
this:


smNote = \tweak font-size #-2

1

But this results in errors:

error: unknown escaped string: `\smNote'
error: wrong type for argument 3.  Expecting symbol list or music, 
found #


(the "smNote" definition is at the end of the variables section, and 
the first line after the variables section is "\book {" )


Some online searching came up with a few suggestions, but none of them 
worked for me. Given that they worked for the original posters, I'd 
guess I implemented them incorrectly, but I can't figure out what I'm 
doing wrong. Ideas?



___
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: Edition Engraver -- multiple editions

2018-03-01 Thread Jan-Peter Voigt

Hi Craig,

you remind me to rethink wording/naming of the different identifiers!

In your example you point on two different ID-types. With \addEdition 
you add one target-ID to the current compilation. You can add multiple 
targets like fullscore, global-mods, original-page-breaks at once.


With \editionID inside a layout-context block you assign a 
context-identifier. There is one context-identifier - one might call it 
context-address - per context-instance.

So the score will have a contextID like perhaps:

\layout {
  \context {
\Score
\editionID ##f bwv.247.marco.11.choral
  }
}

and the different context are created with e.g.
\new Staff \with { \editionID flute } << ... >>
so this Staff receives the ID `bwv.247.marco.11.choral.flute`.
This should be stable across all compilations for all targets.
Now you can enter modifications like
\editionMod score 2 3/4 bwv.247.marco.11.choral.Staff score>

\editionMod part 2 3/4 bwv.247.marco.11.choral.Staff 
\editionMod global 2 3/4 bwv.247.marco.11.choral.Staff 

(you can shorten this significantly with a variable!)

Inside the respective files for the core and the part you can add 
targets as you like:

\addEdition score
\addEdition global

The EE will apply all modifications for all active targets. In the part 
files you might use the shorter variant

\setEditions part.violin.global

To activate the "part", "violin" and "global" targets. If lilypond reads 
the mods for the score while compiling the violin part, it doesn't 
matter, as long as the score-target is not active.


The edition-engraver is using pointers/IDs/addresses in three dimensions:
1. the target of the current compilation-run
2. the context-address
3. the timestep

Right now target IDs can not be changed within a file/a compilation for 
different scores. So you will have one file for the fullscore and one 
for each part. These files will include the music from other files and 
then apply the mods needed for the current target.


HTH
Jan-Peter

Btw.:
One of the projects I have been working on over the last two years is 
typesetting a new reconstruction of the "Markus-Passion" from Johann 
Sebastian Bach (Ortus-Verlag/Berlin - fullscore ISMN 979-0-502340-65-0, 
piano reduction ISMN 979-0-502340-66-7, choir part ISMN 
979-0-502340-67-4, instrumental parts ISMN 979-0-502340-68-1)

by Andreas Fischer (St.Katharinen, Hamburg, Germany).
I am going to write a description of this project when my schedule allows.




Am 01.03.2018 um 02:34 schrieb Craig Dabelstein:

Hi all,

I thought I had my head around the edition engraver but I'm going wrong 
somewhere. If I want to have different mods for a score, the parts, and 
a selection of mods applicable to both the score and the parts, do I 
need to create three different editions such as this:


\addEdition score
\addEdition parts
\addEdition scoreandparts

If so, how do I switch between them?

I was trying to use different editionIDs for everything but it's not 
working. Can a score have multiple IDs such as:


\layout{
\context {
     \Score
     \editionID ##f score
     \editionID ##f both
     }
}

Thanks in advance,

Craig

--
*Craig Dabelstein*
Maxime's Music
craig.dabelst...@gmail.com 
/http://maximesmusic.com/


___
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: Edition Engraver bug?

2018-02-26 Thread Jan-Peter Voigt

Hi Stefano,

thanks a lot for researching this issue! Sometimes I also noticed "rebel 
ties", but I didn't identified it as an EE bug. So your research file 
looks meaningful.

I hope to have a deeper look into it next week.

Best
Jan-Peter

Am 26.02.2018 um 15:26 schrieb Stefano Troncaro:
Hi everyone! I tried to isolate the issue with Tie directions that I 
posted earlier and I'm fairly confident I've stumbled upon a bug.


Look at the output of this snippet (Sorry for the length, I made it as 
short as I could)


\version  "2.19.80" \language  "english" \include  "oll-core/package.ily" 
\loadPackage  edition-engraver
\addEdition  test
\consistToContexts  #edition-engraver Voice

\layout  { \context  { \Score \time  6/4
 \omit  TimeSignature \omit  Clef } } forceRebelTie =
#(define-music-function  (dir) (ly:dir?)
#{
  \override  Tie.before-line-breaking  =
  #(lambda  (grob)
 (ly:grob-set-property!  grob 'direction dir)) #} )

ovA =\once  \tieDown ovB =\once \override  Tie.direction  = #DOWN ovC =\once  \forceRebelTie  #DOWN formA =\new  Staff  \with  {  instrumentName  ="All V1"  } << \new  Voice  \relative  c''{  \voiceOne  b~  4 4~  4 4~  4} >> formB =\new  Staff  \with  
{  instrumentName  ="1V V1"  } << \new  Voice  \relative  c''{  b~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  \oneVoice  4~  \voiceOne  4  } >> controlA =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  
\voiceOne  \ovA  b~  4 4~  4 4~  4  } >> controlB =\new  Staff  \with  {  instrumentName  ="No EE"  } << \new  Voice  \relative  c''{  \voiceOne  \ovB  b~  4 4~  4 4~  4  } >> controlC =\new  Staff  \with  {  instrumentName  ="No EE"  } 
<< \new  Voice  \relative  c''{  \voiceOne  \ovC  b~  4 4~  4 4~  4  } >> \markup  "Results with \\tieDown" \editionMod  test1 0  Voice.A\ovA \editionMod  test1 0  Voice.B\ovA \score  { \new  StaffGroup  << \formA \formB \controlA >> } \markup 
 "Results with \\override Tie.direction" \editionMod  test1 0  Voice.D\ovB \editionMod  test1 0  Voice.E\ovB \score  { \new  StaffGroup  << \formA \formB \controlB >> } \markup  "Results with ly:grob-set-property!" \editionMod  test1 0  
Voice.G\ovC \editionMod  test1 0  Voice.H\ovC \score  { \new  StaffGroup  << \formA \formB \controlC >> } \markup  "No overrides (default behavior for comparison)" \score  { \new  StaffGroup  << \formA \formB >> }


When \voiceOne is in full effect, both \once \tieDown and\once 
\override Tie.direction seem to have a permanent effect that kicks in 
after the moment they are used, which is exactly the opposite to what 
they should do (take effect only in the moment they are called and 
revert to the previous behavior after). This is very clear when you 
compare the All V1 Staff with the No EE Staff: the All V1 behaves in 
the exact opposite way.


I have absolutely no idea about why this may be happening, but I'm 
certain that one should expect the EE to achieve the same results that 
manually writing the code in the desired place and moment would.


Hopefully Jan-Peter or someone more knowledgeable than I can look into it!

I hope this "research" can be useful!
Stéfano


___
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: A couple of questions about Edition Engraver

2018-02-20 Thread Jan-Peter Voigt

Hello Stefano,

this is a great idea! Setting global context variables can reduce the 
needed code significantly.

In
https://github.com/openlilylib/edition-engraver/blob/master/usage-examples/development-1.ly
I use global variables to create "dynamic" editionModLists.

The files development*.ly in the usage-example folder are created during 
implementation of the displayed feature. The developed code used in 
development-2.ly and -3.ly already made its way into the core module and 
is usable out of the box. The code in development-1.ly will be placed 
there if it proofed useful. (At least I used it a lot in a score 
containing lyrics to balance the syllables in order to get the rhythmic 
picture of the score intact.)


Jan-Peter


Am 20.02.2018 um 06:03 schrieb Stefano Troncaro:
I've been wanting to expand my earlier tutorial with a section dealing 
with \editionModList since I think the convenience of it can be useful 
to many users. However, it is not a solution for every situation. 
Particularly, it is not useful when you need to insert objects as part 
of your edition if they are going to need tweaks (for example, slurs 
that need to be shaped). Also, in these situations it takes away the 
convenience of the point and click support of Frescobaldi.


I've been thinking about the cases where \editionModList is not useful, 
and I think that a simple wrapping function should be enough. I had not 
had time to write it but it should be pretty easy to do something like this:


\quickEditionModSettings target-edition target-context 


\qM 1 2/4 ^"I'm a quick Mod. I reduce redundancy"


Where the \qM command would translate to \editionMod target-edition 1 
2/4 target-context ^"blabla". With proper input file structure this 
shouldn't impair readability of the code. The only thing that I can 
think of that could further decrease redundancy is to make it so that 
the position in the measure defaults to 0 if it is absent, but this is 
unnecessary in my opinion.


But the above represents the way I prefer to structure my files. Given 
the way you (David) structured the code in your original post, perhaps a 
wrapper that works like this would be closer to your intentions?


\qMSet 'edition test

   \qMSet 'measure 1

     \qM 0/4 Voice \(

     \qM 1/4 Lyrics #(make-music 'ExtenderEvent)

   \qMSet 'measure 2

     \qMSet 'moment 0/4

   \qMSet 'context Score

         \qM \time 3/4

         \qM \tempo "Allegro" 4=135

   \qMSet 'context Voice

         \qM \p

         \qM \<

     \qMSet 'moment 1/4

   \qM Lyrics #(make-music 'HyphenEvent)


As far as I know something like that could be done, although admittedly 
it's not as minimalistic as your desired example with brackets. It does 
have the logical structure you seem to prefer though.


2018-02-19 11:34 GMT-03:00 Jan-Peter Voigt <jp.vo...@gmx.de 
<mailto:jp.vo...@gmx.de>>:


Hi David,

Urs already answered. I understand your concerns about the input and
I am always open for ideas to ease the input for the
edition-engraver. Like Urs already mentioned your proposal will be
difficult to implement because it doesn't use the standard parser
schemes. But it sheds light on how others might expect an
easy/consistent input.

What is not explained in the demo files (yet) is: You are always
free to use constructs like

\editionMod test 1 0/4 Voice {
   <>(
   \once \override NoteHead.color = #red
   \once \override Beam.color = #red
}

To address multiple time steps at once you can use \editionModList,
to address multiple contexts at once you can use regular expressions
and wildcards like in

https://github.com/openlilylib/edition-engraver/blob/master/usage-examples/development-3.ly

<https://github.com/openlilylib/edition-engraver/blob/master/usage-examples/development-3.ly>

Your example implies that it would be a useful feature if one can
split timing and context information into several layers. I'll think
about it.

I am going to focus on the edition-engraver development in April or May.

Jan-Peter



Am 19.02.2018 um 11:59 schrieb David Sumbler:

As a newcomer to using Edition Engraver, and looking at the example
files etc., I wondered why they were written with so much
repetition.
   "Perhaps it is just to keep things easy for newcomers like me to
understand," I thought.

So I experimented with reformatting using braces as Lilypond does,
which seemed the method most likely method.  For instance,

\editionMod test 1 0/4 Voice \(
\editionMod test 1 1/4 Lyrics #(make-music 'ExtenderEvent)
\editionMod test 1 2/8 Voice [
\editionMod test 2 0/4 Score \time 3/4
\editionMod test 2 0/4 Score \tempo "Allegro&q

Re: A couple of questions about Edition Engraver

2018-02-19 Thread Jan-Peter Voigt

Hi David,

Urs already answered. I understand your concerns about the input and I 
am always open for ideas to ease the input for the edition-engraver. 
Like Urs already mentioned your proposal will be difficult to implement 
because it doesn't use the standard parser schemes. But it sheds light 
on how others might expect an easy/consistent input.


What is not explained in the demo files (yet) is: You are always free to 
use constructs like


\editionMod test 1 0/4 Voice {
  <>(
  \once \override NoteHead.color = #red
  \once \override Beam.color = #red
}

To address multiple time steps at once you can use \editionModList, to 
address multiple contexts at once you can use regular expressions and 
wildcards like in 
https://github.com/openlilylib/edition-engraver/blob/master/usage-examples/development-3.ly


Your example implies that it would be a useful feature if one can split 
timing and context information into several layers. I'll think about it.


I am going to focus on the edition-engraver development in April or May.

Jan-Peter


Am 19.02.2018 um 11:59 schrieb David Sumbler:

As a newcomer to using Edition Engraver, and looking at the example
files etc., I wondered why they were written with so much repetition.
  "Perhaps it is just to keep things easy for newcomers like me to
understand," I thought.

So I experimented with reformatting using braces as Lilypond does,
which seemed the method most likely method.  For instance,

\editionMod test 1 0/4 Voice \(
\editionMod test 1 1/4 Lyrics #(make-music 'ExtenderEvent)
\editionMod test 1 2/8 Voice [
\editionMod test 2 0/4 Score \time 3/4
\editionMod test 2 0/4 Score \tempo "Allegro" 4=135
\editionMod test 2 0/4 Voice \p
\editionMod test 2 0/4 Voice \<
\editionMod test 2 1/4 Lyrics #(make-music 'HyphenEvent)

might become

\editionMod test {
   1 {
 0/4 Voice \(
 1/4 Lyrics #(make-music 'ExtenderEvent)
 2/8 Voice [
 }
   2 {
 0/4 {
   Score {
\time 3/4
\tempo "Allegro" 4=135
   }
   Voice {
         \p
         \<
       }
 }
 1/4 Lyrics #(make-music 'HyphenEvent)
   }
}

This is much clearer to me, and it would potentially be much easier to
find one's way around the file for maintenance and the addition of new
items.  I appreciate that one might not necessarily want all entries in
the order they appear in the score.

Unfortunately, what I wrote doesn't work.

Is there any likelihood that something similar to what I have suggested
might be added to Edition Engraver in the forseeable future?

And how near are we to seeing Edition Engraver included in Lilypond
itself?

David

___
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: Function or command to omit only certain accidentals of a chord?

2018-02-02 Thread Jan-Peter Voigt

Am 02.02.2018 um 17:55 schrieb David Kastrup:

Jan-Peter Voigt <jp.vo...@gmx.de> writes:


Hello Harm, Stéfano,

I always underestimate the usability of before/after-line-breaking ...
Based on Harms code I scratched a music-function to conditionally omit
the accidental. This one can be used with the EE.
It smells a bit hacky, but it seems to work and is extendable for
other use cases.


I think it would make a whole lot more sense to teach the Edition
Engraver how to mark/identify and tweak single items.


+1
I will do so when time allows!
The presented function was just a try to help out until I have (or 
someone else) done that.



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


Re: Function or command to omit only certain accidentals of a chord?

2018-02-02 Thread Jan-Peter Voigt

Hello Harm, Stéfano,

I always underestimate the usability of before/after-line-breaking ...
Based on Harms code I scratched a music-function to conditionally omit 
the accidental. This one can be used with the EE.
It smells a bit hacky, but it seems to work and is extendable for other 
use cases.


HTH
Jan-Peter

Am 01.02.2018 um 22:49 schrieb Thomas Morley:

2018-02-01 16:59 GMT+01:00 Stefano Troncaro :


Ideally, I wanted a function
that I could use with the edition-engraver to tweak target elements inside
chords. I framed the question around accidentals in the post above, but
ultimately I hoped to be able to use the same function (or a very similar
one) to tweak ties of specific notes instead of being forced to use one
override for the whole chord, or to tweak other properties of specific notes
should the need arise.

Well, we have
(1) override.
Aplied to a chord it will work on all relevant grobs found.
One could define some selection, ofcourse.
Like:
command =
\override NoteHead.before-line-breaking =
   #(lambda (grob)
 (let* ((cause (ly:grob-property grob 'cause))
(pitch (ly:prob-property cause 'pitch))
(alteration (ly:pitch-alteration pitch))
(accidental (ly:grob-object grob 'accidental-grob)))
 (if (and (ly:grob? accidental) (eqv? alteration 1/2))
 (ly:grob-set-property! accidental 'stencil #f

But you wrote you would prefer to address specific notes, not the whole chord.
Therefore we have:

(2) tweak
But you didn't like the already proposed
\single \omit Accidental
which _is_ a tweak

(3) context-properties
basically accidentalStayle sets context-properties.
But ofcourse can't change other note-head-properties as you seem to like.


So I'm at a loss guessing what you desire.


Cheers,
   Harm

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


\version "2.19.80"
\include "oll-core/package.ily"
\loadPackage edition-engraver

\consistToContexts #edition-engraver Voice.Staff.Score

condGrobTweak =
#(define-music-function (use_octave pred_pitch grob_proc)((boolean? #f) ly:pitch? procedure?)
   (let ((pred_note (ly:pitch-notename pred_pitch))
 (pred_alteration (ly:pitch-alteration pred_pitch))
 (pred_octave (ly:pitch-octave pred_pitch)))
 #{
   \override NoteHead.before-line-breaking =
   #(lambda (grob)
  (let* ((cause (ly:grob-property grob 'cause))
 (pitch (ly:prob-property cause 'pitch))
 (note (ly:pitch-notename pitch))
 (alteration (ly:pitch-alteration pitch))
 (octave (ly:pitch-octave pitch)))
(if (and (eqv? alteration pred_alteration)
 (eqv? note pred_note)
 (or (not use_octave)(eqv? octave pred_octave)))
(grob_proc grob
 #}))
#(define (omit-accidental grob)
   (let ((accidental (ly:grob-object grob 'accidental-grob)))
 (if (ly:grob? accidental)
 (ly:grob-set-property! accidental 'stencil #f)
 )))

\addEdition accidentals
\editionMod accidentals 1 0/4 Voice \once \condGrobTweak gis #omit-accidental

{  }

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


Re: Function or command to omit only certain accidentals of a chord?

2018-02-02 Thread Jan-Peter Voigt

Hello Harm, Stéfano,

I always underestimate the usability of before/after-line-breaking ...
Based on Harms code I scratched a music-function to conditionally omit 
the accidental. This one can be used with the EE.
It smells a bit hacky, but it seems to work and is extendable for other 
use cases.


HTH
Jan-Peter

Am 01.02.2018 um 22:49 schrieb Thomas Morley:

2018-02-01 16:59 GMT+01:00 Stefano Troncaro :


Ideally, I wanted a function
that I could use with the edition-engraver to tweak target elements inside
chords. I framed the question around accidentals in the post above, but
ultimately I hoped to be able to use the same function (or a very similar
one) to tweak ties of specific notes instead of being forced to use one
override for the whole chord, or to tweak other properties of specific notes
should the need arise.


Well, we have
(1) override.
Aplied to a chord it will work on all relevant grobs found.
One could define some selection, ofcourse.
Like:
command =
\override NoteHead.before-line-breaking =
   #(lambda (grob)
 (let* ((cause (ly:grob-property grob 'cause))
(pitch (ly:prob-property cause 'pitch))
(alteration (ly:pitch-alteration pitch))
(accidental (ly:grob-object grob 'accidental-grob)))
 (if (and (ly:grob? accidental) (eqv? alteration 1/2))
 (ly:grob-set-property! accidental 'stencil #f

But you wrote you would prefer to address specific notes, not the whole chord.
Therefore we have:

(2) tweak
But you didn't like the already proposed
\single \omit Accidental
which _is_ a tweak

(3) context-properties
basically accidentalStayle sets context-properties.
But ofcourse can't change other note-head-properties as you seem to like.


So I'm at a loss guessing what you desire.


Cheers,
   Harm

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



\version "2.19.80"
\include "oll-core/package.ily"
\loadPackage edition-engraver

\consistToContexts #edition-engraver Voice.Staff.Score

condGrobTweak =
#(define-music-function (use_octave pred_pitch grob_proc)((boolean? #f) ly:pitch? procedure?)
   (let ((pred_note (ly:pitch-notename pred_pitch))
 (pred_alteration (ly:pitch-alteration pred_pitch))
 (pred_octave (ly:pitch-octave pred_pitch)))
 #{
   \override NoteHead.before-line-breaking =
   #(lambda (grob)
  (let* ((cause (ly:grob-property grob 'cause))
 (pitch (ly:prob-property cause 'pitch))
 (note (ly:pitch-notename pitch))
 (alteration (ly:pitch-alteration pitch))
 (octave (ly:pitch-octave pitch)))
(if (and (eqv? alteration pred_alteration)
 (eqv? note pred_note)
 (or (not use_octave)(eqv? octave pred_octave)))
(grob_proc grob
 #}))
#(define (omit-accidental grob)
   (let ((accidental (ly:grob-object grob 'accidental-grob)))
 (if (ly:grob? accidental)
 (ly:grob-set-property! accidental 'stencil #f)
 )))

\addEdition accidentals
\editionMod accidentals 1 0/4 Voice \once \condGrobTweak gis #omit-accidental

{  }

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


Re: Function or command to omit only certain accidentals of a chord?

2018-02-02 Thread Jan-Peter Voigt

Hello Harm, Stéfano,

I always underestimate the usability of before/after-line-breaking ...
Based on Harms code I scratched a music-function to conditionally omit 
the accidental. This one can be used with the EE.
It smells a bit hacky, but it seems to work and is extendable for other 
use cases.


HTH
Jan-Peter

Am 01.02.2018 um 22:49 schrieb Thomas Morley:

2018-02-01 16:59 GMT+01:00 Stefano Troncaro :


Ideally, I wanted a function
that I could use with the edition-engraver to tweak target elements inside
chords. I framed the question around accidentals in the post above, but
ultimately I hoped to be able to use the same function (or a very similar
one) to tweak ties of specific notes instead of being forced to use one
override for the whole chord, or to tweak other properties of specific notes
should the need arise.


Well, we have
(1) override.
Aplied to a chord it will work on all relevant grobs found.
One could define some selection, ofcourse.
Like:
command =
\override NoteHead.before-line-breaking =
   #(lambda (grob)
 (let* ((cause (ly:grob-property grob 'cause))
(pitch (ly:prob-property cause 'pitch))
(alteration (ly:pitch-alteration pitch))
(accidental (ly:grob-object grob 'accidental-grob)))
 (if (and (ly:grob? accidental) (eqv? alteration 1/2))
 (ly:grob-set-property! accidental 'stencil #f

But you wrote you would prefer to address specific notes, not the whole chord.
Therefore we have:

(2) tweak
But you didn't like the already proposed
\single \omit Accidental
which _is_ a tweak

(3) context-properties
basically accidentalStayle sets context-properties.
But ofcourse can't change other note-head-properties as you seem to like.


So I'm at a loss guessing what you desire.


Cheers,
   Harm

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



\version "2.19.80"
\include "oll-core/package.ily"
\loadPackage edition-engraver

\consistToContexts #edition-engraver Voice.Staff.Score

condGrobTweak =
#(define-music-function (use_octave pred_pitch grob_proc)((boolean? #f) ly:pitch? procedure?)
   (let ((pred_note (ly:pitch-notename pred_pitch))
 (pred_alteration (ly:pitch-alteration pred_pitch))
 (pred_octave (ly:pitch-octave pred_pitch)))
 #{
   \override NoteHead.before-line-breaking =
   #(lambda (grob)
  (let* ((cause (ly:grob-property grob 'cause))
 (pitch (ly:prob-property cause 'pitch))
 (note (ly:pitch-notename pitch))
 (alteration (ly:pitch-alteration pitch))
 (octave (ly:pitch-octave pitch)))
(if (and (eqv? alteration pred_alteration)
 (eqv? note pred_note)
 (or (not use_octave)(eqv? octave pred_octave)))
(grob_proc grob
 #}))
#(define (omit-accidental grob)
   (let ((accidental (ly:grob-object grob 'accidental-grob)))
 (if (ly:grob? accidental)
 (ly:grob-set-property! accidental 'stencil #f)
 )))

\addEdition accidentals
\editionMod accidentals 1 0/4 Voice \once \condGrobTweak gis #omit-accidental

{  }

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


  1   2   3   4   5   6   >