> ---------- Forwarded message ---------- > From: Flaming Hakama by Elaine <[email protected]> > To: lilypond-devel <[email protected]> > Cc: > Bcc: > Date: Tue, 31 May 2022 14:02:51 -0700 > Subject: what does it take to produce a new output block > Hi, > > I am interesting in seeing what it would take to enhance lilypond to output > in this text format > > https://www.irealpro.com/ireal-pro-file-format > > My first idea would be to add something along the lines of the midi block, > where if you add this new output, you will get output in this text format, > which is essentially an HTML link. > > \score { > … music … > \layout { } > \midi { } > \ireal { } > } > > > I suppose it should support similar features for command line and scheme: > > -direal-extension=html > #(ly:set-option 'ireal-extension "html") > > > To look into implementing this, where would I get started? > > Is there any documentation that describes what exactly is a block, what it > takes as input, etc.? > > Where would I find the code for the layout and midi blocks? > > > Thanks, > > Elaine > > > > > ---------- Forwarded message ---------- > From: Jean Abou Samra <[email protected]> > To: Flaming Hakama by Elaine <[email protected]>, lilypond-devel < > [email protected]> > Cc: > Bcc: > Date: Tue, 31 May 2022 23:24:44 +0200 > Subject: Re: what does it take to produce a new output block > Hi, > > A minor point of procedure: even though you changed the subject, it > appears that you started this thread from a previous thread about time > signatures in your email client. The email contains headers that make it > appear in that thread for others. In the future, start a new thread > every time. > > > Le 31/05/2022 à 23:02, Flaming Hakama by Elaine a écrit : > > Hi, > > > > I am interesting in seeing what it would take to enhance lilypond to > output > > in this text format > > > > https://www.irealpro.com/ireal-pro-file-format > > > > My first idea would be to add something along the lines of the midi > block, > > where if you add this new output, you will get output in this text > format, > > which is essentially an HTML link. > > > > \score { > > … music … > > \layout { } > > \midi { } > > \ireal { } > > } > > > > > > I suppose it should support similar features for command line and scheme: > > > > -direal-extension=html > > #(ly:set-option 'ireal-extension "html") > > > > > > To look into implementing this, where would I get started? > > > > I would start by writing Scheme engravers living in \layout > that take the content and format it together. The only disadvantage > is that won't have ireal output without at the same time doing > layout output (well, unless you go for calling (exit) at the > end of the translation step if that's really a problem ...). > The big advantage is that you can start doing this right now > in a .ly file, without touching LilyPond's code at all, post > it on the user list and get feedback. > > There is no official documentation for engravers, but there > is an unofficial resource (by me): > > https://extending-lilypond.readthedocs.io/en/latest/translation.html > > > > > Is there any documentation that describes what exactly is a block, what > it > > takes as input, etc.? > > > Well, LilyPond doesn't really have a notion of a "block". > The objects you create with \midi and \layout are called > "output definitions" (output defs for shorts), a category > which actually also encompasses \paper blocks. I guess the > closest you get as documentation about output defs is > > > https://lilypond.org/doc/v2.23/Documentation/notation/modifying-context-plug_002dins.html > > but this is not really descriptive of the internals, and > I don't think it needs to be: output defs are an overarching > concept where many tweaks take place; the way these tweaks > are arranged internally isn't really relevant to the user. > > Most importantly, \layout and \midi are hardcoded. You > cannot create you own type of "block" without touching > the C++ sources. > > > > > Where would I find the code for the layout and midi blocks? > > > A bit all over the place, really. lily/lexer.ll and lily/parser.hh > have the parsing logic, with some bits in lily/lily-lexer.cc > and lily/lily-parser.cc. The Output_def class is found in > lily/output-def.cc. The Scheme interfaces for manipulating > it are in lily/output-def-scheme.cc. A central element of output > defs is context defs (the \context blocks); that class is > in lily/context-def.cc with Scheme interfaces in > lily/context-def-scheme.cc. Then you have files like > lily/engraver.cc, lily/score-engraver.cc, lily/performer.cc, > lily/score-performer.cc which define the classes of > translators that \layout and \midi respectively run. > > But as I said above, I don't think the code for \layout > and \midi is the most relevant part of LilyPond to > look at for solving your problem, at least until you get > to a state where it's working fully and you want to contribute > it to LilyPond with that kind of interface. Start with > learning how to code an engraver first. > > Best, > Jean > > > Thanks, this is very helpful.
