diff options
Diffstat (limited to '2020')
-rw-r--r-- | 2020/info/04.md | 280 | ||||
-rw-r--r-- | 2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt | 522 |
2 files changed, 406 insertions, 396 deletions
diff --git a/2020/info/04.md b/2020/info/04.md index 303cb2a0..e80e7518 100644 --- a/2020/info/04.md +++ b/2020/info/04.md @@ -1,7 +1,7 @@ # Music in Plain Text Jonathan Gregory -[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.webm" subtitles="/2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt"]] +[[!template id=vid vidid=mainVideo src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.webm" subtitles="/2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt"]] [Download compressed .webm video (13.8M)](https://mirror.csclub.uwaterloo.ca/emacsconf/2020/smaller/emacsconf-2020--04-music-in-plain-text--jonathan-gregory--vp9-q56-video-original-audio.webm) [View transcript](#transcript) @@ -68,113 +68,171 @@ No. <a name="transcript"></a> # Transcript -Hello, everyone, and welcome to the EmacsConf. I am Jonathan. In this -talk, I'm going to demonstrate ways of producing sheet music in Emacs -using Lilypond, and maybe also convince you to use Emacs for writing -your scores. I'll start with an overview of the syntax for those who -are new to using text-based notation as a shallow dive into the deep -pond of lilies and Lilypond, and move on to showcase some of its -functionalities using Org Mode and lilypond-mode. One disclaimer, -however: I am not a Lilypond developer. - -(00:40) So what is Lilypond? Lilypond is a file format and music engraving -system for producing high-quality sheet music. It translates textual -representations of music to graphical objects. It's similar to LaTeX -in that its input format describes the visual layouts of the score, -using commands to define musical expressions. Commands begin with a -backslash. For example, the formatter command, as shown on the left, -yields its graphical equivalents on the right, the fermata symbol over -the low B and so on and so forth. It's also fully extensible, like -Emacs, allowing users to extend and override Lilypond's -functionalities using the Scheme scripting language. It can be used -for early and contemporary music tablature, vocal music lead sheets, -and so on. Above all, it works with Emacs. In fact, Lilypond ships -with Emacs Lisp libraries, including a major mode for editing Lilypond -files. - -(01:47) So the input files are similar to source files. They contain -expressions formed with curly braces, comments that start with the -percent sign, and the code is indented. Notes are entered using -lowercase letters, and rests with the letter r. In this case, the -lowercase r or r4 is the equivalence of a crotchet or quarter note -rest. Durations are entered using numbers and dots after the note -name. If you do not specify one, the previous duration is used. You -can also tie notes together using the tilde symbol (~). In fact, you -can input chords, lyrics, embellishments, and a lot more. I encourage -you to read the manual for more information. Now let's switch to a -terminal window. With Lilypond installed, let's create a test file -with the extension .ly and open it in Emacs. - -(02:50) At the top of the file is the version statement, which tells Lilypond -which version to use when compiling the file. Here I'm using version -2.20.0. I've added the clef and time signature. Let's add some notes. -I'm going to close this now and compile the file by running lilypond -followed by the file name. So now let's view the output. Okay. - -(03:27) So here's a more complex example for randomizing note sequences. The -idea is to create new reading materials each time the code blocks are -evaluated. As usual, we begin with a header. I've added the title and -composer. Then we add the note sequences to use in the composition. In -this case, sn is a note name just like a b c d and so on, and stands -for snare drum, the percussion instruments. Now here's a function -that's going to shuffle the notes in the table. Finally, we expand the -notes inside the Lilypond source block. So whatever the function -returns is expanded inside the drums block. Now let's press C-c C-c to -view the results. Okay. And if I run this again, it should create a -new composition. Great. You can also audition a piece using the midi -command, which creates a midi file of the score. - -(04:34) Note also that the ob library-- sorry, the ob-lilypond library comes -with two modes. The one I'm using now is called arrange mode and is -useful for assembling complete scores. The basic mode on the other -hand allows you to mix text and music by embedding Lilypond snippets -and export them using typical Org Mode commands. - -(05:00) Now to demonstrate the basic mode in action. I'm going to export this -document to a PDF file. In this case, the :file header argument is -required, so you have to provide one and include the file name. Again, -you can run the code and view the results. Here it is. So now let's -export this to a PDF file. And here it is, what it generates. - -(05:39) Now I'm going to show you the workflow I used to produce music books -in Emacs, combining Lilypond and LaTeX for a perfect marriage. I begin -by sketching the first draft of the manuscript using pencil and paper. -Then I move to Emacs to input the notes in a git repository. This is a -typical source file. It begins with a stylesheet where I set variables -and layout settings, although in general, there's no need for tweaking -the layout unless you have specific requirements to do so. The easiest -way to compile the file from Emacs is by pressing C-c C-l, so let's do -this now, and the compilation buffer will tell you if there were any -errors in the file. Now to automate the process of compiling several -files and building the PDF, I use GNU Make, so all I have to do is -open the shell and run the make command. Don't worry, I'll provide a -link to the source code on the last slide. - -(06:41) As I moved forward with the project, I found at least two things -missing. One, I had no access to a metronome, at least not from the -editor, so I built one for casual use and made it available in the -MELPA repository. I also missed bar numbers in the source file. This -is useful when going back and forth between input and output files -without getting lost. So I wrote a command for toggling bar numbers, -which I hope you can see on the left. Also, some expressions are -difficult or slow to write on the keyboard-- accents and tuplets, for -example--so I use template expansion extensively for this purpose, -mainly yasnippet. - -(07:23) So what do I think? Well, I think Lilypond can be a -sharp paradigm shift for people used to GUI alternatives, but the -results are impressive. You don't have to dive too deeply to start -using Lilypond. Likewise, the ability to extend the software, I think, -is especially appealing for music professionals, enthusiasts, -composers, and the academic community: for example, allowing users to -create alternative notation systems required in non-Western music -traditions and other non-conventional requirements. Also, Lilypond and -Emacs both have extensive and well-written manuals and active -communities of users. But if you're still not sure where to start and -when to wedge your feet in the deep but warm pond of lilies, Lilypond, -and Lilypond users, I invite you to contribute to my Lilypond -projects, which you can do so from the links on the screen. So, thank -you all. I look forward to your comments, and I hope you enjoy the -rest of the conference. - -<!-- /transcript --> +[[!template new="1" text="Hello, everyone, and welcome to the EmacsConf." start="00:00:02.000" video="mainVideo" id=subtitle]] +[[!template text="I am Jonathan. In this talk," start="00:00:04.799" video="mainVideo" id=subtitle]] +[[!template text="I'm going to demonstrate ways of producing sheet music in Emacs" start="00:00:06.631" video="mainVideo" id=subtitle]] +[[!template text="using Lilypond, and maybe also convince you" start="00:00:10.880" video="mainVideo" id=subtitle]] +[[!template text="to use Emacs for writing your scores." start="00:00:14.636" video="mainVideo" id=subtitle]] +[[!template text="I'll start with an overview of the syntax" start="00:00:18.640" video="mainVideo" id=subtitle]] +[[!template text="for those who are new to using" start="00:00:20.698" video="mainVideo" id=subtitle]] +[[!template text="text-based notation" start="00:00:22.240" video="mainVideo" id=subtitle]] +[[!template text="as a shallow dive into the deep pond" start="00:00:24.400" video="mainVideo" id=subtitle]] +[[!template text="of lilies and Lilypond," start="00:00:26.615" video="mainVideo" id=subtitle]] +[[!template text="and move on to showcase" start="00:00:28.800" video="mainVideo" id=subtitle]] +[[!template text="some of its functionalities using Org Mode and lilypond-mode." start="00:00:30.171" video="mainVideo" id=subtitle]] +[[!template text="One disclaimer, however:" start="00:00:34.723" video="mainVideo" id=subtitle]] +[[!template text="I am not a Lilypond developer." start="00:00:37.173" video="mainVideo" id=subtitle]] +[[!template new="1" text="So what is Lilypond?" start="00:00:40.480" video="mainVideo" id=subtitle]] +[[!template text="Lilypond is a file format and music engraving system" start="00:00:42.841" video="mainVideo" id=subtitle]] +[[!template text="for producing high-quality sheet music." start="00:00:46.800" video="mainVideo" id=subtitle]] +[[!template text="It translates textual representations" start="00:00:50.000" video="mainVideo" id=subtitle]] +[[!template text="of music to graphical objects." start="00:00:52.442" video="mainVideo" id=subtitle]] +[[!template text="It's similar to LaTeX in that" start="00:00:55.120" video="mainVideo" id=subtitle]] +[[!template text="its input format describes" start="00:00:57.520" video="mainVideo" id=subtitle]] +[[!template text="the visual layouts of the score," start="00:00:59.329" video="mainVideo" id=subtitle]] +[[!template text="using commands to define musical expressions." start="00:01:01.600" video="mainVideo" id=subtitle]] +[[!template text="Commands begin with a backslash." start="00:01:05.119" video="mainVideo" id=subtitle]] +[[!template text="For example, the formatter command, as shown on the left," start="00:01:07.760" video="mainVideo" id=subtitle]] +[[!template text="yields its graphical equivalents on the right," start="00:01:10.791" video="mainVideo" id=subtitle]] +[[!template text="the fermata symbol over the low B" start="00:01:13.920" video="mainVideo" id=subtitle]] +[[!template text="and so on and so forth." start="00:01:16.345" video="mainVideo" id=subtitle]] +[[!template text="It's also fully extensible, like Emacs," start="00:01:19.119" video="mainVideo" id=subtitle]] +[[!template text="allowing users to extend" start="00:01:21.600" video="mainVideo" id=subtitle]] +[[!template text="and override Lilypond's functionalities" start="00:01:23.119" video="mainVideo" id=subtitle]] +[[!template text="using the Scheme scripting language." start="00:01:25.600" video="mainVideo" id=subtitle]] +[[!template text="It can be used for early and contemporary music tablature," start="00:01:28.452" video="mainVideo" id=subtitle]] +[[!template text="vocal music lead sheets, and so on." start="00:01:32.422" video="mainVideo" id=subtitle]] +[[!template text="Above all, it works with Emacs." start="00:01:35.200" video="mainVideo" id=subtitle]] +[[!template text="In fact, Lilypond ships with Emacs Lisp libraries," start="00:01:38.000" video="mainVideo" id=subtitle]] +[[!template text="including a major mode for editing Lilypond files." start="00:01:41.040" video="mainVideo" id=subtitle]] +[[!template new="1" text="So the input files are similar to source files." start="00:01:47.360" video="mainVideo" id=subtitle]] +[[!template text="They contain expressions formed with curly braces," start="00:01:50.560" video="mainVideo" id=subtitle]] +[[!template text="comments that start with the percent sign," start="00:01:54.079" video="mainVideo" id=subtitle]] +[[!template text="and the code is indented." start="00:01:56.549" video="mainVideo" id=subtitle]] +[[!template text="Notes are entered using lowercase letters," start="00:02:00.240" video="mainVideo" id=subtitle]] +[[!template text="and rests with the letter r." start="00:02:02.903" video="mainVideo" id=subtitle]] +[[!template text="In this case, the lowercase r or r4" start="00:02:05.600" video="mainVideo" id=subtitle]] +[[!template text="is the equivalence of a crotchet or" start="00:02:08.800" video="mainVideo" id=subtitle]] +[[!template text="quarter note rest." start="00:02:11.039" video="mainVideo" id=subtitle]] +[[!template text="Durations are entered using numbers" start="00:02:14.000" video="mainVideo" id=subtitle]] +[[!template text="and dots after the note name." start="00:02:15.938" video="mainVideo" id=subtitle]] +[[!template text="If you do not specify one," start="00:02:18.480" video="mainVideo" id=subtitle]] +[[!template text="the previous duration is used." start="00:02:20.196" video="mainVideo" id=subtitle]] +[[!template text="You can also tie notes together using the tilde symbol (~)." start="00:02:22.640" video="mainVideo" id=subtitle]] +[[!template text="In fact, you can input chords, lyrics," start="00:02:27.360" video="mainVideo" id=subtitle]] +[[!template text="embellishments, and a lot more." start="00:02:30.000" video="mainVideo" id=subtitle]] +[[!template text="I encourage you to read the manual for more information." start="00:02:32.080" video="mainVideo" id=subtitle]] +[[!template text="Now let's switch to a terminal window." start="00:02:36.160" video="mainVideo" id=subtitle]] +[[!template text="With Lilypond installed," start="00:02:39.680" video="mainVideo" id=subtitle]] +[[!template text="let's create a test file with the extension .ly and open it in Emacs." start="00:02:41.247" video="mainVideo" id=subtitle]] +[[!template new="1" text="At the top of the file is the version statement," start="00:02:50.560" video="mainVideo" id=subtitle]] +[[!template text="which tells Lilypond" start="00:02:53.048" video="mainVideo" id=subtitle]] +[[!template text="which version to use when compiling the file." start="00:02:54.395" video="mainVideo" id=subtitle]] +[[!template text="Here I'm using version 2.20.0." start="00:02:57.440" video="mainVideo" id=subtitle]] +[[!template text="I've added the clef and time signature." start="00:03:00.959" video="mainVideo" id=subtitle]] +[[!template text="Let's add some notes." start="00:03:04.159" video="mainVideo" id=subtitle]] +[[!template text="I'm going to close this now" start="00:03:09.280" video="mainVideo" id=subtitle]] +[[!template text="and compile the file" start="00:03:12.098" video="mainVideo" id=subtitle]] +[[!template text="by running lilypond followed by the file name." start="00:03:13.765" video="mainVideo" id=subtitle]] +[[!template text="So now let's view the output." start="00:03:19.760" video="mainVideo" id=subtitle]] +[[!template new="1" text="Okay. So here's a more complex example" start="00:03:27.360" video="mainVideo" id=subtitle]] +[[!template text="for randomizing note sequences." start="00:03:29.760" video="mainVideo" id=subtitle]] +[[!template text="The idea is to create" start="00:03:32.239" video="mainVideo" id=subtitle]] +[[!template text="new reading materials each time the code blocks are evaluated." start="00:03:33.410" video="mainVideo" id=subtitle]] +[[!template text="As usual, we begin with a header." start="00:03:37.760" video="mainVideo" id=subtitle]] +[[!template text="I've added the title and composer." start="00:03:40.640" video="mainVideo" id=subtitle]] +[[!template text="Then we add the note sequences to use in the composition." start="00:03:43.541" video="mainVideo" id=subtitle]] +[[!template text="In this case, sn is a note name just like" start="00:03:47.920" video="mainVideo" id=subtitle]] +[[!template text="a b c d and so on, and stands for snare drum," start="00:03:51.200" video="mainVideo" id=subtitle]] +[[!template text="the percussion instruments." start="00:03:54.959" video="mainVideo" id=subtitle]] +[[!template text="Now here's a function that's going to" start="00:03:58.879" video="mainVideo" id=subtitle]] +[[!template text="shuffle the notes in the table." start="00:04:00.720" video="mainVideo" id=subtitle]] +[[!template text="Finally, we expand the notes inside" start="00:04:04.080" video="mainVideo" id=subtitle]] +[[!template text="the Lilypond source block." start="00:04:06.560" video="mainVideo" id=subtitle]] +[[!template text="So whatever the function returns" start="00:04:08.799" video="mainVideo" id=subtitle]] +[[!template text="is expanded inside the drums block." start="00:04:10.684" video="mainVideo" id=subtitle]] +[[!template text="Now let's press C-c C-c to view the results." start="00:04:13.680" video="mainVideo" id=subtitle]] +[[!template text="Okay. And if I run this again, it should create a new composition." start="00:04:20.079" video="mainVideo" id=subtitle]] +[[!template text="Great. You can also audition a piece using the midi command," start="00:04:26.840" video="mainVideo" id=subtitle]] +[[!template text="which creates a midi file of the score." start="00:04:31.360" video="mainVideo" id=subtitle]] +[[!template new="1" text="Note also that the ob library--" start="00:04:34.320" video="mainVideo" id=subtitle]] +[[!template text="sorry, the ob-lilypond library comes" start="00:04:36.560" video="mainVideo" id=subtitle]] +[[!template text="with two modes." start="00:04:39.040" video="mainVideo" id=subtitle]] +[[!template text="The one I'm using now is called arrange mode" start="00:04:40.400" video="mainVideo" id=subtitle]] +[[!template text="and is useful for assembling complete scores." start="00:04:43.440" video="mainVideo" id=subtitle]] +[[!template text="The basic mode, on the other hand," start="00:04:47.120" video="mainVideo" id=subtitle]] +[[!template text="allows you to mix text and music" start="00:04:49.015" video="mainVideo" id=subtitle]] +[[!template text="by embedding Lilypond snippets and" start="00:04:51.199" video="mainVideo" id=subtitle]] +[[!template text="export them using typical Org Mode commands." start="00:04:53.360" video="mainVideo" id=subtitle]] +[[!template new="1" text="Now to demonstrate the basic mode in action." start="00:05:00.240" video="mainVideo" id=subtitle]] +[[!template text="I'm going to export this document" start="00:05:02.661" video="mainVideo" id=subtitle]] +[[!template text="to a PDF file." start="00:05:04.320" video="mainVideo" id=subtitle]] +[[!template text="In this case, the :file header argument is required," start="00:05:05.120" video="mainVideo" id=subtitle]] +[[!template text="so you have to provide one" start="00:05:10.077" video="mainVideo" id=subtitle]] +[[!template text="and include the file name." start="00:05:11.919" video="mainVideo" id=subtitle]] +[[!template text="Again, you can run the code and view the results." start="00:05:15.600" video="mainVideo" id=subtitle]] +[[!template text="Here it is. So now let's export this to a PDF file." start="00:05:22.160" video="mainVideo" id=subtitle]] +[[!template text="And here it is, what it generates." start="00:05:33.680" video="mainVideo" id=subtitle]] +[[!template new="1" text="Now I'm going to show you the workflow I used" start="00:05:39.680" video="mainVideo" id=subtitle]] +[[!template text="to produce music books in Emacs," start="00:05:41.716" video="mainVideo" id=subtitle]] +[[!template text="combining Lilypond and LaTeX for a" start="00:05:44.000" video="mainVideo" id=subtitle]] +[[!template text="perfect marriage." start="00:05:46.160" video="mainVideo" id=subtitle]] +[[!template text="I begin by sketching the first draft" start="00:05:48.000" video="mainVideo" id=subtitle]] +[[!template text="of the manuscript using pencil and paper." start="00:05:49.858" video="mainVideo" id=subtitle]] +[[!template text="Then I move to Emacs to input the notes" start="00:05:53.039" video="mainVideo" id=subtitle]] +[[!template text="in a git repository." start="00:05:55.039" video="mainVideo" id=subtitle]] +[[!template text="This is a typical source file." start="00:05:57.440" video="mainVideo" id=subtitle]] +[[!template text="It begins with a stylesheet" start="00:05:59.486" video="mainVideo" id=subtitle]] +[[!template text="where I set variables and layout settings," start="00:06:01.360" video="mainVideo" id=subtitle]] +[[!template text="although in general," start="00:06:03.690" video="mainVideo" id=subtitle]] +[[!template text="there's no need for tweaking the layout" start="00:06:04.875" video="mainVideo" id=subtitle]] +[[!template text="unless you have specific requirements to do so." start="00:06:07.039" video="mainVideo" id=subtitle]] +[[!template text="The easiest way to compile the file from Emacs is by pressing C-c C-l," start="00:06:11.199" video="mainVideo" id=subtitle]] +[[!template text="so let's do this now," start="00:06:15.520" video="mainVideo" id=subtitle]] +[[!template text="and the compilation buffer will tell you" start="00:06:19.280" video="mainVideo" id=subtitle]] +[[!template text="if there were any errors in the file." start="00:06:21.199" video="mainVideo" id=subtitle]] +[[!template text="Now to automate the process of" start="00:06:23.759" video="mainVideo" id=subtitle]] +[[!template text="compiling several files and building the PDF," start="00:06:25.439" video="mainVideo" id=subtitle]] +[[!template text="I use GNU Make, so all I have to do is" start="00:06:28.560" video="mainVideo" id=subtitle]] +[[!template text="open the shell and run the make command. Don't worry," start="00:06:31.280" video="mainVideo" id=subtitle]] +[[!template text="I'll provide a link to the source code" start="00:06:36.000" video="mainVideo" id=subtitle]] +[[!template text="on the last slide." start="00:06:37.840" video="mainVideo" id=subtitle]] +[[!template new="1" text="As I moved forward with the project," start="00:06:41.600" video="mainVideo" id=subtitle]] +[[!template text="I found at least two things missing." start="00:06:43.494" video="mainVideo" id=subtitle]] +[[!template text="One, I had no access to a metronome," start="00:06:46.000" video="mainVideo" id=subtitle]] +[[!template text="at least not from the editor," start="00:06:48.720" video="mainVideo" id=subtitle]] +[[!template text="so I built one for casual use" start="00:06:50.479" video="mainVideo" id=subtitle]] +[[!template text="and made it available in the MELPA repository." start="00:06:52.437" video="mainVideo" id=subtitle]] +[[!template text="I also missed bar numbers in the source file." start="00:06:55.919" video="mainVideo" id=subtitle]] +[[!template text="This is useful when going back and forth" start="00:06:59.039" video="mainVideo" id=subtitle]] +[[!template text="between input and output files without getting lost." start="00:07:00.880" video="mainVideo" id=subtitle]] +[[!template text="So I wrote a command for toggling bar numbers," start="00:07:04.479" video="mainVideo" id=subtitle]] +[[!template text="which I hope you can see on the left." start="00:07:07.290" video="mainVideo" id=subtitle]] +[[!template text="Also, some expressions are difficult or" start="00:07:10.000" video="mainVideo" id=subtitle]] +[[!template text="slow to write on the keyboard--" start="00:07:12.080" video="mainVideo" id=subtitle]] +[[!template text="accents and tuplets, for example--" start="00:07:14.160" video="mainVideo" id=subtitle]] +[[!template text="so I use template expansion extensively for this purpose," start="00:07:16.490" video="mainVideo" id=subtitle]] +[[!template text="mainly yasnippet." start="00:07:20.160" video="mainVideo" id=subtitle]] +[[!template new="1" text="So what do I think?" start="00:07:23.440" video="mainVideo" id=subtitle]] +[[!template text="Well, I think Lilypond can be a sharp paradigm shift" start="00:07:24.797" video="mainVideo" id=subtitle]] +[[!template text="for people used to GUI alternatives," start="00:07:28.080" video="mainVideo" id=subtitle]] +[[!template text="but the results are impressive." start="00:07:30.817" video="mainVideo" id=subtitle]] +[[!template text="You don't have to dive too deeply to" start="00:07:32.720" video="mainVideo" id=subtitle]] +[[!template text="start using Lilypond." start="00:07:34.639" video="mainVideo" id=subtitle]] +[[!template text="Likewise, the ability to extend the software, I think," start="00:07:36.960" video="mainVideo" id=subtitle]] +[[!template text="is especially appealing for music professionals," start="00:07:39.635" video="mainVideo" id=subtitle]] +[[!template text="enthusiasts, composers, and the academic community:" start="00:07:42.400" video="mainVideo" id=subtitle]] +[[!template text="for example, allowing users to create" start="00:07:46.560" video="mainVideo" id=subtitle]] +[[!template text="alternative notation systems" start="00:07:48.400" video="mainVideo" id=subtitle]] +[[!template text="required in non-Western music traditions" start="00:07:50.187" video="mainVideo" id=subtitle]] +[[!template text="and other non-conventional requirements." start="00:07:53.120" video="mainVideo" id=subtitle]] +[[!template text="Also, Lilypond and Emacs both have" start="00:07:56.160" video="mainVideo" id=subtitle]] +[[!template text="extensive and well-written manuals" start="00:07:58.400" video="mainVideo" id=subtitle]] +[[!template text="and active communities of users." start="00:08:00.720" video="mainVideo" id=subtitle]] +[[!template text="But if you're still not sure" start="00:08:04.639" video="mainVideo" id=subtitle]] +[[!template text="where to start and when to wedge your feet in the deep but warm pond" start="00:08:05.971" video="mainVideo" id=subtitle]] +[[!template text="of lilies, Lilypond, and Lilypond users," start="00:08:10.475" video="mainVideo" id=subtitle]] +[[!template text="I invite you to contribute to my Lilypond projects," start="00:08:13.680" video="mainVideo" id=subtitle]] +[[!template text="which you can do so from the links on the screen." start="00:08:16.960" video="mainVideo" id=subtitle]] +[[!template text="So, thank you all. I look forward to your comments," start="00:08:20.720" video="mainVideo" id=subtitle]] +[[!template text="and I hope you enjoy the rest of the conference." start="00:08:23.271" video="mainVideo" id=subtitle]] diff --git a/2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt b/2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt index 773ff31b..b2722c99 100644 --- a/2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt +++ b/2020/subtitles/emacsconf-2020--04-music-in-plain-text--jonathan-gregory.vtt @@ -3,98 +3,94 @@ WEBVTT 00:00:02.000 --> 00:00:04.799 Hello, everyone, and welcome to the EmacsConf. -00:00:04.799 --> 00:00:07.200 -I am Jonathan. In this talk, I'm going +00:00:04.799 --> 00:00:06.631 +I am Jonathan. In this talk, -00:00:07.200 --> 00:00:09.599 -to demonstrate ways of producing sheet +00:00:06.631 --> 00:00:10.880 +I'm going to demonstrate ways of +producing sheet music in Emacs -00:00:09.599 --> 00:00:10.880 -music in Emacs +00:00:10.880 --> 00:00:14.636 +using Lilypond, and maybe also +convince you -00:00:10.880 --> 00:00:14.320 -using Lilypond, and maybe also convince +00:00:14.636 --> 00:00:18.640 +to use Emacs for writing your scores. -00:00:14.320 --> 00:00:18.640 -you to use Emacs for writing your scores. +00:00:18.640 --> 00:00:20.698 +I'll start with an overview +of the syntax -00:00:18.640 --> 00:00:20.400 -I'll start with an overview of the - -00:00:20.400 --> 00:00:22.240 -syntax for those who are new to using +00:00:20.698 --> 00:00:22.240 +for those who are new to using 00:00:22.240 --> 00:00:24.400 text-based notation -00:00:24.400 --> 00:00:26.800 -as a shallow dive into the deep pond of +00:00:24.400 --> 00:00:26.615 +as a shallow dive into the deep pond -00:00:26.800 --> 00:00:28.800 -lilies and Lilypond, +00:00:26.615 --> 00:00:28.800 +of lilies and Lilypond, -00:00:28.800 --> 00:00:30.800 -and move on to showcase some of its +00:00:28.800 --> 00:00:30.171 +and move on to showcase -00:00:30.800 --> 00:00:32.960 -functionalities using Org Mode +00:00:30.171 --> 00:00:34.723 +some of its functionalities +using Org Mode and lilypond-mode. -00:00:32.960 --> 00:00:36.320 -and lilypond-mode. One disclaimer, +00:00:34.723 --> 00:00:37.173 +One disclaimer, however: -00:00:36.320 --> 00:00:40.480 -however: I am not a Lilypond developer. +00:00:37.173 --> 00:00:40.480 +I am not a Lilypond developer. -00:00:40.480 --> 00:00:44.079 -So what is Lilypond? Lilypond is +00:00:40.480 --> 00:00:42.841 +So what is Lilypond? -00:00:44.079 --> 00:00:46.800 -a file format and music engraving system +00:00:42.841 --> 00:00:46.800 +Lilypond is a file format and music +engraving system 00:00:46.800 --> 00:00:50.000 for producing high-quality sheet music. -00:00:50.000 --> 00:00:52.640 -It translates textual representations of +00:00:50.000 --> 00:00:52.442 +It translates textual representations -00:00:52.640 --> 00:00:55.120 -music to graphical objects. +00:00:52.442 --> 00:00:55.120 +of music to graphical objects. -00:00:55.120 --> 00:00:57.760 -It's similar to LaTeX in that its +00:00:55.120 --> 00:00:57.520 +It's similar to LaTeX in that -00:00:57.760 --> 00:01:00.000 -input format describes the visual +00:00:57.520 --> 00:00:59.329 +its input format describes -00:01:00.000 --> 00:01:01.600 -layouts of the score, +00:00:59.329 --> 00:01:01.600 +the visual layouts of the score, -00:01:01.600 --> 00:01:03.520 +00:01:01.600 --> 00:01:05.119 using commands to define musical - -00:01:03.520 --> 00:01:05.119 expressions. 00:01:05.119 --> 00:01:07.760 Commands begin with a backslash. -00:01:07.760 --> 00:01:08.640 -For example, - -00:01:08.640 --> 00:01:10.479 -the formatter command, as shown on the +00:01:07.760 --> 00:01:10.791 +For example, the formatter command, +as shown on the left, -00:01:10.479 --> 00:01:13.040 -left, yields its graphical equivalents on +00:01:10.791 --> 00:01:13.920 +yields its graphical equivalents +on the right, -00:01:13.040 --> 00:01:13.920 -the right, +00:01:13.920 --> 00:01:16.345 +the fermata symbol over the low B -00:01:13.920 --> 00:01:16.640 -the fermata symbol over the low B and - -00:01:16.640 --> 00:01:19.119 -so on and so forth. +00:01:16.345 --> 00:01:19.119 +and so on and so forth. 00:01:19.119 --> 00:01:21.600 It's also fully extensible, like Emacs, @@ -105,59 +101,48 @@ allowing users to extend 00:01:23.119 --> 00:01:25.600 and override Lilypond's functionalities -00:01:25.600 --> 00:01:26.640 -using the Scheme - -00:01:26.640 --> 00:01:29.840 -scripting language. It can be used for +00:01:25.600 --> 00:01:28.452 +using the Scheme scripting language. -00:01:29.840 --> 00:01:31.600 -early and contemporary music +00:01:28.452 --> 00:01:32.422 +It can be used for early and +contemporary music tablature, -00:01:31.600 --> 00:01:34.479 -tablature, vocal music lead sheets, - -00:01:34.479 --> 00:01:35.200 -and so on. +00:01:32.422 --> 00:01:35.200 +vocal music lead sheets, and so on. 00:01:35.200 --> 00:01:38.000 Above all, it works with Emacs. -00:01:38.000 --> 00:01:38.479 -In fact, - -00:01:38.479 --> 00:01:41.040 -Lilypond ships with Emacs Lisp libraries, +00:01:38.000 --> 00:01:41.040 +In fact, Lilypond ships with +Emacs Lisp libraries, -00:01:41.040 --> 00:01:43.119 +00:01:41.040 --> 00:01:47.360 including a major mode for editing - -00:01:43.119 --> 00:01:47.360 Lilypond files. -00:01:47.360 --> 00:01:50.000 -So the input files are similar to - -00:01:50.000 --> 00:01:50.560 -source files. +00:01:47.360 --> 00:01:50.560 +So the input files are similar to source +files. -00:01:50.560 --> 00:01:52.560 +00:01:50.560 --> 00:01:54.079 They contain expressions formed with - -00:01:52.560 --> 00:01:54.079 curly braces, -00:01:54.079 --> 00:01:55.840 -comments that start with the percent +00:01:54.079 --> 00:01:56.549 +comments that start with +the percent sign, -00:01:55.840 --> 00:02:00.240 -sign, and the code is indented. +00:01:56.549 --> 00:02:00.240 +and the code is indented. -00:02:00.240 --> 00:02:02.159 +00:02:00.240 --> 00:02:02.903 Notes are entered using lowercase +letters, -00:02:02.159 --> 00:02:05.600 -letters, and rests with the letter r. +00:02:02.903 --> 00:02:05.600 +and rests with the letter r. 00:02:05.600 --> 00:02:08.800 In this case, the lowercase r or r4 @@ -168,22 +153,20 @@ is the equivalence of a crotchet or 00:02:11.039 --> 00:02:14.000 quarter note rest. -00:02:14.000 --> 00:02:16.160 -Durations are entered using numbers and +00:02:14.000 --> 00:02:15.938 +Durations are entered using numbers -00:02:16.160 --> 00:02:18.480 -dots after the note name. +00:02:15.938 --> 00:02:18.480 +and dots after the note name. -00:02:18.480 --> 00:02:20.959 -If you do not specify one, the previous +00:02:18.480 --> 00:02:20.196 +If you do not specify one, -00:02:20.959 --> 00:02:22.640 -duration is used. +00:02:20.196 --> 00:02:22.640 +the previous duration is used. -00:02:22.640 --> 00:02:24.560 +00:02:22.640 --> 00:02:27.360 You can also tie notes together using - -00:02:24.560 --> 00:02:27.360 the tilde symbol (~). 00:02:27.360 --> 00:02:30.000 @@ -192,32 +175,30 @@ In fact, you can input chords, lyrics, 00:02:30.000 --> 00:02:32.080 embellishments, and a lot more. -00:02:32.080 --> 00:02:33.920 +00:02:32.080 --> 00:02:36.160 I encourage you to read the manual for - -00:02:33.920 --> 00:02:36.160 more information. 00:02:36.160 --> 00:02:39.680 Now let's switch to a terminal window. -00:02:39.680 --> 00:02:42.000 -With Lilypond installed, let's create - -00:02:42.000 --> 00:02:43.840 -a test file with the extension +00:02:39.680 --> 00:02:41.247 +With Lilypond installed, -00:02:43.840 --> 00:02:50.560 -.ly and open it in Emacs. +00:02:41.247 --> 00:02:50.560 +let's create a test file with the +extension .ly and open it in Emacs. -00:02:50.560 --> 00:02:52.400 -At the top of the file is the version +00:02:50.560 --> 00:02:53.048 +At the top of the file is +the version statement, -00:02:52.400 --> 00:02:54.800 -statement, which tells Lilypond which +00:02:53.048 --> 00:02:54.395 +which tells Lilypond -00:02:54.800 --> 00:02:57.440 -version to use when compiling the file. +00:02:54.395 --> 00:02:57.440 +which version to use when +compiling the file. 00:02:57.440 --> 00:03:00.959 Here I'm using version 2.20.0. @@ -228,14 +209,15 @@ I've added the clef and time signature. 00:03:04.159 --> 00:03:09.280 Let's add some notes. -00:03:09.280 --> 00:03:12.400 -I'm going to close this now and +00:03:09.280 --> 00:03:12.098 +I'm going to close this now -00:03:12.400 --> 00:03:14.560 -compile the file by running +00:03:12.098 --> 00:03:13.765 +and compile the file -00:03:14.560 --> 00:03:19.760 -lilypond followed by the file name. +00:03:13.765 --> 00:03:19.760 +by running lilypond followed +by the file name. 00:03:19.760 --> 00:03:27.360 So now let's view the output. @@ -246,26 +228,22 @@ Okay. So here's a more complex example 00:03:29.760 --> 00:03:32.239 for randomizing note sequences. -00:03:32.239 --> 00:03:34.080 -The idea is to create new reading +00:03:32.239 --> 00:03:33.410 +The idea is to create -00:03:34.080 --> 00:03:36.239 -materials each time the code blocks are - -00:03:36.239 --> 00:03:37.760 -evaluated. +00:03:33.410 --> 00:03:37.760 +new reading materials each time the code +blocks are evaluated. 00:03:37.760 --> 00:03:40.640 As usual, we begin with a header. -00:03:40.640 --> 00:03:41.840 -I've added the title - -00:03:41.840 --> 00:03:45.200 -and composer. Then we add the note +00:03:40.640 --> 00:03:43.541 +I've added the title and composer. -00:03:45.200 --> 00:03:47.920 -sequences to use in the composition. +00:03:43.541 --> 00:03:47.920 +Then we add the note sequences to use in +the composition. 00:03:47.920 --> 00:03:51.200 In this case, sn is a note name just like @@ -288,28 +266,22 @@ Finally, we expand the notes inside 00:04:06.560 --> 00:04:08.799 the Lilypond source block. -00:04:08.799 --> 00:04:10.799 -So whatever the function returns is +00:04:08.799 --> 00:04:10.684 +So whatever the function returns -00:04:10.799 --> 00:04:13.680 -expanded inside the drums block. +00:04:10.684 --> 00:04:13.680 +is expanded inside the drums block. -00:04:13.680 --> 00:04:16.479 -Now let's press C-c C-c to view +00:04:13.680 --> 00:04:20.079 +Now let's press C-c C-c to view the +results. -00:04:16.479 --> 00:04:20.079 -the results. - -00:04:20.079 --> 00:04:23.280 +00:04:20.079 --> 00:04:26.840 Okay. And if I run this again, it should - -00:04:23.280 --> 00:04:26.840 create a new composition. -00:04:26.840 --> 00:04:29.680 +00:04:26.840 --> 00:04:31.360 Great. You can also audition a piece - -00:04:29.680 --> 00:04:31.360 using the midi command, 00:04:31.360 --> 00:04:34.320 @@ -324,74 +296,64 @@ sorry, the ob-lilypond library comes 00:04:39.040 --> 00:04:40.400 with two modes. -00:04:40.400 --> 00:04:42.560 +00:04:40.400 --> 00:04:43.440 The one I'm using now is called - -00:04:42.560 --> 00:04:43.440 arrange mode -00:04:43.440 --> 00:04:45.440 +00:04:43.440 --> 00:04:47.120 and is useful for assembling - -00:04:45.440 --> 00:04:47.120 complete scores. -00:04:47.120 --> 00:04:49.360 -The basic mode on the other hand allows +00:04:47.120 --> 00:04:49.015 +The basic mode, on the other hand, -00:04:49.360 --> 00:04:51.199 -you to mix text and music +00:04:49.015 --> 00:04:51.199 +allows you to mix text and music 00:04:51.199 --> 00:04:53.360 by embedding Lilypond snippets and -00:04:53.360 --> 00:04:55.440 +00:04:53.360 --> 00:05:00.240 export them using typical Org Mode - -00:04:55.440 --> 00:05:00.240 commands. -00:05:00.240 --> 00:05:02.320 +00:05:00.240 --> 00:05:02.661 Now to demonstrate the basic mode in +action. -00:05:02.320 --> 00:05:04.320 -action. I'm going to export this document +00:05:02.661 --> 00:05:04.320 +I'm going to export this document 00:05:04.320 --> 00:05:05.120 to a PDF file. -00:05:05.120 --> 00:05:08.240 -In this case, the - -00:05:08.240 --> 00:05:10.639 -:file header argument is required, so you +00:05:05.120 --> 00:05:10.077 +In this case, the :file header argument +is required, -00:05:10.639 --> 00:05:11.919 -have to provide one +00:05:10.077 --> 00:05:11.919 +so you have to provide one 00:05:11.919 --> 00:05:15.600 and include the file name. -00:05:15.600 --> 00:05:17.919 -Again, you can run the code and view +00:05:15.600 --> 00:05:22.160 +Again, you can run the code and view the +results. -00:05:17.919 --> 00:05:22.160 -the results. - -00:05:22.160 --> 00:05:25.840 -Here it is. So now let's - -00:05:25.840 --> 00:05:33.680 -export this to a PDF file. +00:05:22.160 --> 00:05:33.680 +Here it is. So now let's export this to +a PDF file. 00:05:33.680 --> 00:05:39.680 And here it is, what it generates. -00:05:39.680 --> 00:05:41.440 -Now I'm going to show you the workflow I +00:05:39.680 --> 00:05:41.716 +Now I'm going to show you +the workflow I used -00:05:41.440 --> 00:05:44.000 -used to produce music books in Emacs, +00:05:41.716 --> 00:05:44.000 +to produce music books in Emacs, 00:05:44.000 --> 00:05:46.160 combining Lilypond and LaTeX for a @@ -399,11 +361,12 @@ combining Lilypond and LaTeX for a 00:05:46.160 --> 00:05:48.000 perfect marriage. -00:05:48.000 --> 00:05:50.160 -I begin by sketching the first draft of the +00:05:48.000 --> 00:05:49.858 +I begin by sketching the first draft -00:05:50.160 --> 00:05:53.039 -manuscript using pencil and paper. +00:05:49.858 --> 00:05:53.039 +of the manuscript using +pencil and paper. 00:05:53.039 --> 00:05:55.039 Then I move to Emacs to input the notes @@ -411,32 +374,28 @@ Then I move to Emacs to input the notes 00:05:55.039 --> 00:05:57.440 in a git repository. -00:05:57.440 --> 00:06:00.080 -This is a typical source file. It begins +00:05:57.440 --> 00:05:59.486 +This is a typical source file. -00:06:00.080 --> 00:06:01.360 -with a stylesheet +00:05:59.486 --> 00:06:01.360 +It begins with a stylesheet -00:06:01.360 --> 00:06:03.199 -where I set variables and layout +00:06:01.360 --> 00:06:03.690 +where I set variables and layout settings, -00:06:03.199 --> 00:06:05.440 -settings, although in general, there's no +00:06:03.690 --> 00:06:04.875 +although in general, -00:06:05.440 --> 00:06:07.039 -need for tweaking the layout +00:06:04.875 --> 00:06:07.039 +there's no need for tweaking the layout -00:06:07.039 --> 00:06:09.280 +00:06:07.039 --> 00:06:11.199 unless you have specific requirements to - -00:06:09.280 --> 00:06:11.199 do so. -00:06:11.199 --> 00:06:13.360 -The easiest way to compile the file from - -00:06:13.360 --> 00:06:15.520 -Emacs is by pressing C-c C-l, +00:06:11.199 --> 00:06:15.520 +The easiest way to compile the file +from Emacs is by pressing C-c C-l, 00:06:15.520 --> 00:06:19.280 so let's do this now, @@ -447,20 +406,19 @@ and the compilation buffer will tell you 00:06:21.199 --> 00:06:23.759 if there were any errors in the file. -00:06:23.759 --> 00:06:26.000 -Now to automate the process of compiling +00:06:23.759 --> 00:06:25.439 +Now to automate the process of -00:06:26.000 --> 00:06:28.560 -several files and building the PDF, +00:06:25.439 --> 00:06:28.560 +compiling several files and +building the PDF, 00:06:28.560 --> 00:06:31.280 I use GNU Make, so all I have to do is -00:06:31.280 --> 00:06:32.560 -open the shell - -00:06:32.560 --> 00:06:36.000 -and run the make command. Don't worry, +00:06:31.280 --> 00:06:36.000 +open the shell and run the make command. +Don't worry, 00:06:36.000 --> 00:06:37.840 I'll provide a link to the source code @@ -468,11 +426,11 @@ I'll provide a link to the source code 00:06:37.840 --> 00:06:41.600 on the last slide. -00:06:41.600 --> 00:06:43.600 -As I moved forward with the project, I +00:06:41.600 --> 00:06:43.494 +As I moved forward with the project, -00:06:43.600 --> 00:06:46.000 -found at least two things missing. +00:06:43.494 --> 00:06:46.000 +I found at least two things missing. 00:06:46.000 --> 00:06:48.720 One, I had no access to a metronome, @@ -480,29 +438,30 @@ One, I had no access to a metronome, 00:06:48.720 --> 00:06:50.479 at least not from the editor, -00:06:50.479 --> 00:06:52.960 -so I built one for casual use and made +00:06:50.479 --> 00:06:52.437 +so I built one for casual use -00:06:52.960 --> 00:06:55.919 -it available in the MELPA repository. +00:06:52.437 --> 00:06:55.919 +and made it available in the MELPA +repository. 00:06:55.919 --> 00:06:59.039 -I also missed bar numbers in the source file. +I also missed bar numbers in the +source file. 00:06:59.039 --> 00:07:00.880 This is useful when going back and forth -00:07:00.880 --> 00:07:03.199 +00:07:00.880 --> 00:07:04.479 between input and output files without - -00:07:03.199 --> 00:07:04.479 getting lost. -00:07:04.479 --> 00:07:06.720 +00:07:04.479 --> 00:07:07.290 So I wrote a command for toggling bar +numbers, -00:07:06.720 --> 00:07:10.000 -numbers, which I hope you can see on the left. +00:07:07.290 --> 00:07:10.000 +which I hope you can see on the left. 00:07:10.000 --> 00:07:12.080 Also, some expressions are difficult or @@ -510,26 +469,28 @@ Also, some expressions are difficult or 00:07:12.080 --> 00:07:14.160 slow to write on the keyboard-- -00:07:14.160 --> 00:07:17.039 -accents and tuplets, for example--so I use +00:07:14.160 --> 00:07:16.490 +accents and tuplets, for example-- -00:07:17.039 --> 00:07:20.160 -template expansion extensively for this purpose, +00:07:16.490 --> 00:07:20.160 +so I use template expansion extensively +for this purpose, 00:07:20.160 --> 00:07:23.440 mainly yasnippet. -00:07:23.440 --> 00:07:25.680 -So what do I think? Well, I think +00:07:23.440 --> 00:07:24.797 +So what do I think? -00:07:25.680 --> 00:07:28.080 -Lilypond can be a sharp paradigm shift +00:07:24.797 --> 00:07:28.080 +Well, I think Lilypond can be a sharp +paradigm shift -00:07:28.080 --> 00:07:31.039 -for people used to GUI alternatives, but +00:07:28.080 --> 00:07:30.817 +for people used to GUI alternatives, -00:07:31.039 --> 00:07:32.720 -the results are impressive. +00:07:30.817 --> 00:07:32.720 +but the results are impressive. 00:07:32.720 --> 00:07:34.639 You don't have to dive too deeply to @@ -537,29 +498,27 @@ You don't have to dive too deeply to 00:07:34.639 --> 00:07:36.960 start using Lilypond. -00:07:36.960 --> 00:07:38.880 +00:07:36.960 --> 00:07:39.635 Likewise, the ability to extend the +software, +I think, -00:07:38.880 --> 00:07:40.720 -software, I think, is especially appealing +00:07:39.635 --> 00:07:42.400 +is especially appealing for music +professionals, -00:07:40.720 --> 00:07:42.400 -for music professionals, - -00:07:42.400 --> 00:07:45.199 +00:07:42.400 --> 00:07:46.560 enthusiasts, composers, and the academic - -00:07:45.199 --> 00:07:46.560 community: 00:07:46.560 --> 00:07:48.400 for example, allowing users to create -00:07:48.400 --> 00:07:50.800 -alternative notation systems required in +00:07:48.400 --> 00:07:50.187 +alternative notation systems -00:07:50.800 --> 00:07:53.120 -non-Western music traditions +00:07:50.187 --> 00:07:53.120 +required in non-Western music traditions 00:07:53.120 --> 00:07:56.160 and other non-conventional requirements. @@ -573,35 +532,28 @@ extensive and well-written manuals 00:08:00.720 --> 00:08:04.639 and active communities of users. -00:08:04.639 --> 00:08:06.400 -But if you're still not sure where to +00:08:04.639 --> 00:08:05.971 +But if you're still not sure -00:08:06.400 --> 00:08:09.599 -start and when to wedge your feet in the deep +00:08:05.971 --> 00:08:10.475 +where to start and when to wedge your +feet in the deep but warm pond -00:08:09.599 --> 00:08:12.160 -but warm pond of lilies, Lilypond, and +00:08:10.475 --> 00:08:13.680 +of lilies, Lilypond, and Lilypond users, -00:08:12.160 --> 00:08:13.680 -Lilypond users, - -00:08:13.680 --> 00:08:15.680 +00:08:13.680 --> 00:08:16.960 I invite you to contribute to my - -00:08:15.680 --> 00:08:16.960 Lilypond projects, -00:08:16.960 --> 00:08:18.800 +00:08:16.960 --> 00:08:20.720 which you can do so from the links on - -00:08:18.800 --> 00:08:20.720 the screen. -00:08:20.720 --> 00:08:22.800 -So, thank you all. I look forward to your - -00:08:22.800 --> 00:08:24.639 -comments, and I hope you enjoy the rest +00:08:20.720 --> 00:08:23.271 +So, thank you all. I look forward to +your comments, -00:08:24.639 --> 00:08:27.840 -of the conference. +00:08:23.271 --> 00:08:27.840 +and I hope you enjoy the rest of the +conference. |