<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>For embedding audio files in a pdf using LaTeX, I would start by looking at media9, as suggested on TeX StackExchange (<a href="https://tex.stackexchange.com/questions/89706/audio-examples-in-phonetics-project/89741#89741">https://tex.stackexchange.com/questions/89706/audio-examples-in-phonetics-project/89741#89741</a>).  I haven't played with it to see whether it can embed midi directly, but it looks promising. <br><br><div><span style="background-color: rgba(255, 255, 255, 0);">✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝<br>Br. Samuel, OSB</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">(R. Padraic Springuel)</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">St. Anselm's Abbey </span></div><div><span style="background-color: rgba(255, 255, 255, 0);">4501 South Dakota Ave, NE</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Washington, DC, 20017</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">202-269-2300</span></div><div><span style="background-color: rgba(255, 255, 255, 0);">(c) 202-674-1682</span></div><div>PAX ☧ ΧΡΙΣΤΟΣ</div></div><div><br>On Jul 30, 2018, at 1:20 PM, <a href="mailto:liebrecht@grossmann-venter.com">liebrecht@grossmann-venter.com</a> wrote:<br><br></div><blockquote type="cite"><div><span>Urs,</span><br><span>There are several ways to implement this and I already drawn it out using Lazarus, but I agree that doing it native to TeX as far as possible would be really preferable.</span><br><span>In the end Knuth always wins.</span><br><span></span><br><span>Since you asked; I can explain the scenario of use like this.</span><br><span>--------------------------------------------------------------</span><br><span></span><br><span>Assume someone is giving a lecture by electronic means, meaning an LCD projector and laptop.</span><br><span>Currently you have to display the sheetmusic and sometimes just a a few bars independently from text which is painful distracting switching on the screen, or you literally have to go paste sheetmusic images into a word or such document which is really really, I mean really stupid or have to deal with the usually troublesome image import with floats in LaTeX which is preferable but out of the reach of the general regular person which makes up the majority of mousepushing users.</span><br><span>(but thank heavens I now have lyluatex and it makes this mess described unnecessary )</span><br><span></span><br><span>Then usually you even have to have separate music files to play sound separate from the document and the sheetmusic. This now creates enormous acrobatics for an already stressed out presenter with a person dedicated to do the document/sheetmusic/snippets of bars of music/sound for you while you give the presentation or you have to drag a piano into the conference room to play the examples yourself</span><br><span>(with compromise usually). It is damn awful! We all saw it and how it usually goes wrong during seminars and such.</span><br><span></span><br><span>What I envisaged in my original mail is ONE documewnt of which lyluatex already does 2/3 of the topics above.</span><br><span>All that is needed is a player that can be activated on the notation. the presenter then has everything in one document and can just play the parts right in the documents as they come up.</span><br><span>As an added benefit, the audience can take a copy of the document with and replay the entire thing complete at their leisure.</span><br><span></span><br><span>This will solve the current madness.</span><br><span></span><br><span>I use a lot of professional Symphony VST's like for example Miroslav Symphony and it is enormously good.</span><br><span>It is really a piece of cake to implement the midi interfaces to these professional vsts and to adapt the current midi implementation to work with these VSTs.</span><br><span></span><br><span>I spent the last 3 years begging Notion to just include text in their great software, but they cant see the benefit. They absolutely want to do scores only period.</span><br><span></span><br><span>So, luLaTeX is probably the only hope to get something like this realized, but I will do it with Lazarus+luLaTeX+Custom-midi-drivers  as it is the easiest way for me to implement the changes to midi interfacing with professional VSTs. I see a bit of a learning curve for me doing all that with TeX but it would be preferable if possible and the real TeX-heads are seriously resourceful people that can perform magic that will take me longer with TeX.</span><br><span></span><br><span>So I can think you see the current dilemma and the obvious solution which lyLuaTeX is already 70% of the solution. (if only mousepushers can be converted to use a computer for what it was intended for)</span><br><span></span><br><span>Knuth should at least get the Nobel prize in my opinion although he deserves way more.</span><br><span>After 15 years since buying the books, I still fight my way through "The Art Of Computer Programming" which is always helpful and never outdated.</span><br><span></span><br><span></span><br><span></span><br><span></span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>I am really thankful that you guys did this.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Now if only you have a midi interface that could play the Notation</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>in the document by means of player buttons, but I understand that</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>doesnt exist yet.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Frescobaldi does that, but unfortunately cannot add text inline to</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>scores creating a document.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I might want to create such a frontend for lyluatex.</span><br></blockquote></blockquote><blockquote type="cite"><span>A solution to this is probably not that far-fetched, but in order to</span><br></blockquote><blockquote type="cite"><span>get there you have to either get to a clear understanding of what you</span><br></blockquote><blockquote type="cite"><span>want to achieve or - if you actually have that - communicate it</span><br></blockquote><blockquote type="cite"><span>clearly so we all know where we want to get. I think you have a very</span><br></blockquote><blockquote type="cite"><span>valid use case here that would be good to support.</span><br></blockquote><blockquote type="cite"><span>I *think* what you will want is to have the score examples accompanied</span><br></blockquote><blockquote type="cite"><span>by *links* (in whatever graphical form, as plain text links or as</span><br></blockquote><blockquote type="cite"><span>fancy graphic buttons). These links should point to either the MIDI</span><br></blockquote><blockquote type="cite"><span>files created by LilyPond, *or* to audio files that have been</span><br></blockquote><blockquote type="cite"><span>generated from these MIDI files in advance. I can think of no other</span><br></blockquote><blockquote type="cite"><span>suitable concept of having a "document" play back the score examples.</span><br></blockquote><blockquote type="cite"><span>If I'm missing anything please correct me.</span><br></blockquote><blockquote type="cite"><span>Here's what has to be done to achieve that goal. Please create an</span><br></blockquote><blockquote type="cite"><span>issue at <a href="https://github.com/jperon/lyluatex/issues">https://github.com/jperon/lyluatex/issues</a> and copy as much</span><br></blockquote><blockquote type="cite"><span>information as possible/useful from this thread. I would not want to</span><br></blockquote><blockquote type="cite"><span>continue discussion here because it really isn't a "luatex" issue but</span><br></blockquote><blockquote type="cite"><span>relates to lyluatex and LilyPond directly:</span><br></blockquote><blockquote type="cite"><span>    * lyluatex has to make LilyPond also produce the MIDI files beside</span><br></blockquote><blockquote type="cite"><span>the scores.</span><br></blockquote><blockquote type="cite"><span>This has not been implemented yet, but should be a minor thing to do</span><br></blockquote><blockquote type="cite"><span>(and as said, I find this a valuable use case)     * lyluatex will then</span><br></blockquote><blockquote type="cite"><span>(automatically) produce poth a <unique-hash-name>.pdf and a</span><br></blockquote><blockquote type="cite"><span><same-unique-hash-name>.midi file in the cache directory</span><br></blockquote><blockquote type="cite"><span>     * With the 'raw-pdf' option lyluatex will return that calculated</span><br></blockquote><blockquote type="cite"><span>base name instead of directly including the score as an image.</span><br></blockquote><blockquote type="cite"><span>    * From there you can create a macro that will include the image and</span><br></blockquote><blockquote type="cite"><span>create a link to the midi file.</span><br></blockquote><blockquote type="cite"><span>This can be done with standard LaTeX means</span><br></blockquote><blockquote type="cite"><span>    * Or you can add a hook in between to call another external program</span><br></blockquote><blockquote type="cite"><span>to generate the corresponding audio file and link to that.</span><br></blockquote><blockquote type="cite"><span>This would probably be (much) easier to program in Lua, since Lua is</span><br></blockquote><blockquote type="cite"><span>present anyway.</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>I will take your concerns noted below seriously.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>It is just difficult to figure out the differences between</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>luatex, lyluatex, lualatex and which interfaces with lillypond for</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>someone new to luatex (I am an old-time LaTeX/TeX user though )</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>So I will step on your toes for a while unintentionally.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Are you going to remove lyluatex.tex file in future ?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>The reason I ask is that I want to learn lyluatex by studying the</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>code creating the manual, so I will have to add all the other</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>packages in the headers of the TeX file.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>If I am not supposed to have it let me know, but the manual does</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>EXACTLY what I want so it THE example file for me. It has everything</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>by design.</span><br></blockquote></blockquote><blockquote type="cite"><span> This last assumption is on spot.</span><br></blockquote><blockquote type="cite"><span>And no, we're not going to remove that file.</span><br></blockquote><blockquote type="cite"><span>In the development repository we author the manual in a Markdown file,</span><br></blockquote><blockquote type="cite"><span>and it is compiled through Pandoc. But the make rule for producing the</span><br></blockquote><blockquote type="cite"><span>CTAN upload the Markdown file is compiled to the corresponding .tex</span><br></blockquote><blockquote type="cite"><span>file. So that lyluatex.tex file is an official part of the CTAN</span><br></blockquote><blockquote type="cite"><span>package (and I would assume that it is also copied *somewhere* into</span><br></blockquote><blockquote type="cite"><span>your texlive installation).</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>If I am allowed to use it and you have the time and patience...</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>1) Are only the packages listed n the header needed to compile the</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>manual ?</span><br></blockquote></blockquote><blockquote type="cite"><span>You should also look into the the lyluatex.sty file since that also</span><br></blockquote><blockquote type="cite"><span>loads a number of packages. But AFAIK there are no *special* packages</span><br></blockquote><blockquote type="cite"><span>needed that aren't available in regular TeX Live (I just don't know</span><br></blockquote><blockquote type="cite"><span>what happens if you haven't installed texlive-full).</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>2) Are there any other unforseen issues compiling it you know of</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>that could save me time before I delve into it myself ?</span><br></blockquote></blockquote><blockquote type="cite"><span>From what I can see in your communications I'm not 100% confident you</span><br></blockquote><blockquote type="cite"><span>have set up LilyPond properly already.</span><br></blockquote><blockquote type="cite"><span>lyluatex does its work by calling LilyPond as an external command, so</span><br></blockquote><blockquote type="cite"><span>that has to be a) installed and b) found by lyluatex.</span><br></blockquote><blockquote type="cite"><span>If you don't have a working environment I suggest downloading the</span><br></blockquote><blockquote type="cite"><span>current development version from <a href="http://lilypond.org/development.html">http://lilypond.org/development.html</a></span><br></blockquote><blockquote type="cite"><span>(they are not at all "unstable" in the case of LilyPond) and</span><br></blockquote><blockquote type="cite"><span>installing it (I don't know what OS you are having).</span><br></blockquote><blockquote type="cite"><span>If you are on a UNIX OS and can run "lilypond --version" after the</span><br></blockquote><blockquote type="cite"><span>installation everything should be fine, but if you have to specify any</span><br></blockquote><blockquote type="cite"><span>other command line you have to provide this to lyluatex through the</span><br></blockquote><blockquote type="cite"><span>[program={path/to/lilypond/executable}] option.</span><br></blockquote><blockquote type="cite"><span>If you still have errors after that please report with more details -</span><br></blockquote><blockquote type="cite"><span>we have tried to make the error handling as informative as possible -</span><br></blockquote><blockquote type="cite"><span>but do so on the lyluatex issue tracker, not here.</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>This is possibly the best music typeset software that I have seen in</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>my life.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I cannot think of anything that can beat it.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Enormous !!!</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Hope the Universities at least will use it and stop teaching people</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>to be Joe-mousepusher.</span><br></blockquote></blockquote><blockquote type="cite"><span>Having literally spent years with this topic I can't give you too much</span><br></blockquote><blockquote type="cite"><span>hope about this :-(</span><br></blockquote><blockquote type="cite"><span>Best</span><br></blockquote><blockquote type="cite"><span>Urs</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>Thanks</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>On 2018-07-29 12:28, Urs Liska wrote:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Am 29.07.2018 um 17:59 schrieb <a href="mailto:liebrecht@grossmann-venter.com">liebrecht@grossmann-venter.com</a>:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>a) Ok good to know that explains the compiling problems</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>fundamentally.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>If the manual were a lyluatex file it would have been one of the</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>greatest tutorials right there.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>What I tried to compile is the manual in the zip download here</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>"<a href="https://ctan.org/pkg/lyluatex?lang=en">https://ctan.org/pkg/lyluatex?lang=en</a>" [1]</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Which seemed to be the  lyluatex code, but I am seemingly mistaken.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>No, you're not mistaken. I wasn't aware of the fact that the script</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>preparing the CTAN upload actually produced that lyluatex.tex file.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>b) Ok</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>c) Ok I saw that, but where that was mentioned there was no direct</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>compile instruction. The option --shell-escape was mentioned in the</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>body text and there was no direct compile command.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>If</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>"lualatex --shell-escape somefile.tex"</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>were in the instructions I did not have to ask this question, but it</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>is absent.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Would be a good idea to add that.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I'll try to keep that in mind. It would be great if you could open</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>an</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>issue on the Github issue tracker at</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span><a href="https://github.com/jperon/lyluatex/issues">https://github.com/jperon/lyluatex/issues</a> about it.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Question:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>1) Since I cannot compile the manual and use that to learn lyluatex,</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>(my preferred latex way to learn is just to work through the code</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>compiling the manual. (Last 20+ more years taught me that is by far</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>the best way.)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Is there an indepth lyluatex manual that is compilable with luatex ?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>This .tex file *is* compilable with lualatex (not luatex!).</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Please first try the other things I told you about, and if that</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>doesn't work please post more details about the errors. But this is</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>not a luatex issue, so this list may not be right place to discuss.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Please either subscribe to the lilypond-user mailing list or open an</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>issue on the issue tracker.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>2) Is there an archive with lots of lyluatex document examples</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>combining both text and musical notaion in the document ?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>lyluatex is actually brand new, so there is no such archive (yet).</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>HTH</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Urs</span><br></blockquote></blockquote><blockquote type="cite"><span>Links:</span><br></blockquote><blockquote type="cite"><span>------</span><br></blockquote><blockquote type="cite"><span>[1] <a href="https://ctan.org/pkg/lyluatex?lang=en">https://ctan.org/pkg/lyluatex?lang=en</a></span><br></blockquote></div></blockquote></body></html>