Hi Frèdèric,

> I would be interested to export music to epub 3 with music support,
> i.e. ebook that can be (re)-formated in the ebook reader. I understand
> it by-passes a lot of lilypond that aims at printing beautiful music
> sheets but in some cases, it would be really useful to have a lot of
> scores in an ebook reader and it would be too bad to have to use
> another language than the wonderful lilypond language.

so the goal here is to be able to view scores on an e-book-Reader? If you 
create scores for 
specific hardware why not create a pdf tailored for that screen size?

> I searched a little bit and it seems that epub 3 can handle music
> encoded as musci XML. I understood that Frescobaldi can export
> experimentally to MusicXML but not directly to epub.

Why would you think so? epub 3 does not natively support musicXML afaik, the 
most you could 
do is embed musicXML as a custom object to be used with very specific software 
that knows to 
handle it. Having musicXML in epub would mean that every ebook-reader out there 
would need 
to handle notation, which is quite a complex topic. Your ebook reader most 
likely has no idea 
what to do with musicXML.

I have implemented a system for exporting musicXML from Lilypond:
https://codeberg.org/tinapetzel/ly-mxml[1]

If you really want to go that route one could very well write a script that 
takes musicXML-output 
and embeds it into an epub.

But

1. It will probably not work as you think it would
2. Motivation to maintain it will probably quite low

> I wonder if there is any plan to work on this topic as final users or
> as developers.

I am 99.9% sure that the very clear reply to this is no, for aforementioned 
reasons. musicXML-
export is to some sense critical, since it is a blocker for people who need it 
for interoperability. 
This ... like, I can imagine there being some publishers out there that may 
store scores in epub for 
very custom production flows, but this is totally irrelevant for pretty much 
anyone.

If you really want to tackle your goal to have scores on e-reader — simplest 
thing to do would be 
(as said) to use a PDF tailored towards that e-reader. If you want to support 
multiple sizes, you 
could do something like lilypond-book does and split the score into individual 
systems and have 
the ebook reader do the pagination.

But then, this would need to assume a specific line-width. What you actually 
want to have in a 
dynamic setting is for the software to not just do pagination but also 
calculate line-breaks for the 
current page-width.

But this in music notation is much harder than in linear text. So again, to do 
this properly you’d 
need to have actual score rendering capabilities in your e-book-reader software.

But what could be done is to use an @media or @container CSS3 query to 
dynamically select 
versions of the same score with different line-widths.

This too comes with some caveats:

- It requires multiple renderings of the same score
- The CSS3 queries will not be supported by legacy ebook readers
- Tracking position when the page size changes may not work out perfectly

Anyway, I have sketched up a bash script that does exactly that at

https://codeberg.org/tinapetzel/ly-scorepub[2]

which (if pointed to a Lilypond file) would produce something like

https://codeberg.org/tinapetzel/ly-scorepub/raw/branch/main/examples/mahler.epub[3]

which (in a compatible reader) should dynamically adjust the line width.

Cheers,
Tina



--------
[1] https://codeberg.org/tinapetzel/ly-mxml
[2] https://codeberg.org/tinapetzel/ly-scorepub
[3] 
https://codeberg.org/tinapetzel/ly-scorepub/raw/branch/main/examples/mahler.epub

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to