;;; lilypond-skeletons.el --- Adds a menu for easy access to LilyPond templates. ;; Copyright (C) 2007,2008 Shelagh Manton ;; Author: Shelagh Manton ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. ;;; Commentary: ;; ;; This is intended to be a library of skeletons for use with ;; LilyPond-mode. Put the following into your .emacs file ;; (add-hook 'Lilypond-mode-hook (lambda () (abbrevs-mode 1))) if you want to ;; use abbrevs and the following to load the file in lilypond-mode. ;; (add-hook 'Lilypond-mode-hook (lambda () (load-library "/path/to/your/lilypond-skeletons.el"))) ;; or (eval-after-load "LilyPond-mode" (load-library "/path/to/your/lilypond-skeletons.el")) ;; There are two ways to use the structural skeletons. You can just ;; call them (eg. M-x LilyPond-slur) as you write a LilyPond file and enter ;; the notes where the cursor is placed after inserting the skeleton or ;; you can select the notes you wish to enclose in the lilypond ;; structure and then call the LilyPond-whatever function and the notes will ;; be placed in the right place. Things that are optional can be ignored and RET safely ;; and the next interactive skeleton is presented, where possible I have put reasonable defaults. ;;; History: ;; ;; RCS file: lp-skeletons.el,v Original name ;; Working file: lp-skeletons.el ;; head: 1.7 ;; branch: ;; locks: strict ;; shelagh: 1.7 ;; access list: ;; symbolic names: ;; keyword substitution: kv ;; total revisions: 7; selected revisions: 7 ;; description: ;; ---------------------------- ;; revision 1.7 locked by: shelagh; ;; date: 2007/12/01 10:15:59; author: shelagh; state: Exp; lines: +45 -3 ;; Got a menu made with skeletons ;; tried to define keybindings for lilypond structure skeletons but can't ;; work out the syntax. ;; ---------------------------- ;; revision 1.6 ;; date: 2007/12/01 05:39:04; author: shelagh; state: Exp; lines: +14 -14 ;; Changed Lilypond string to Lilypond comment. ;; ---------------------------- ;; revision 1.5 ;; date: 2007/12/01 05:30:48; author: shelagh; state: Exp; lines: +39 -31 ;; fixed some typos. ;; put in some default values for if people just RET instead of entering ;; something. ;; Wrote out some more instructions on how to use and also think I have ;; worked out the correct regexp to get the highlighting. ;; ---------------------------- ;; revision 1.4 ;; date: 2007/11/27 03:35:43; author: shelagh; state: Exp; lines: +24 -10 ;; added a text-spanner skeleton and found out that you can have a ;; skeleton inside a skeleton. Groovy! ;; ---------------------------- ;; revision 1.3 ;; date: 2007/11/27 01:24:58; author: shelagh; state: Exp; lines: +17 -16 ;; sent. ;; ---------------------------- ;; revision 1.2 ;; date: 2007/11/27 00:56:21; author: shelagh; state: Exp; lines: +25 -46 ;; Changed the FIXMES to version numbers, with advice to update with ;; convert-ly if the version is different from the lilypond used. ;; ---------------------------- ;; revision 1.1 ;; date: 2007/11/26 23:35:12; author: shelagh; state: Exp; ;; Initial revision ;; RCS file: lilypond-skeletons.el,v ;; Working file: lilypond-skeletons.el ;; head: 1.3 ;; branch: ;; locks: strict ;; access list: ;; symbolic names: ;; keyword substitution: kv ;; total revisions: 3; selected revisions: 3 ;; description: ;; ---------------------------- ;; revision 1.3 ;; date: 2007/12/03 04:38:28; author: shelagh; state: Exp; lines: +4 -8 ;; fixed up regexp for font warning face to get tags-section right. ;; ---------------------------- ;; revision 1.2 ;; date: 2007/12/03 04:09:55; author: shelagh; state: Exp; lines: +101 -26 ;; added menu successfully. ;; added keybindings successfully. ;; added parts menu with revised LilyPond-sub-buffer and ;; LilyPond-score-buffer. ;; added bagpipes template with a view into bagpipe.ly Jazz combo. ;; added tags section. ;; ---------------------------- ;; revision 1.1 ;; date: 2007/12/03 02:39:19; author: shelagh; state: Exp; ;; Initial revision (require 'lilypond-mode) ;;; Code: ;;; LilyPond-book stuff (define-skeleton LilyPond-book-skeleton "Insert a skeleton for lilybook. Only makes sense in an empty buffer." nil "\\documentclass["(skeleton-read "Papersize?: " ) "," (skeleton-read "Draft or Final? " ) "," (skeleton-read "Landsacape? ") "]{article}" \n "\\begin{document}" \n > _ \n > "\\end{document}\n" ) ;;Usefull for easy insertion of snippets in a lilybook. (define-skeleton LilyPond-snippet "Inserts a music snippet in Lilybook" nil "\\begin{lilypond}\n"\n >"\\relative c'' {" \n > _ \n >"}" \n >"\\end{lilypond}" \n ) ;;; Headers (define-skeleton LilyPond-header "Interactively inserts header for Lilypond file. You need to decide where it goes as you can put a header block the last thing in a \score block, or by itself in the .ly file. There are some basic defaults if you don't know what to put, and if you don't want a section just RET. Lilypond markup is acceptable in these strings. There is an opportuntity to define your own personalised header. See LilyPond-myheader." nil "\\header {" \n > "title = \""(skeleton-read "Title is: ") "\" " \n > "composer = \""(skeleton-read "Composer is: ")\| (user-full-name) "\" " \n > "copyright = \""(skeleton-read "Copyright: ") \| "Public Domain\" " \n > ( "Optional, Maintainer is: " "maintainer = \"" str "\" " \n) resume: > ( "Optional, Words by: " "poet = \"" str "\" " \n) ;;subprompt resume: > ( "Optional, Subtitle is: " "subtitle = \"" str "\" " \n);;subprompt resume: > ( "Optional, Arranger is: " "arranger = \"" str "\" " \n) ;;subprompt resume: > ( "Optional, Tempo is: " "meter = \"" str "\" "\n ) resume: > ( "Optional, Instrument?: " "instrument = \"" str "\" "\n) resume: > ( "Optional, Dedicated to: " "dedication = \"" str "\" "\n) resume: > ( "Optional, And at the bottom of the last page?: " "tagline = \"" str " "(format-time-string "%d %b %Y")"\"")\n resume: > "}" \n ) (define-skeleton LilyPond-myheader "Interactively inserts personal header for Lilypond files. You need to change this to make it useful for you. Of course you may delete lines which are not applicable to your case. I suggest you copy this to your init-file abd change it as necessary" " " "\\header" \n > "{" \n > "title = \"" (skeleton-read "Title is: ") "\" " \n ; leave this line. > "composer = \"" (user-full-name) "\" " \n > "copyright = \" YOUR DEFAULT COPYRIGHT CLAUSE \" " \n > "poet = \" YOUR POETS NAME \" " \n ; no words? get rid of this line. > ( "Subtitle is: " "subtitle = \"" str "\" " \n); sometimes we might want a subtitle resume: > "arranger = \" YOUR ARRANGERS NAME \" " \n > ( "Optional, Tempo is: " "meter = \"" str "\" "\n ) resume: > "tagline = \" WHAT YOU WANT ON THE BOTTOM OF THE LAST PAGE "(format-time-string "%b %Y")"\"" \n > "}" \n ) ;;; variables (define-skeleton LilyPond-global "A simple global variable" nil "global = {"\n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\|" \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\|" 4/4" \n > ("Sometimes we want to define clef: " "\\clef " str )\n resume: > "}" \n ) (define-skeleton LilyPond-global-min "An even simpler global variable" nil "global = {"\n > "\\key "(skeleton-read "Key: ")\|" c "(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\|" 4/4" \n > "}" \n ) ;;Define your own variables. Might be useful for beginners? (define-skeleton LilyPond-variable "Define a variable for lilypond" nil (skeleton-read "Name of variable: ") " = {"\n > _ \n >"}" \n ) ;;; Templates ;; vocal ensemble (define-skeleton LilyPond-vocal-ensemble "Insert form for vocal ensemble and place point at first insertion point" nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n " global = {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > "}" \n "sopMusic = \\relative c'' {" \n > _ \n > "}" \n "sopWords = \\lyricmode {" \n > "LYRICS"\n >"}" \n \n "altoMusic = \\relative c' {"\n > "INSERT NOTES" \n > "}"\n \n "altoWords =\\lyricmode {"\n > "LYRICS"\n > "}"\n \n "tenorMusic = \\relative c' {"\n > "INSERT NOTES"\n >"}"\n \n "tenorWords = \\lyricmode {"\n > "LYRICS"\n > "}"\n \n "bassMusic = \\relative c {"\n > "INSERT NOTES"\n >"}"\n \n "bassWords = \\lyricmode {"\n > "LYRICS"\n > "}"\n \n "\score {"\n > "\\new ChoirStaff << " \n \n > "\\new Lyrics = sopranos { s1 }" \n > "\\new Staff = women <<" \n > "\\new Voice =" \n > " \"sopranos\" { \\voiceOne << \\global \\sopMusic >> }" \n > "\\new Voice =" \n > " \"altos\" { \\voiceTwo << \\global \\altoMusic >> }" \n > ">>" \n > "\\new Lyrics = \"altos\" { s1 }" \n > "\\new Lyrics = \"tenors\" { s1 }" \n > "\\new Staff = men <<" \n > "\\clef bass" \n > "\\new Voice =" \n > " \"tenors\" { \\voiceOne <<\\global \\tenorMusic >> }" \n > "\\new Voice =" \n > "\"basses\" { \\voiceTwo <<\\global \\bassMusic >> }" \n > ">>" \n > "\\new Lyrics = basses { s1 }" \n \n > "\\context Lyrics = sopranos \\lyricsto sopranos \\sopWords" \n > "\\context Lyrics = altos \\lyricsto altos \\altoWords" \n > "\\context Lyrics = tenors \\lyricsto tenors \\tenorWords" \n > "\\context Lyrics = basses \\lyricsto basses \\bassWords" \n > ">>" \n \n > "\\layout {" \n > "\\context {" \n > " % a little smaller so lyrics" \n > " % can be closer to the staff" \n > "\\Staff" \n > "\\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)" \n > "}" \n > "}" \n > "}" \n ) (define-skeleton LilyPond-satb-piano-reduction "Insert form for satb score with piano reduction and place point at first insertion point" nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n " global = {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > "}" \n > "sopMusic = \\relative c'' {" \n > _ \n > "}" \n > "sopWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "altoMusic = \\relative c' {" \n > "INSERT NOTES" \n > "}" \n > "altoWords =\\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "tenorMusic = \\relative c' {" \n > "INSERT NOTES" \n > "}" \n > "tenorWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "bassMusic = \\relative c {" \n > "INSERT NOTES" \n > "}" \n > "bassWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "\\score {" \n > "<<" \n > "\\new ChoirStaff <<" \n > "\\new Lyrics = sopranos { s1 }" \n > "\\new Staff = women <<" \n > "\\new Voice =" \n > "\"sopranos\" { \\voiceOne << \\global \\sopMusic >> }" \n > "\\new Voice =" \n > "\"altos\" { \\voiceTwo << \\global \\altoMusic >> }" \n > ">>" \n > "\\new Lyrics = \"altos\" { s1 }" \n > "\\new Lyrics = \"tenors\" { s1 }" \n > "\\new Staff = men <<" \n > "\\clef bass" \n > "\\new Voice =" \n > "\"tenors\" { \\voiceOne <<\\global \\tenorMusic >> }" \n > "\\new Voice =" \n > "\"basses\" { \\voiceTwo <<\\global \\bassMusic >> }" \n > ">>" \n > "\\new Lyrics = basses { s1 }" \n \n > "\\context Lyrics = sopranos \\lyricsto sopranos \\sopWords" \n > "\\context Lyrics = altos \\lyricsto altos \\altoWords" \n > "\\context Lyrics = tenors \\lyricsto tenors \\tenorWords" \n > "\\context Lyrics = basses \\lyricsto basses \\bassWords" \n \n > "\\new PianoStaff <<" \n > "\\new Staff <<" \n > "\\set Staff.printPartCombineTexts = ##f" \n > "\\partcombine" \n > "<< \\global \\sopMusic >>" \n > "<< \\global \\altoMusic >>" \n \n > "\\new Staff <<" \n > "\\clef bass" \n > "\\set Staff.printPartCombineTexts = ##f" \n > "\\partcombine" \n > "<< \\global \\tenorMusic >>" \n > "<< \\global \\bassMusic >>" \n \n \n \n > "\\layout {" \n > "\\context {" \n > "% a little smaller so lyrics" \n > "% can be closer to the staff" \n > "\\Staff" \n > "\\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)" \n > "}" \n > "}" \n > "}" \n ) (define-skeleton LilyPond-satb-piano-reduction "Insert form for satb score with piano reduction and place point at first insertion point" nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n " global = {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > "}" \n > "\\version \"2.11.23\"" \n > "global = {" \n > "\\key c \\major" \n > "\\time 4/4" \n > "}" \n \n > "sopMusic = \\relative c'' {" \n > "INSERT NOTES" \n > "}" \n > "sopWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "altoMusic = \\relative c' {" \n > "INSERT NOTES" \n > "}" \n > "altoWords =\\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "tenorMusic = \\relative c' {" \n > "INSERT NOTES" \n > "}" \n > "tenorWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "bassMusic = \\relative c {" \n > "INSERT NOTES" \n > "}" \n > "bassWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "\\score {" \n > "\\new ChoirStaff <<" \n > "\\new Staff = women <<" \n > "\\new Voice =" \n > "\"sopranos\" { \\voiceOne << \\global \\sopMusic >> }" \n > "\\new Voice =" \n > "\"altos\" { \\voiceTwo << \\global \\altoMusic >> }" \n > ">>" \n > "\\new Lyrics \\with {alignAboveContext=women} \\lyricsto sopranos \\sopWords" \n > "\\new Lyrics \\with {alignBelowContext=women} \\lyricsto altos \\altoWords" \n > "% we could remove the line about this with the line below, since we want" \n > "% the alto lyrics to be below the alto Voice anyway." \n > "% \\new Lyrics \\lyricsto altos \\altoWords" \n \n > "\\new Staff = men <<" \n > "\\clef bass" \n > "\\new Voice =" \n > "\"tenors\" { \\voiceOne <<\\global \\tenorMusic >> }" \n > "\\new Voice =" \n > "\"basses\" { \\voiceTwo <<\\global \\bassMusic >> }" \n > ">>" \n \n > "\\new Lyrics \\with {alignAboveContext=men} \\lyricsto tenors \\tenorWords" \n > "\\new Lyrics \\with {alignBelowContext=men} \\lyricsto basses \\bassWords" \n > "% again, we could replace the line above this with the line below." \n > "% \\new Lyrics \\lyricsto basses \\bassWords" \n > ">>" \n \n > "\\layout {" \n > "\\context {" \n > "% a little smaller so lyrics" \n > "% can be closer to the staff" \n > "\\Staff" \n > "\\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)" \n > "}" \n > "}" \n > "}" \n ) (define-skeleton LilyPond-satb-aligned-contexts "Insert form for satb score with piano reduction and place point at first insertion point" nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n " global = {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > "}" \n > "\\score {" \n > "\\new ChoirStaff <<" \n > "\\new Staff = women <<" \n > "\\new Voice =" \n > "\"sopranos\" { \\voiceOne << \\global \\sopMusic >> }" \n > "\\new Voice =" \n > "\"altos\" { \\voiceTwo << \\global \\altoMusic >> }" \n > ">>" \n \n > "sopMusic = \\relative c'' {" \n > "INSERT NOTES" \n > "}" \n > "sopWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "altoMusic = \\relative c' {" \n > "INSERT NOTES" \n > "}" \n > "altoWords =\\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "tenorMusic = \\relative c' {" \n > "INSERT NOTES" \n > "}" \n > "tenorWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "bassMusic = \\relative c {" \n > "INSERT NOTES" \n > "}" \n > "bassWords = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "\\new Lyrics \\with {alignAboveContext=women} \\lyricsto sopranos \\sopWords" \n > "\\new Lyrics \\lyricsto altos \\altoWords" \n \n > "\\new Staff = men <<" \n > "\\clef bass" \n > "\\new Voice =" \n > "\"tenors\" { \\voiceOne <<\\global \\tenorMusic >> }" \n > "\\new Voice =" \n > "\"basses\" { \\voiceTwo <<\\global \\bassMusic >> }" \n > ">>" \n \n > "\\new Lyrics \\with {alignAboveContext=men} \\lyricsto tenors \\tenorWords" \n > "\\new Lyrics \\lyricsto basses \\bassWords" \n > ">>" \n \n > "\\layout {" \n > "\\context {" \n > "% a little smaller so lyrics" \n > "% can be closer to the staff" \n > "\\Staff" \n > "\\override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)" \n > "}" \n > "}" \n > "}" \n ) ;; String quartets (define-skeleton LilyPond-string-quartet "Insert a skeleton for a string quartet" nil > "\\version \"2.11.23\"" \n "%Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "global = {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\|" \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\|" 4/4" \n > "}" \n "violinOne = \\new Voice { \\relative c''{" \n > "\\set Staff.instrumentName = \"Violin 1\"" \n > _ \n > "\\bar \"|.\" }}" \n \n > " violinTwo = \\new Voice { \\relative c''{" \n > "\\set Staff.instrumentName = \"Violin 2\"" \n > "INSERT NOTES" \n > "\\bar \"|.\" }}" \n \n "viola = \\new Voice { \\relative c' {" \n > "\\set Staff.instrumentName = \"Viola\"" \n > "\\clef alto" \n > "INSERT NOTES" \n > "\\bar \"|.\" }}" \n \n > "cello = \\new Voice { \\relative c' {" \n > "\\set Staff.instrumentName = \"Cello\"" \n > "\\clef bass" \n > "INSERT NOTES" \n > "\\bar \"|.\"}}" \n \n "\\score {" \n > "\\new StaffGroup <<" \n > "\\new Staff << \\global \\violinOne >>" \n > "\\new Staff << \\global \\violinTwo >>" \n > "\\new Staff << \\global \\viola >>" \n > "\\new Staff << \\global \\cello >>" \n > " >>" \n \n > "\\layout { }" \n > "\\midi { }" \n > "}" \n ) ;; parts (define-skeleton LilyPond-string-quartet-parts "Insert the master skeleton for a string quartet." nil '(setq v1 (buffer-name)) > "%%%%% " v1 \n > "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "global = {" \n > "\\key "(skeleton-read "Key: ")\| " c"(skeleton-read "\\major or \\minor: ")\|" \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\|" 4/4" \n > "}" \n > \n > "Violinone = \\new Voice { \\relative c''{" \n > "\\set Staff.instrumentName = \"Violin 1\"" \n > _ \n > "\\bar \"|.\" }} %*********************************" \n \n > "Violintwo = \\new Voice { \\relative c''{" \n > "\\set Staff.instrumentName = \"Violin 2\"" \n > "INSERT NOTES" \n > "\\bar \"|.\" }} %*********************************" \n \n > "Viola = \\new Voice { \\relative c' {" \n > "\\set Staff.instrumentName = \"Viola\"" \n > "\\clef alto" \n > "INSERT NOTES" \n > "\\bar \"|.\" }} %*********************************" \n \n > "Cello = \\new Voice { \\relative c' {" \n > "\\set Staff.instrumentName = \"Cello\"" \n > "\\clef bass" \n > "INSERT NOTES" \n > "\\bar \"|.\"}} %**********************************" \n \n > "music = {" \n > "<<" \n > "\\tag #'score \\tag #'vn1 \\new Staff { << \\global \\Violinone >> }" \n > "\\tag #'score \\tag #'vn2 \\new Staff { << \\global \\Violintwo>> }" \n > "\\tag #'score \\tag #'vla \\new Staff { << \\global \\Viola>> }" \n > "\\tag #'score \\tag #'vlc \\new Staff { << \\global \\Cello>> }" \n > ">>" \n > "}" \n \n > "% You can call M-x LilyPond-sub-buffer in new buffer and get the related parts files." \n > "% And call M-x LilyPond-score-buffer in new buffer and get the related score.ly file." \n > "% It needs to be called score.ly or you need to change the \\tag #'score to whatever the name is." \n > "% If you name the parts files things like vn1.ly etc all will be well. If you name" \n > "% them some other name you will need to change the name of the \\tags in this file." \n ) (define-skeleton LilyPond-tags-section "Add a section for making parts files and instruction." nil > "music = {" \n > "<<" \n > "\\tag #'score \\tag #'vn1 \\new Staff { << \\global \\PART ONE >> }" \n > "\\tag #'score \\tag #'vn2 \\new Staff { << \\global \\PART TWO >> }" \n > "\\tag #'score \\tag #'vla \\new Staff { << \\global \\PART THREE >> }" \n > "\\tag #'score \\tag #'vlc \\new Staff { << \\global \\PART FOUR >> }" \n > ">>" \n > "}" \n \n > "% You can call M-x LilyPond-sub-buffer in new buffer and get the related parts files." \n > "% And call M-x LilyPond-score-buffer in new buffer and get the related score.ly file." \n > "% It needs to be called score.ly or you need to change the \\tag #'score to whatever the name is." \n > "% If you name the parts files things like vn1.ly etc all will be well. If you name" \n > "% them some other names you will need to change the name of the \\tags in this file." \n > "% You will need to change the variables for the music expression variables appropriately." \n ) (define-skeleton LilyPond-score-buffer "Inserts a skeleton for the score.ly file for doing parts." "What is the master file? " > "%%%%% score.ly" \n > "\\version \"2.11.23\"" \n "Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "\\include \"" str "\"" \n > "#(set-global-staff-size 14)" \n \n > "\\score {" \n > "\\new StaffGroup \keepWithTag #'score \music" \n > "\\layout {" _ "}" \n > "\\midi { }" \n > "}" \n ) (define-skeleton LilyPond-sub-buffer "Insert a buffer with skeleton to another related buffer" "What is your master file name? " '(setq v1 (buffer-name)) > "%%%%% " v1 \n > "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "\\include \"" str "\"" \n \n > "\\score {" \n '(setq v2 (substring v1 0 -3)) > "\\keepWithTag #'" v2 " \\music" \n > "\\layout {" _ " }" \n > "}" \n ) ;;; piano (define-skeleton LilyPond-solo-piano "Insert a simple piano staff." nil "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "global = {" \n > "\\key "(skeleton-read "Key: ")\| "c "(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| "4/4" \n > "}" > "upper = \\relative c'' {" \n "\\global" \n > _ \n > "}" \n \n > " lower = \\relative c {" \n "\\global"\n > "INSERT NOTES" \n > " }" \n \n "\\score {" \n > "\\new PianoStaff <<" \n > "\\set PianoStaff.instrumentName = \"Piano\"" \n > "\\new Staff = \"upper\" \\upper" \n > "\\new Staff = \"lower\" \\lower" \n > ">>" \n > "\\layout { }" \n > "\\midi { }" \n > "}" \n ) ;;;Piano and melody with lyrics (define-skeleton LilyPond-piano-melody-lyrics "Insert skeleton for melody with piano accompaniment." nil "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "global = {"\n > "\\key "(skeleton-read "Key: ")\| "c "(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| "4/4" \n > "}" \n "melody = \\relative c'' {" \n > "\\clef \"treble\""\n > _ \n > "}" \n \n "text = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n "upper = \\relative c'' {" \n > "\\clef \"treble\""\n > "INSERT NOTES" \n > "}" \n \n "lower = \\relative c {" \n > "\\clef \"bass\""\n > "INSERT NOTES" \n > "}" \n \n "\\score {" \n > "\\global" \n > "<<" \n > "\\new Voice = \"mel\" {" \n > "\\autoBeamOff" \n > "\\melody" \n > "}" \n \n > "\\new Lyrics \\lyricsto mel \\text" \n > "\\new PianoStaff <<" \n > "\\new Staff = \"upper\" \\upper" \n > "\\new Staff = \"lower\" \\lower" \n > ">>" \n > ">>" \n \n "\\layout {" \n > "\\context { \\RemoveEmptyStaffContext }" \n > "}" \n \n > "\\midi { }" \n > "}" \n ) ;;;Piano centered lyrics (define-skeleton LilyPond-piano-centered-lyrics "Insert a skeleton for piano with centered lyrics" nil "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "global = {" \n > "\\key "(skeleton-read "Key: ")\| "c "(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| "4/4" \n > "}" \n \n "upper = \\relative c'' {" \n > "\\global" \n > _ \n > "}" \n \n "lower = \\relative c {" \n > " \\global" \n > "INSERT NOTES" \n > "}" \n \n > "text = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n "\\score {" \n > "\\new GrandStaff <<" \n > "\\new Staff = upper { \\new Voice = \"singer\" \\upper }" \n > "\\new Lyrics \\lyricsto \"singer\" \\text" \n > "\\new Staff = lower {" \n > "\\clef bass" \n > "\\lower" \n > "}" \n > ">>" \n \n "\\layout {" \n > "\\context { \\GrandStaff \\accepts \"Lyrics\" }" \n > "\\context { \\Lyrics \\consists \"Bar_engraver\" }" \n > "}" \n \n > " \\midi { }" \n > "}" \n ) ;;;Piano centered dynamics (define-skeleton LilyPond-piano-centered-dynamics "Insert skeleton of piano staff with centered dynamics" "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "global = {" \n > "\\key "(skeleton-read "Key: ")\|"c "(skeleton-read "\\major, \\minor or \\dorian etc: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| "4/4" \n > "}" \n "upper = \\relative c'' {" \n > "\\clef treble" \n > "\\global" \n > _ \n > "}" \n \n "lower = \\relative c {" \n > "\\clef bass" \n > "\\global" \n > "INSERT NOTES" \n > "}" \n \n "dynamics = {" \n > "DYNAMICS % for example s2\\fff\\> s4 s\\!\\pp" \n > "}" \n \n "pedal = {" \n > "s2\\sustainDown s2\\sustainUp" \n > "}" \n \n "\\score {" \n > "\\new PianoStaff <<" \n > "\\new Staff = \"upper\" \\upper" \n > "\\new Dynamics = \"dynamics\" \\dynamics" \n > "\\new Staff = \"lower\" <<" \n > "\\clef bass" \n > "\\lower" \n > ">>" \n > "\\new Dynamics = \"pedal\" \\pedal" \n > ">>" \n "\\layout {" \n > "\\context {" \n > "\\type \"Engraver_group\"" \n > "\\name Dynamics" \n > "\\alias Voice % So that \\cresc works, for example." \n > "\\consists \"Output_property_engraver\"" \n \n > "\\override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)" \n > "pedalSustainStrings = #'(\"Ped.\" \"*Ped.\" \"*\")" \n > "pedalUnaCordaStrings = #'(\"una corda\" \"\" \"tre corde\")" \n \n > "\\consists \"Piano_pedal_engraver\"" \n > "\\consists \"Script_engraver\"" \n > "\\consists \"Dynamic_engraver\"" \n > "\\consists \"Text_engraver\"" \n \n > "\\override TextScript #'font-size = #2" \n > "\\override TextScript #'font-shape = #'italic" \n > "\\override DynamicText #'extra-offset = #'(0 . 2.5)" \n > "\\override Hairpin #'extra-offset = #'(0 . 2.5)" \n \n > "\\consists \"Skip_event_swallow_translator\"" \n \n > "\\consists \"Axis_group_engraver\"" \n > "}" \n \n "\\context {" \n > "\\PianoStaff" \n > "\\accepts Dynamics" \n > "\\override VerticalAlignment #'forced-distance = #7" \n > "}" \n > "}" \n > "}" \n \n "\\score {" \n > "\\new PianoStaff <<" \n > "\\new Staff = \"upper\" << \\upper \\dynamics >>" \n > "\\new Staff = \"lower\" << \\lower \\dynamics >>" \n > "\\new Dynamics = \"pedal\" \\pedal" \n > ">>" \n \n "\\midi {" \n > "\\context {" \n > "\\type \"Performer_group\"" \n > "\\name Dynamics" \n > "\\consists \"Piano_pedal_performer\"" \n > "}" \n \n "\\context {" \n > "\\PianoStaff" \n > "\\accepts Dynamics" \n > "}" \n > "}" \n > "}" \n ) ;;;Notes only (define-skeleton LilyPond-melody "Insert simple melody skeleton. Suitable for a solo instrument or a melodic fragment" nil > "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n "melody = \\relative c' {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > ("Sometimes we want to define clef: " "\\clef " str )\n resume: > _ \n > "}" \n \n "\\score {" \n > "\\new Staff \\melody" \n > "\\layout { }" \n > "\\midi {}" \n > "}" \n ) ;;; Vocal ;;;Notes and lyrics (define-skeleton LilyPond-melody-lyrics "Insert simple melody skeleton with lyrics. This example turns off automatic beaming, which is common for vocal parts. If you want to use automatic beaming, you'll have to change or comment out the relevant line." nil > " \\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n " melody = \\relative c' {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > ("Sometimes we want to define clef: " "\\clef " str )\n resume: > _ \n > " }" \n \n " text = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n "\\score{" \n > " <<" \n > "\\new Voice = \"one\" {" \n > "\\autoBeamOff %Comment out this line for autobeaming." \n > "\\melody" \n > "}" \n > "\\new Lyrics \\lyricsto \"one\" \\text" \n > " >>" \n " \\layout { }" \n " \\midi { }" \n > "}" \n ) ;;;Notes and chords (define-skeleton LilyPond-melody-chords "Insert simple melody skeleton with chords" nil > "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "melody = \\relative c' {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > ("Sometimes we want to define clef: " "\\clef " str ) resume: \n > _ \n > "}" \n \n > "harmonies = \\chordmode {" \n > "CHORDS %for example c d:dim e:sus4 (not real music!)" \n > "}" \n \n > "\\score {" \n > "<<" \n > "\\new ChordNames {" \n > "\\set chordChanges = ##t" \n > "\\harmonies" \n > "}" \n > "\\new Staff \\melody" \n > ">>" \n \n > "\\layout{ }" \n > "\\midi { }" \n > "}" \n ) ;;;Notes, lyrics, and chords. (define-skeleton LilyPond-leadsheet "Insert simple melody skeleton with lyrics and chords." nil > "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "melody = \\relative c' {" \n > "\\key "(skeleton-read "Key: ")\| " c"(skeleton-read "\\major, \\minor or \\ionian: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > ("Sometimes we want to define clef: " "\\clef " str )\n resume: > _ \n > "}" \n \n > "text = \\lyricmode {" \n > "LYRICS" \n > " }" \n \n > "harmonies = \\chordmode {" \n > "CHORDS" \n > "}" \n \n > "\\score {" \n > "<<" \n > "\\new ChordNames {" \n > "\\set chordChanges = ##t" \n > "\\harmonies" \n > "}" \n > "\\new Voice = \"one\" {" \n > "\\autoBeamOff %Comment out this line for autobeaming." \n > "\\melody" \n > "}" \n > "\\new Lyrics \\lyricsto \"one\" \\text" \n > ">>" \n > "\\layout { }" \n > "\\midi { }" \n > "}" \n ) ;;;Hymn template one set of lyrics for four parts. (define-skeleton LilyPond-hymn "Inserts a skeleton for a hymn-like vocal arrangement. One set of lyrics and four parts." nil "\\version \"2.11.23\"" \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "#(set-global-staff-size 20)" \n > "\\include \"english.ly\" %put your own favoured language file in here eg. italiano.ly etc " \n > "upperOne = " \n > "\\relative a'{" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| "4/4" \n \n > "\\voiceOne" \n > _ \n > "}" \n \n > "upperTwo = \\relative a'{" \n > "\\voiceTwo" \n > "INSERT NOTES" \n > "}" \n \n > "lowerOne = \\relative a {" \n > "\\voiceOne" \n > "INSERT NOTES" \n > "}" \n \n > "lowerTwo = \\relative c {" \n > "\\voiceTwo" \n > "INSERT NOTES" \n > "}" \n \n > "firstverse = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "secondverse = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "thirdverse = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "fourthverse = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "refrain = \\lyricmode {" \n > "REFRAIN" \n > "}" \n \n > "\\score{ " \n > "\\context StaffGroup <<" \n > "\\context Staff = \"upper\" " \n \n > "<<" \n > "\\clef treble" \n > "\\context Voice = \"one\" \\upperOne" \n > "\\context Voice = \"two\" \\upperTwo " \n > ">>" \n \n > "\\lyricsto \"one\" \\new Lyrics {" \n > "\\set stanza = \"1. \"" \n > "\\firstverse" \n > "}" \n \n > "\\lyricsto \"one\" \\new Lyrics {" \n > "\\set stanza = \"2. \"" \n > "\\secondverse " \n > "}" \n \n > "\\lyricsto \"one\" \\new Lyrics {" \n > "\\set stanza = \"3. \"" \n > "\\thirdverse " \n > "}" \n \n > "\\context Staff = \"lower\" <<" \n > "\\clef bass" \n > "\\context Voice = \"one\" \\lowerOne" \n > "\\context Voice = \"two\" \\lowerTwo" \n > ">>" \n > ">>" \n \n > "\\layout {" \n > "\\context{\\Lyrics" \n > "minimumVerticalExtent = #'(-0.5 . 3)" \n > "}" \n \n > "\\context{\\StaffGroup" \n > "\\remove \"Span_bar_engraver\"" \n > "}" \n \n > "\\context{\\Staff" \n > "minimumVerticalExtent = #'(-3 . 3)" \n > "autoBeaming = ##t" \n > "\\unset melismaBusyProperties " \n > "}" \n \n > "\\context{\\Score" \n > "barNumberVisibility = #all-invisible" \n > "}" \n > "}" \n \n > "\\midi { }" \n > "}" \n > "\\paper {" \n > "linewidth = 6\\in " \n > "indent = 0" \n > "pagenumber = \"no\"" \n > "}" \n ) ;;; ancient template (define-skeleton LilyPond-ancient-style "Insert the neomensural template exactly as in the documents as I don't know what is necessary" nil > "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "global = {" \n > "\\set Score.skipBars = ##t" \n \n > "% incipit" \n > "\\once \\override Score.SystemStartBracket #'transparent = ##t" \n > "\\override Score.SpacingSpanner #'spacing-increment = #1.0 % tight spacing" \n > "\\key f \\major" \n > "\\time 2/2" \n > "\\once \\override Staff.TimeSignature #'style = #'neomensural" \n > "\\override Voice.NoteHead #'style = #'neomensural" \n > "\\override Voice.Rest #'style = #'neomensural" \n > "\\set Staff.printKeyCancellation = ##f" \n > "\\cadenzaOn % turn off bar lines" \n > "\\skip 1*10" \n > "\\once \\override Staff.BarLine #'transparent = ##f" \n > "\\bar \"\|\|\"" \n > "\\skip 1*1 % need this extra \\skip such that clef change comes" \n > "% after bar line" \n > "\\bar \"\"" \n \n > "% main" \n > "\\revert Score.SpacingSpanner #'spacing-increment % CHECK: no effect?" \n > "\\cadenzaOff % turn bar lines on again" \n > "\\once \\override Staff.Clef #'full-size-change = ##t" \n > "\\set Staff.forceClef = ##t" \n > "\\key g \\major" \n > "\\time 4/4" \n > "\\override Voice.NoteHead #'style = #'default" \n > "\\override Voice.Rest #'style = #'default" \n \n > "% FIXME: setting printKeyCancellation back to #t must not" \n > "% occur in the first bar after the incipit. Dto. for forceClef." \n > "% Therefore, we need an extra \\skip." \n > "\\skip 1*1" \n > "\\set Staff.printKeyCancellation = ##t" \n > "\\set Staff.forceClef = ##f" \n \n > "\\skip 1*7 % the actual music" \n \n > "% let finis bar go through all staves" \n > "\\override Staff.BarLine #'transparent = ##f" \n \n > "% finis bar" \n > "\\bar \"\|.\"" \n > "}" \n \n > "discantusNotes = {" \n > "\\transpose c' c'' {" \n > "\\set Staff.instrumentName = \"Discantus\"" \n \n > "% incipit" \n > "\\clef \"neomensural-c1\"" \n > "INSERT NOTES" \n \n > "% main" \n > "\\clef \"treble\"" \n > "INSERT NOTES" \n > "}" \n > "}" \n \n > "discantusLyrics = \\lyricmode {" \n > "% incipit" \n > "IV-" \n \n > "% main" \n > "LYRICS" \n > "}" \n \n > "altusNotes = {" \n > "\\transpose c' c'' {" \n > "\\set Staff.instrumentName = \"Altus\"" \n \n > "% incipit" \n > "\\clef \"neomensural-c3\"" \n > "INSERT NOTES" \n \n > "% main" \n > "\\clef \"treble\"" \n > "INSERT NOTES" \n > "}" \n > "}" \n \n > "altusLyrics = \\lyricmode {" \n > "% incipit" \n > "IV-" \n \n > "% main" \n > "LYRICS" \n > "}" \n \n > "tenorNotes = {" \n > "\\transpose c' c' {" \n > "\\set Staff.instrumentName = \"Tenor\"" \n \n > "% incipit" \n > "\\clef \"neomensural-c4\"" \n > "INSERT NOTES" \n \n > "% main" \n > "\\clef \"treble_8\"" \n > "INSERT NOTES" \n > "}" \n > "}" \n \n > "tenorLyrics = \\lyricmode {" \n > "% incipit" \n > "IV-" \n \n > "% main" \n > "LYRICS" \n > "}" \n \n > "bassusNotes = {" \n > "\\transpose c' c' {" \n > "\\set Staff.instrumentName = \"Bassus\"" \n \n > "% incipit" \n > "\\clef \"bass\"" \n > "INSERT NOTES" \n \n > "% main" \n > "\\clef \"bass\"" \n > "INSERT NOTES" \n > "}" \n > "}" \n \n > "bassusLyrics = \\lyricmode {" \n > "% incipit" \n > "IV-" \n \n > "% main" \n > "LYRICS" \n \n > "\\score {" \n > "\\new StaffGroup = choirStaff <<" \n > "\\new Voice =" \n > "\"discantusNotes\" << \\global \\discantusNotes >>" \n > "\\new Lyrics =" \n > "\"discantusLyrics\" \\lyricsto discantusNotes { \\discantusLyrics }" \n > "\\new Voice =" \n > "\"altusNotes\" << \\global \\altusNotes >>" \n > "\\new Lyrics =" \n > "\"altusLyrics\" \\lyricsto altusNotes { \\altusLyrics }" \n > "\\new Voice =" \n > "\"tenorNotes\" << \\global \\tenorNotes >>" \n > "\\new Lyrics =" \n > "\"tenorLyrics\" \\lyricsto tenorNotes { \\tenorLyrics }" \n > "\\new Voice =" \n > "\"bassusNotes\" << \\global \\bassusNotes >>" \n > "\\new Lyrics =" \n > "\"bassusLyrics\" \\lyricsto bassusNotes { \\bassusLyrics }" \n > ">>" \n > "\\layout {" \n > "\\context {" \n > "\\Score" \n \n > "% no bars in staves" \n > "\\override BarLine #'transparent = ##t" \n \n > "% incipit should not start with a start delimiter" \n > "\\remove \"System_start_delimiter_engraver\"" \n > "}" \n > "\\context {" \n > "\\Voice" \n \n > "% no slurs" \n > "\\override Slur #'transparent = ##t" \n \n > "% Comment in the below \"\\remove\" command to allow line" \n > "% breaking also at those barlines where a note overlaps" \n > "% into the next bar. The command is commented out in this" \n > "% short example score, but especially for large scores, you" \n > "% will typically yield better line breaking and thus improve" \n > "% overall spacing if you comment in the following command." \n > "%\\remove \"Forbid_line_break_engraver\"" \n > "}" \n > "}" \n > "}" \n ) (define-skeleton LilyPond-gregorian-transcription "Insert template for modern gregorian score and place cursor at first insertion point" nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n \n > "\\include \"gregorian-init.ly\"" \n > "\\version \"2.11.23\"" \n \n > "chant = \\relative c' {" \n > "\\set Score.timing = ##f" \n > "INSERT NOTES \\divisioMinima" \n > "INSERT NOTES \\divisioMaior" \n > "INSERT NOTES \\finalis" \n > "}" \n \n > "verba = \\lyricmode {" \n > "LYRICS" \n > "}" \n \n > "\\score {" \n > "\\new Staff <<" \n > "\\new Voice = \"melody\" {" \n > "\\chant" \n > "}" \n > "\\new Lyrics = \"one\" \\lyricsto melody \\verba" \n > ">>" \n \n > "\\layout {" \n > "\\context {" \n > "\\Staff" \n > "\\remove \"Time_signature_engraver\"" \n > "\\remove \"Bar_engraver\"" \n > "\\override Stem #'transparent = ##t" \n > "}" \n > "\\context {" \n > "\\Voice" \n > "\\override Stem #'length = #0" \n > "}" \n > "\\context {" \n > "\\Score" \n > "barAlways = ##t" \n > "}" \n > "}" \n > "}" \n ) ;;; instrumental (define-skeleton LilyPond-jazz-combo "Insert template for jazz combo for horns, guitar, piano, bass, and drums. Place point at first insertion point" nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "#(set-global-staff-size 16)" \n > "\\include \"english.ly\"" \n \n " global = {" \n > "\\key "(skeleton-read "Key: ")\|" c"(skeleton-read "\\major or \\minor: ")\| " \\major" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\| " 4/4" \n > "}" \n "% LilyPond example file by Amelie Zapf," \n > "%%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%" \n \n > "sl = {" \n > "\\override NoteHead #'style = #'slash" \n > "\\override Stem #'transparent = ##t" \n > "}" \n > "nsl = {" \n > "\\revert NoteHead #'style" \n > "\\revert Stem #'transparent" \n > "}" \n > "cr = \\override NoteHead #'style = #'cross" \n > "ncr = \\revert NoteHead #'style" \n \n > "%% insert chord name style stuff here." \n \n > "jzchords = { }" \n \n \n > "% ############ Horns ############" \n \n > "% ------ Trumpet ------" \n > "trpt = \\transpose c d \\relative c'' {" \n > "INSERT NOTES" \n > "}" \n > "trpharmony = \\transpose c' d {" \n > "\\jzchords" \n > "}" \n > "trumpet = {" \n > "\\global" \n > "\\set Staff.instrumentName = #\"Trumpet\"" \n > "\\clef treble" \n > "<<" \n > "\\trpt" \n > ">>" \n > "}" \n \n > "% ------ Alto Saxophone ------" \n > "alto = \\transpose c a \\relative c' {" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n > "altoharmony = \\transpose c' a {" \n > "\\jzchords" \n > "}" \n > "altosax = {" \n > "\\global" \n > "\\set Staff.instrumentName = #\"Alto Sax\"" \n > "\\clef treble" \n > "<<" \n > "\\alto" \n > ">>" \n > "}" \n \n > "% ------ Baritone Saxophone ------" \n > "bari = \\transpose c a' \\relative c {" \n > "\\Key" \n > "INSERT NOTES % eg. c1 c \\sl d4^\"Solo\" d d d \\nsl" \n > "}" \n > "bariharmony = \\transpose c' a \\chordmode {" \n > "\\jzchords" \n > "}" \n > "barisax = {" \n > "\\global" \n > "\\set Staff.instrumentName = #\"Bari Sax\"" \n > "\\clef treble" \n > "<<" \n > "\\bari" \n > ">>" \n > "}" \n \n > "% ------ Trombone ------" \n > "tbone = \\relative c {" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n > "tboneharmony = \\chordmode {" \n > "\\jzchords" \n > "}" \n > "trombone = {" \n > "\\global" \n > "\\set Staff.instrumentName = #\"Trombone\"" \n > "\\clef bass" \n > "<<" \n > "\\tbone" \n > ">>" \n > "}" \n \n > "% ############ Rhythm Section #############" \n \n > "% ------ Guitar ------" \n > "gtr = \\relative c'' {" \n > "INSERT NOTES" \n > "}" \n > "gtrharmony = \\chordmode {" \n > "\\jzchords" \n > "CHORDS %eg s1 c2:min7+ d2:maj9" \n > "}" \n > "guitar = {" \n > "\\global" \n > "\\set Staff.instrumentName = #\"Guitar\"" \n > "\\clef treble" \n > "<<" \n > "\\gtr" \n > ">>" \n > "}" \n \n > "%% ------ Piano ------" \n > "rhUpper = \\relative c'' {" \n > "\\voiceOne" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n > "rhLower = \\relative c' {" \n > "\\voiceTwo" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n \n > "lhUpper = \\relative c' {" \n > "\\voiceOne" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n > "lhLower = \\relative c {" \n > "\\voiceTwo" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n \n > "PianoRH = {" \n > "\\clef treble" \n > "\\global" \n > "\\set Staff.midiInstrument = \"acoustic grand\"" \n > "<<" \n > "\\new Voice = \"one\" \\rhUpper" \n > "\\new Voice = \"two\" \\rhLower" \n > ">>" \n > "}" \n > "PianoLH = {" \n > "\\clef bass" \n > "\\global" \n > "\\set Staff.midiInstrument = \"acoustic grand\"" \n > "<<" \n > "\\new Voice = \"one\" \\lhUpper" \n > "\\new Voice = \"two\" \\lhLower" \n > ">>" \n > "}" \n \n > "piano = {" \n > "<<" \n > "\\set PianoStaff.instrumentName = #\"Piano\"" \n > "\\new Staff = \"upper\" \\PianoRH" \n > "\\new Staff = \"lower\" \\PianoLH" \n > ">>" \n > "}" \n \n > "% ------ Bass Guitar ------" \n > "Bass = \\relative c {" \n > "\\Key" \n > "INSERT NOTES" \n > "}" \n > "bass = {" \n > "\\global" \n > "\\set Staff.instrumentName = #\"Bass\"" \n > "\\clef bass" \n > "<<" \n > "\\Bass" \n > ">>" \n > "}" \n \n > "% ------ Drums ------" \n > "up = \\drummode {" \n > "INSERT NOTES %eg. hh4 4 hh hh 4" \n > "}" \n \n > "down = \\drummode {" \n > "INSERT NOTES %eg.bd4 s bd s bd s bd s bd s bd s" \n > "}" \n \n > "drumContents = {" \n > "\\global" \n > "<<" \n > "\\set DrumStaff.instrumentName = #\"Drums\"" \n > "\\new DrumVoice { \\voiceOne \\up }" \n > "\\new DrumVoice { \\voiceTwo \\down }" \n > ">>" \n > "}" \n \n > "%%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%" \n \n > "\\score {" \n > "<<" \n > "\\new StaffGroup = \"horns\" <<" \n > "\\new Staff = \"trumpet\" \\trumpet" \n > "\\new Staff = \"altosax\" \\altosax" \n > "\\new ChordNames = \"barichords\" \\bariharmony" \n > "\\new Staff = \"barisax\" \\barisax" \n > "\\new Staff = \"trombone\" \\trombone" \n > ">>" \n \n > "\\new StaffGroup = \"rhythm\" <<" \n > "\\new ChordNames = \"chords\" \\gtrharmony" \n > "\\new Staff = \"guitar\" \\guitar" \n > "\\new PianoStaff = \"piano\" \\piano" \n > "\\new Staff = \"bass\" \\bass" \n > "\\new DrumStaff { \\drumContents }" \n > ">>" \n > ">>" \n \n > "\\layout {" \n > "\\context { \\RemoveEmptyStaffContext }" \n > "\\context {" \n > "\\Score" \n > "\\override BarNumber #'padding = #3" \n > "\\override RehearsalMark #'padding = #2" \n > "skipBars = ##t" \n > "}" \n > "}" \n \n > "\\midi { }" \n > "}" \n ) (define-skeleton LilyPond-bagpipe-skeleton "Insert a template for bagpipes and leave cursor at insertion point." nil "\\version \"2.11.23\" " \n "% Use convert-ly to update this file if the version is different to the lilypond you use." \n \n > "\\include \"bagpipe.ly\"" \n > "% If you are on Linux, the file in the other buffer is bagpipe.ly."\n > "%It has some useful variables you can use." \n > "\\layout {" \n > "indent = 0.0\\cm" \n > "\\context { \\Score \\remove \"Bar_number_engraver\" }" \n > "}" \n \n > "{" \n > "\\hideKeySignature" \n > "\\time "(skeleton-read "Time, needs to be of form N/N: ")\|" 4/4" \n > "INSERT NOTES %eg. \\grg \\partial 4 a8. d16" \n > "\\bar \"|.\"" \n > "}" \n ) (defun LilyPond-bagpipe () "Insert a template for bagpipes and open bagpipe.ly in other window. Which has a number very useful variables for bagpipe music." (interactive) (LilyPond-bagpipe-skeleton) (cond ((string-match "linux" system-configuration) (let ((bagpipes (car (split-string (shell-command-to-string "locate /bagpipe.ly"))))) (view-file-other-window bagpipes))) ((string-match "bsd" system-configuration);trial (let ((bagpipes (car (split-string (shell-command-to-string "locate /bagpipe.ly"))))) (view-file-other-window bagpipes))) ((string-match "cygwin" system-configuration);trial (let ((bagpipes (car (split-string (shell-command-to-string "locate /bagpipe.ly"))))) (view-file-other-window bagpipes))) ((string-match "osx" system-configuration);trial (let ((bagpipes (car (split-string (shell-command-to-string "locate /bagpipe.ly"))))) (view-file-other-window bagpipes))) ((string-match "mingw" system-configuration) (message "%s" "Sorry, I can't open bagpipes.ly on Windows"))));this is simply cause I ;cannot work out how to do it. ;; I did try this: ;; ((string-match "mingw" system-configuration) ;; (let ((bagpipes (car (split-string (shell-command-to-string "dir c:\\ /s /b | find \"bagpipe.ly\""))))) ;; (view-file-other-window bagpipes))) ;; However emacs functions choke on the space between "Program Files" ;; and I am not skilled enough to get over this hurdle. som. It's the let that complains. ;;; education helpers (define-skeleton learning-clefs " Make a page of trable clefs for children to practice writing." nil > "\\version \"2.11.35\"" \n \n > "\\layout{ indent = #0 }" \n \n > "violinsettings = {" \n > "%I don't want to change the Clef's size " \n > "\\override Staff.Clef #'full-size-change = ##t" \n > "%I'd like many violin cleffs" \n > "\\override Staff.Clef #'break-visibility = ##(#t #t #t)" \n > "%Let the Clef's color grey, so children can redraw it with" \n > "%a pencil" \n > "\\override Staff.Clef #'color = #(x11-color 'grey80)" \n > "}" \n > "%----------------------------------------------" \n > "%The big violins" \n > "%----------------------------------------------" \n > "\\new Score \\with {" \n > "\\override TimeSignature #'transparent = ##t defaultBarType = #\"\"" \n > "\\remove Bar_number_engraver" \n > "} <<" \n > "" \n > "" \n > "\\new Staff {" \n > "\\override Staff.StaffSymbol #'staff-space = #4" \n > "\\override Staff.Clef #'font-size = #+12 s1" \n > "% Let the first violin black" \n > "\\violinsettings" \n > "s1 s1 s1 s1 s1 \\break" \n > "s1 s1 s1 s1 \\break" \n > "}" \n > ">>" \n > "" \n > "%----------------------------------------------" \n > "%The medium-sized violins" \n > "%----------------------------------------------" \n > "\\new Score \\with {" \n > "\\override TimeSignature #'transparent = ##t defaultBarType = #\"\"" \n > "\\remove Bar_number_engraver" \n > "} <<" \n > "" \n > "\\new Staff {" \n > "\\override Staff.StaffSymbol #'staff-space = #2 \\override" \n > "Staff.Clef #'font-size = #+6 s1" \n > "\\violinsettings" \n > "s1 s1 s1 s1 s1 s1 s1 \\break" \n > "s1 s1 s1 s1 s1 s1 \\break" \n > "}" \n > ">>" \n > " " \n > "%----------------------------------------------" \n > "%The normal-sized violins" \n > "%----------------------------------------------" \n > "\\new Score \\with {" \n > "\\override TimeSignature #'transparent = ##t defaultBarType = #\"\"" \n > "\\remove Bar_number_engraver" \n > "} <<" \n > "" \n > "\\new Staff {" \n > "s1" \n > "\\violinsettings" \n > "s1 s1 s1 s1 s1 s1 s1 s1 s1 s1 s1 \\break s1 s1 s1 s1 s1 s1" \n > "\\break" \n > "}" \n > ">>" \n ) ;;; various useful skeletons ;;transpose skeleton. where the key to transpose from and to are asked ;;for. I left out the braces as sometimes variables are used. (define-skeleton LilyPond-transpose-region "Insert region into a transpose asking for key from and to." nil "\\transpose "(skeleton-read "From: ")" "(skeleton-read "To: ")" " _ ) (define-skeleton LilyPond-tuplet "Wrap a region in or insert a triplet or tuplet" nil "\\times "(skeleton-read "Duration of notes/Number of notes eg:2/3 ") " { " _ " } " ;note in future the syntax is likely to use \tuplet not \times. ) (define-skeleton LilyPond-slur "Wrap a region in a slur structure" nil "( " _ ")" ) (define-skeleton LilyPond-phrase "Insert a phrasing slur" nil "\\( " _ "\\) " ) (define-skeleton LilyPond-manual-beams "Insert manual beams" nil "[ " _ "] " ) (define-skeleton LilyPond-partial "Insert a \\partial " nil "\\partial "(skeleton-read "Length of note*number of notes eg: 8*5 ")" " _ " \|" ) (define-skeleton LilyPond-cadenza "Insert or wrap a region" nil "\\cadenzaOn " _ " \\cadenzaOff " ) (define-skeleton LilyPond-crescendo "Insert a crescendo" nil "\\< " _ "\\! " ) (define-skeleton LilyPond-trill "Insert a trill" nil "\\startTrillSpan " _ "\\stopTrillSpan " ) (define-skeleton LilyPond-pedal " " nil "\\sustainDown " _ "\\sustainUp " ) (define-skeleton LilyPond-horizontal-bracket "Insert analysis brackets or wrap a region in analysis brackets. Put \\Staff \\consists \"Horizontal_bracket_engraver\" in the layout block." nil "\\startGroup " _ "\\stopGroup " ) (define-skeleton LilyPond-sostenuto "Insert or wrap a region with sostenuto pedal." nil "\\sostenutoDown" _ "\\sostenutoUp " ) (define-skeleton LilyPond-repeat "Insert a repeat structure without an alternate ending." nil "\\repeat "(skeleton-read "volta, unfold, tremolo, percent: ")" "(skeleton-read "how many times? ") " { " _ " } " ) (define-skeleton LilyPond-repeat-alternate "Insert a repeat structure with an alternate ending. Uses volta." nil "\\repeat volta "(skeleton-read "how many times? ") " { " _ " } " \n > "\\alternative {" \n > "{ INSERT NOTES } { INSERT NOTES } { ANY MORE? }"\n > "}" \n ) (define-skeleton LilyPond-text-spanner "Insert a text spanner. Some tweaks are #'edge-text #'dash-period #'style #'edge-height #'dash-fraction #'thickness. You can have more than one \override tweak. Some examples of TextSpanner tweaks. \override TextSpanner #'dash-period = #2 \override TextSpanner #'dash-fraction = #0.0 \override TextSpanner #'style = #'dashed-line \override TextSpanner #'edge-height = #'(1 . -2) \override TextSpanner #'dash-period = #10 \override TextSpanner #'dash-fraction = #.5 \override TextSpanner #'thickness = #10" nil ("What kind of text spanner? For example; edge-text, style, or dash-period?: ""\\override TextSpanner #'"str" = #"(skeleton-read "What value; can be a number, 'string or '(list): "))\n >" SINGLE NOTE \\startTextSpan " _ " \\stopTextSpan" ) (define-key LilyPond-mode-map "\C-cy" 'LilyPond-transpose-region) (define-key LilyPond-mode-map "\C-ce" 'LilyPond-partial) (define-key LilyPond-mode-map "\C-ct" 'LilyPond-tuplet) (define-key LilyPond-mode-map "\C-cj" 'LilyPond-slur) (define-key LilyPond-mode-map "\C-cz" 'LilyPond-phrase) (define-key LilyPond-mode-map "\C-cw" 'LilyPond-manual-beams) (define-key LilyPond-mode-map "\C-cc" 'LilyPond-cadenza) (define-key LilyPond-mode-map "\C-cs" 'LilyPond-crescendo) (define-key LilyPond-mode-map "\C-cr" 'LilyPond-trill) (define-key LilyPond-mode-map "\C-ce" 'LilyPond-pedal) (define-key LilyPond-mode-map "\C-cu" 'LilyPond-sostenuto) (define-key LilyPond-mode-map (kbd "C-c x 1") 'LilyPond-repeat) (define-key LilyPond-mode-map (kbd "C-c x 2") 'LilyPond-repeat-alternate) (define-key LilyPond-mode-map "\C-cn" 'LilyPond-text-spanner) (define-key LilyPond-mode-map "\C-ch" 'LilyPond-header) (define-key LilyPond-mode-map "\C-cg" 'LilyPond-tags-section) (define-key LilyPond-mode-map "\C-cv" 'LilyPond-variable) (easy-menu-define LilyPond-skeletons-menu LilyPond-mode-map "Menu used in LilyPond mode." (append '("Templates") '(("Vocal Templates" [ "Melody with Lyrics" LilyPond-melody-lyrics t] [ "Leadsheet" LilyPond-leadsheet t] [ "Vocal Ensemble" LilyPond-vocal-ensemble t] [ "SATB & Piano Reduction" LilyPond-satb-piano-reduction t] [ "SATB aligned contexts" LilyPond-satb-aligned-contexts t] [ "Hymn Template" LilyPond-hymn t] [ "Gregorian" LilyPond-gregorian-transcription t] )) '(("Empty Templates" ;; ["Music "] ["Learning Treble Clefs" learning-clefs t] )) '(("Piano Templates" [ "Solo Piano" LilyPond-solo-piano t] [ "Piano with Lyrics" LilyPond-piano-melody-lyrics t] [ "Piano with Centred Lyrics" LilyPond-piano-centered-lyrics t] [ "Piano with Centred Dynamics" LilyPond-piano-centered-dynamics t] )) '(("Other Templates" [ "String Quartet" LilyPond-string-quartet t] [ "Ancient Notation Style" LilyPond-ancient-style t] [ "Bagpipe" LilyPond-bagpipe t] [ "Jazz Combo" LilyPond-jazz-combo t] [ "LilyBook Template" LilyPond-book-skeleton t] [ "Lilybook Snippet" LilyPond-snippet t])) '(("Parts extraction" [ "String Quartet with Parts" LilyPond-string-quartet-parts t] [ "Parts file" LilyPond-sub-buffer t] [ "Score file" LilyPond-score-buffer t] [ "Tags Section" LilyPond-tags-section t])) '([ "Title Header" LilyPond-header t]) '([ "Transpose Region" LilyPond-transpose-region t]) '([ "Partial" LilyPond-partial t]) '([ "Tuplet" LilyPond-tuplet t]) '([ "Slur" LilyPond-slur t ]) '([ "Phrase" LilyPond-phrase t ]) '([ "Manual Beams" LilyPond-manual-beams t]) '([ "Cadenza" LilyPond-cadenza t]) '([ "Crescendo" LilyPond-crescendo t]) '([ "Trill" LilyPond-trill t]) '([ "Pedal" LilyPond-pedal t]) '([ "Sostenuto" LilyPond-sostenuto t]) '([ "Simple Repeat" LilyPond-repeat t]) '([ "Repeat with Alternate" LilyPond-repeat-alternate t]) '([ "Text Spanner" LilyPond-text-spanner t]) '("-----") '([ "Global Variable" LilyPond-global t]) '([ "General Variable" LilyPond-var-block t]) )) ;; font-lock-add-keywords So the words to replace are obvious. ;;"\\<\\(ANY\\|CHORDS\\|DYNAMICS\\|F\\(?:IVE\\|OUR\\)\\|INSERT\\|LYRICS\\|MORE\\|NOTES?\\|ONE\\|PART\\|REFRAIN\\|SI\\(?:NGLE\\|X\\)\\|T\\(?:HREE\\|WO\\)\\)\\>" (add-hook 'LilyPond-mode (lambda ()(font-lock-add-keywords nil '(("\\<\\(ANY\\|CHORDS\\|DYNAMICS\\|F\\(?:IVE\\|OUR\\)\\|INSERT\\|LYRICS\\|MORE\\|NOTES?\\|ONE\\|PART\\|REFRAIN\\|SI\\(?:NGLE\\|X\\)\\|T\\(?:HREE\\|WO\\)\\)\\>" . font-lock-warning-face))))) ;;"\\<[[:upper:]]+\\>" ;; I'm inclined to think that this is superfluous. However, people might like abbrevs and ;; they should know how to do them if they want them. ;; (defvar LilyPond-mode-abbrev-table ;; (let ((ac abbrevs-changed)) ;; (define-abbrev LilyPond-mode-abbrev-table "lph" "" ;; 'LilyPond-header) ;; (define-abbrev LilyPond-mode-abbrev-table "lpg" "" ;; 'LilyPond-global) ;; (define-abbrev LilyPond-mode-abbrev-table "lpve" "" ;; 'LilyPond-vocal-ensemble) ;; (define-abbrev LilyPond-mode-abbrev-table "lpgm" "" ;; 'LilyPond-global-min) ;; (define-abbrev LilyPond-mode-abbrev-table "lpbk" "" ;; 'LilyPond-book-skeleton) ;; (define-abbrev LilyPond-mode-abbrev-table "lpsn" "" ;; 'LilyPond-snippet) ;; (define-abbrev LilyPond-mode-abbrev-table "lpbc" "" ;; 'LilyPond-block-comment) ;; ;;You get the idea. However, the keybindings are probably better to learn. ;; (setq abbrevs-changed ac) ;; LilyPond-mode-abbrev-table)) (provide 'lilypond-skeletons) ;;; lilypond-skeletons.el ends here