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 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.  There never is any linear
representation being "executed", and source files are interpreted rather
than compiled, with no file-level representation ever being explicit.

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.

-- 
David Kastrup



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




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jacques Menu
Hello Thomas,

> Le 7 oct. 2021 à 22:51, Thomas Morley  a écrit :
> 
> 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.

Were the bad results due to 1-4 essentially, or were a and b part of the 
quality problem?

JM




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread Jean Abou Samra




Le 07/10/2021 à 22:51, Thomas Morley a écrit :

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



I thought these two were equivalent — aren't they?



(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.



If you want my take: Jan-Peter's. Translators are the
only reliable way to get all special timing right (lyrics,
quoted music, combined parts, etc.) without a lot of code
duplication with iterators.

Best,
Jean



Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread 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-07 Thread 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



Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread Peter Toye
Thanks very much Harm, but as I no longer need it, I shan't go ahead. If I need 
it later I'll resurrect this thread.
 
The reason I like Jan-Peter's approach is that it appears to abstract the music 
from the details of presentation. But I've not looked into it much. 


Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-
Thursday, October 7, 2021, 10:46:44 AM, Thomas Morley wrote:

> Am Do., 7. Okt. 2021 um 11:30 Uhr 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?

> Not sure Jan-Peter's approach is the best method ...
> Anyway, applying the following diff makes it work with recent versions
> (although you'll get a bunch of messages):

> ~/openlilylib/lilypond-export (master)$ git diff
> diff --git a/api.scm b/api.scm
> index 8307dc5..3bfa69a 100644
> --- a/api.scm
> +++ b/api.scm
> @@ -275,8 +275,8 @@
>           (let ((musicstep (ly:context-property context ctprop::export-step))
>                 (staff-id (ly:context-property context ctprop::staff-id))
>                 (voice-id (ly:context-property context ctprop::voice-id)))
> -           (ly:message "stem info ~A" (map car (ly:grob-properties grob)))
> -           (tree-set! musicstep `(,staff-id ,voice-id stem dir)
> (ly:grob-properties grob)) ;(ly:stem::calc-direction grob))
> +           (ly:message "stem info ~A" (map car
> (ly:grob-basic-properties grob)))
> +           (tree-set! musicstep `(,staff-id ,voice-id stem dir)
> (ly:grob-basic-properties grob)) ;(ly:stem::calc-direction grob))
>             ))
>          )


> Cheers,
>   Harm

Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread Peter Toye

Hello Jan-Peter,
 
As I wrote, my personal immediate need has now gone away.
 
Everyone seems to agree that some form of exchange mechanism between music 
engravers is needed, but there are many different exchange formats and with 
such a complex subject writing an exporter is a really heavy task. I can only 
admire and thank you for your work and hope it can continue. Let's hope that it 
can be done without too many people pulling in different directions. I wish I 
were able to help.


Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-

> Message: 2
> Date: Thu, 7 Oct 2021 11:49:29 +0200
> From: Jan-Peter Voigt 
> To: lilypond-user@gnu.org
> Subject: Re: Export from LilyPond to MusicXML (Thomas Morley)
> Message-ID: 
> Content-Type: text/plain; charset=utf-8

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




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread Thomas Morley
Am Do., 7. Okt. 2021 um 11:30 Uhr 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?

Not sure Jan-Peter's approach is the best method ...
Anyway, applying the following diff makes it work with recent versions
(although you'll get a bunch of messages):

~/openlilylib/lilypond-export (master)$ git diff
diff --git a/api.scm b/api.scm
index 8307dc5..3bfa69a 100644
--- a/api.scm
+++ b/api.scm
@@ -275,8 +275,8 @@
  (let ((musicstep (ly:context-property context ctprop::export-step))
(staff-id (ly:context-property context ctprop::staff-id))
(voice-id (ly:context-property context ctprop::voice-id)))
-   (ly:message "stem info ~A" (map car (ly:grob-properties grob)))
-   (tree-set! musicstep `(,staff-id ,voice-id stem dir)
(ly:grob-properties grob)) ;(ly:stem::calc-direction grob))
+   (ly:message "stem info ~A" (map car
(ly:grob-basic-properties grob)))
+   (tree-set! musicstep `(,staff-id ,voice-id stem dir)
(ly:grob-basic-properties grob)) ;(ly:stem::calc-direction grob))
))
 )


Cheers,
  Harm



Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-07 Thread 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

Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-06 Thread Jean Abou Samra

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



Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-05 Thread Peter Toye
Agreed, but it's possible that someone here might know more about this project 
and now it's getting on.


Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-
Tuesday, October 5, 2021, 12:53:43 PM, m.tarensk...@kpnmail.nl wrote:

> lilypond-to-musicxml export is a frequentlly asked, but easier said than 
> done, feature request, that pops up from time to time. And everytime it 
> doesn't reach a point beyond discussions and experimental or quite incomplete 
> implementations. Apparently both MusicXML and LilyPond are complex beasts - I 
> am not complaining.

> MT



> Verzonden vanaf mijn Huawei mobiele telefoon

Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-05 Thread m.tarensk...@kpnmail.nl
lilypond-to-musicxml export is a frequentlly asked, but easier said than done, feature request, that pops up from time to time. And everytime it doesn't reach a point beyond discussions and experimental or quite incomplete implementations. Apparently both MusicXML and LilyPond are complex beasts -  I am not complaining.MTVerzonden vanaf mijn Huawei mobiele telefoon

Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-05 Thread Peter Toye

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? It's something I will probably need soon.


Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-
Tuesday, September 28, 2021, 6:58:40 AM, lilypond-user-requ...@gnu.org wrote:


> --

> Message: 2
> Date: Tue, 28 Sep 2021 00:53:16 +0200
> From: Thomas Morley 
> To: Jacques Menu 
> Cc: "lilypond-user Mailing List (lilypond-user@gnu.org)"
>         , Dominique Fober 
> Subject: Re: Export from LilyPond to MusicXML
> Message-ID:
>         
> Content-Type: text/plain; charset="UTF-8"

> Hi Jacques,

> Am Mo., 27. Sept. 2021 um 00:48 Uhr schrieb Jacques Menu
> :


>> Hello folks,

>> The recent posts on this subject show there is interest in the matter. Sorry 
>> for the length of this one...

> Tbh, most of the mor detailed stuff is way over my head..


>> My work was initially homed by Grame’s libmusicxml2 library as an example of 
>> what it could be used for, in the lilypond branch at 
>> https://github.com/grame-cncm/libmusicxml/tree/lilypond.

>> Dom Fober, the author and maintainer of libmusicxml2, and I decided some 
>> time ago to separate things for practical reasons, and I now push to the 
>> GitHub repository I created at https://github.com/jacques-menu/musicformats.

> Good to know.

>> I’m currenly finalizing version 1.0.0, which explains why the test and 
>> master branches are not up to date - only the dev branch is currently.


>> The musicformats library is structured along the lines shown at page 16 in 
>> https://github.com/jacques-menu/musicformats/blob/dev/doc/maintainersGuideToMusicFormats/maintainersGuideToMusicformats.pdf
>>  (the users’s guide is not yet ‘usable’, sorry).

>> The central component of musicformats is MSR (Music Score Representation), 
>> from which various formats can be obtained.

>> In this picture, we see that we could create MusicXML output from within the 
>> LilyPond implementation going along the LilyPond - LPSR - MSR - MXSR  - 
>> MusicMXL path. The missing part would be the creation of an LPSR (LilyPond 
>> Score Representation), the others already exist.

>> As an example, the LPSR representation and LilyPond output produced by:

>> xml2ly basic/HelloWorld.xml -display-lpsr > LPSR_contents.txt 2>&1

>> are in the attached LPSR_contents.txt file.

>> The resulting score is:

>> Jean and I have had discussions as to how the export to MusicXML could be 
>> tackled on the LilyPond side, but nothing concrete yet. Some of the 
>> information needed is readily accessible inside LilyPond, but grabbing the 
>> remaining part is not easy.

>> The musicformats repository contains examples using the library to create 
>> scores in C++ applications, among them:

>> jacquesmenu@macmini: ~/musicformats-git-dev/files/musicxml > 
>> Mikrokosmos3Wandering -a
>> What Mikrokosmos3Wandering does:

>>     This multi-pass generator creates a textual representation
>>     of Zoltán Kodály's Mikrokosmos III Wandering score.
>>     It performs various passes depending on the output generated.

>>     Other passes are performed according to the options, such as
>>     displaying views of the internal data or printing a summary of the score.

>>     The activity log and warning/error messages go to standard error.

>> jacquesmenu@macmini: ~/musicformats-git-dev/files/musicxml > 
>> Mikrokosmos3Wandering -apropos generate
>> --- Help for atom "generate" in subgroup "Generated output"
>>     -generate, -gen GENERATED_OUTPUT_KIND
>>           Generate GENERATED_OUTPUT_KIND code to the output.
>>             The 5 generated output kinds available are:
>>             braille, guido, lilypond, midi and musicxml.
>>             The default is 'LilyPond output'.

>> (midi output is actually not yet available, though)

>> For example, one can run:

>> jacquesmenu@macmini: ~/musicformats-git-dev/files/musicxml > 
>> Mikrokosmos3Wandering -generate  musicxml  -o Mikrokosmos3Wandering.xml 
>> -trace=passes

>> %--
>>   Pass 1: Creating the MSR score with the functions
>> %--
>> *** MusicXML warning *** :91: The staffMeasuresSlicesSequence of staff 
>> "Part_OnlyPart_Staff_One" is null
>> *** MusicXML warning *** :91: The staffMeasuresSlicesSequence of staff 
>> "Part_OnlyPart_Staff_Two" is null

>> %--
>>   Pass 2: Convert the MSR score into a second MSR
>>