diff --git a/.gitignore b/.gitignore index bd55f6c..9c0039b 100755 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ -.gitignore *.ps *.pdf *.png *.log *tmp* *.py +*.toc +*.aux _output/ pdf/ -fullscores/ fullscores/* diff --git a/4-4_marches/the_pikemans_march/drums.ly b/4-4_marches/the_pikemans_march/drums.ly index de9beec..a68bdc2 100755 --- a/4-4_marches/the_pikemans_march/drums.ly +++ b/4-4_marches/the_pikemans_march/drums.ly @@ -43,6 +43,7 @@ \tenorAB s8 + s8 \tenorBA \tenorBB \tenorBC diff --git a/4-4_marches/the_pikemans_march/notes.tenor.ily b/4-4_marches/the_pikemans_march/notes.tenor.ily index 5473491..628086f 100755 --- a/4-4_marches/the_pikemans_march/notes.tenor.ily +++ b/4-4_marches/the_pikemans_march/notes.tenor.ily @@ -1,7 +1,7 @@ % 4/4 The Pikeman's March % Tenor \version "2.18.2" -composerTenor = "E.T. de Boone, 2015" +composerTenor = "E.T. de Boone, v0.3, 2015" %%music tenorAA = \drummode { @@ -26,8 +26,16 @@ tenorAB = \drummode { } % Part 2 tenorBA = \drummode { + d8-_ g + d8 g + d8 g + d8 g + | + s1*3 } tenorBB = \drummode { + s1*4 } tenorBC = \drummode { -} \ No newline at end of file + s1*4 +} diff --git a/4-4_marches/the_pikemans_march/side.ly b/4-4_marches/the_pikemans_march/side.ly index 995938f..6aac954 100755 --- a/4-4_marches/the_pikemans_march/side.ly +++ b/4-4_marches/the_pikemans_march/side.ly @@ -1,7 +1,7 @@ \version "2.18.2" \include "config.ily" -\include "notes.side.v1.5.ily" +\include "notes.side.v1.6.ily" \score { \new PipeBandDrumStaff { diff --git a/4-4_marches/the_pikemans_march/tenor.ly b/4-4_marches/the_pikemans_march/tenor.ly index 9be85a5..86e7e61 100755 --- a/4-4_marches/the_pikemans_march/tenor.ly +++ b/4-4_marches/the_pikemans_march/tenor.ly @@ -16,6 +16,7 @@ \tenorAA \tenorAB + s8 \tenorBA \tenorBB \tenorBC diff --git a/airs/alexander_mackenzie/notes.side.ily b/airs/alexander_mackenzie/notes.side.ily index dfb6475..0df83a0 100755 --- a/airs/alexander_mackenzie/notes.side.ily +++ b/airs/alexander_mackenzie/notes.side.ily @@ -2,27 +2,35 @@ % Side \version "2.18.2" composerSide = "" -snareA = \drummode { +snareAA = \drummode { d16. g32 | d8:32( d8.)-> g16 d4:32( d8) | \dragd d16. d32-> g16. g32 \flamd d8 d4.:32( | - d4) d16. g32 d8:32( d8) g8 | - \flamd d16. g32 d16. \flamg g32 d16. g32 \flamd d4 d16. g32 | + d4) d16. g32 d8:32( d8) g8 | + \flamd d16. g32 d16. \flamg g32 d16. g32 \flamd d4 +} +snareAB = \drummode { + d16. g32 | d8:32( d8.)-> g16 d4:32( d8) | \dragd d16. d32-> g16. g32 \flamd d8 d4:32( d16.) g32 | + d8:32( g16.) d32-> g16. g32 d8:32( g16.) d32-> g16. g32 | d4.:32( d4) } snareBA = \drummode { d8:32( | - g4) \flamd d16. g32 d8:32( g8) \flamd d8 | - d32-> g32 d32 g32 d32 g32 d32 g32-> d32 g32 d32 g32 d4-> d8:32( | - g4) \flamd d16. g32 d8:32( g8.) g16 | - d4.:32( d4) d8:32( | + g4) \flamd d16. g32 d8:32( d8) \flamd d8 | + d32-> g32 d32 g32 d32 g32 d32 g32-> d32 g32 d32 g32 d4-> d8:32( - g4) \flamd d16. g32 d8:32( g8) \flamd d8 | + g4) \flamd d16. g32 d8:32( d8.) g16 | + d4.:32( d4) +} +snareBB = \drummode { + d8:32( | + g4) \flamd d16. g32 d8:32( d8) \flamd d8 | d32-> g32 d32 g32 d32 g32 d32 g32-> d32 g32 d32 g32 d4-> \flamd d16. g32 | + d8:32( g16.) d32-> g16. g32 d8:32( g16.) d32-> g16. g32 | d4.:32( d4) -} \ No newline at end of file +} diff --git a/airs/alexander_mackenzie/side.ly b/airs/alexander_mackenzie/side.ly index 7f7d71a..bfabc04 100755 --- a/airs/alexander_mackenzie/side.ly +++ b/airs/alexander_mackenzie/side.ly @@ -6,24 +6,26 @@ \score { \new PipeBandDrumStaff { \global - << - { - \repeat volta 2 { \part \line \break } \break - \part \line \bar "||" \break - \part \line \bar "|." - } - { - \snareA s8 + << + { + \repeat volta 2 { \part \line \break } \break + \repeat volta 2 { \part \halfline \break } + \alternative{ {\part \halfline \break}{\part \halfline \break} } + \bar "|." + } + { + \snareAA \snareAB s8 - \snareBA s8 - \snareA s8 - } - >> - } - \header { - title = \title - meter = \meter - instrument = \instrumentSide - composer = \composerSide - } -} \ No newline at end of file + \snareBA s8 + \snareBB s8 + \snareAB s8 + } + >> + } + \header { + title = \title + meter = \meter + instrument = \instrumentSide + composer = \composerSide + } +} diff --git a/book/.gitignore b/book/.gitignore new file mode 100644 index 0000000..86753b4 --- /dev/null +++ b/book/.gitignore @@ -0,0 +1,7 @@ +*.pdf +*.aux +*.log +*.toc +images/* +scores/* +tmp/* diff --git a/lybook/bass_book.tex b/book/bass_book.tex similarity index 100% rename from lybook/bass_book.tex rename to book/bass_book.tex diff --git a/lybook/clean b/book/clean similarity index 100% rename from lybook/clean rename to book/clean diff --git a/lybook/drums_book.tex b/book/drums_book.tex similarity index 100% rename from lybook/drums_book.tex rename to book/drums_book.tex diff --git a/lybook/full_book.tex b/book/full_book.tex similarity index 100% rename from lybook/full_book.tex rename to book/full_book.tex diff --git a/lybook/init b/book/init similarity index 81% rename from lybook/init rename to book/init index f467544..4e9ffc9 100644 --- a/lybook/init +++ b/book/init @@ -17,8 +17,8 @@ for ins in tenor; do printf "\\documentclass{tex/score_book} -\\title{Seaforth Highlanders of Holland\\\\ %s Scores} -\\author{Eric Teunis de Boone} + \\title{Seaforth Highlanders of Holland\\\\ %s Scores} + \\author{Eric Teunis de Boone} \\begin{document} @@ -42,9 +42,9 @@ done; echo "All setup!" -read -p "Press [Enter] to compile *.tex" +#read -p "Press [Enter] to compile *.tex" -for f in ./*.tex; -do - $LATEXCMD $f -done; +#for f in ./*.tex; +#do +# $LATEXCMD $f +#done; diff --git a/lybook/load_scores b/book/load_scores similarity index 100% rename from lybook/load_scores rename to book/load_scores diff --git a/lybook/makebook b/book/makebook similarity index 82% rename from lybook/makebook rename to book/makebook index 782b56a..5c8747b 100644 --- a/lybook/makebook +++ b/book/makebook @@ -12,6 +12,7 @@ class MakeBook: RUN_DIR = os.path.abspath(os.curdir) SCORES_DIR = './scores/' LY_DIR = '../' + ORDER_FILE = 'order.txt' INSTRUMENTS = ['full','drums', 'pipes', 'bass', 'tenor', 'side','snare'] def __init__(self): @@ -43,14 +44,17 @@ class MakeBook: self.fwrite(u'\\addcontentsline{toc}{section}{Standards}') for d in standards: + self.vprint() self.vprint(os.path.join(self.SCORES_DIR,d)) self.path_walker(os.path.join(self.SCORES_DIR,d), level=1, content_line_level=1) self.fwrite(u'\\addcontentsline{toc}{section}{Marches}') for d in marches: + self.vprint() self.vprint(os.path.join(self.SCORES_DIR,d)) self.path_walker(os.path.join(self.SCORES_DIR,d), level=1, content_line_level=2) for d in tune_dirs: + self.vprint() self.vprint(os.path.join(self.SCORES_DIR,d)) self.path_walker(os.path.join(self.SCORES_DIR,d)) except IOError: @@ -59,8 +63,10 @@ class MakeBook: self.fout.close() raise - def vprint(self,line): + def vprint(self,line = None): if self.args.verbose: + if line is None: + line = '' print(line) def fwrite(self,line): @@ -139,24 +145,36 @@ class MakeBook: if level < content_line_level: self.fwrite(u'\\mysection{'+('sub'*level)+'section}{'+a[a.rfind('/')+1:].replace('_',' ').replace('-','/').title()+'}') newline = False - for root, dirs, files in os.walk(a,False): - for f in files: - if not f.endswith('.pdf'): - continue - if self.args.instrument: - instr_in_file = False - for instr in self.args.instrument: - if instr in f: - self.vprint(instr) - instr_in_file = True - break - if not instr_in_file: - continue - # Include file - if newline: - self.fwrite(u'\\newpage') - newline = True - self.include_pdf(os.path.join(root,f), level+1) + if os.path.isfile(os.path.join(a, 'order.txt')): + self.vprint('Found order') + with open(os.path.join(a, self.ORDER_FILE)) as f: + line = f.readline().rstrip('\n') + while line: + self.path_walker(os.path.join(a,line), level+1) + line = f.readline().rstrip('\n') + else: + for root, dirs, files in os.walk(a,False): + for f in files: + if not f.endswith('.pdf'): + self.vprint('F! '+f) + continue + if self.args.instrument: + instr_in_file = False + for instr in self.args.instrument: + if instr in f: + self.vprint(instr) + instr_in_file = True + break + if not instr_in_file: + self.vprint('F! '+f) + continue + # Include file + self.vprint('F '+f) + if newline: + self.fwrite(u'\\newpage') + + newline = True + self.include_pdf(os.path.join(root,f), level+1) # Run above MakeBook(); diff --git a/lybook/pipes_book.tex b/book/pipes_book.tex similarity index 100% rename from lybook/pipes_book.tex rename to book/pipes_book.tex diff --git a/lybook/side_book.tex b/book/side_book.tex similarity index 100% rename from lybook/side_book.tex rename to book/side_book.tex diff --git a/lybook/tenor_book.tex b/book/tenor_book.tex similarity index 100% rename from lybook/tenor_book.tex rename to book/tenor_book.tex diff --git a/lybook/tex/main_bass.tex b/book/tex/main_bass.tex similarity index 100% rename from lybook/tex/main_bass.tex rename to book/tex/main_bass.tex diff --git a/lybook/tex/main_drums.tex b/book/tex/main_drums.tex similarity index 100% rename from lybook/tex/main_drums.tex rename to book/tex/main_drums.tex diff --git a/lybook/tex/main_full.tex b/book/tex/main_full.tex similarity index 100% rename from lybook/tex/main_full.tex rename to book/tex/main_full.tex diff --git a/lybook/tex/main_pipes.tex b/book/tex/main_pipes.tex similarity index 100% rename from lybook/tex/main_pipes.tex rename to book/tex/main_pipes.tex diff --git a/lybook/tex/main_side.tex b/book/tex/main_side.tex similarity index 100% rename from lybook/tex/main_side.tex rename to book/tex/main_side.tex diff --git a/lybook/tex/main_tenor.tex b/book/tex/main_tenor.tex similarity index 100% rename from lybook/tex/main_tenor.tex rename to book/tex/main_tenor.tex diff --git a/lybook/tex/score_book.cls b/book/tex/score_book.cls similarity index 100% rename from lybook/tex/score_book.cls rename to book/tex/score_book.cls diff --git a/lybook/tex/titlepage.tex b/book/tex/titlepage.tex similarity index 100% rename from lybook/tex/titlepage.tex rename to book/tex/titlepage.tex diff --git a/lybook/tex/main.tex b/lybook/tex/main.tex deleted file mode 100644 index 7195c1f..0000000 --- a/lybook/tex/main.tex +++ /dev/null @@ -1,100 +0,0 @@ -\addcontentsline{toc}{section}{Marches} -\mysection{subsection}{Standards} -\includepdf[pages=-, addtotoc={1,subsubsection,3,{2/4 Standards (side)},p2_4_standards}, pagecommand={}]{./scores/standards/standards-24_standards.side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{3/4 Standards Setting 1 (side)},p3_4_standards_nsetting_1}, pagecommand={}]{./scores/standards/standards-34_standards1.side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{3/4 Standards Setting 2 (side)},p3_4_standards_n_setting_2}, pagecommand={}]{./scores/standards/standards-34_standards2.side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{3/4 Standards Setting 3 (side)},p3_4_standards_n_setting_3}, pagecommand={}]{./scores/standards/standards-34_standards3.side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{4/4 Standards (side)},p4_4_standards}, pagecommand={}]{./scores/standards/standards-44_standards.side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{6/8 Standards (side)},p6_8_standards}, pagecommand={}]{./scores/standards/standards-68_standards.side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{6/8 Standard (bass)},p6_8_standard}, pagecommand={}]{./scores/standards/standards-standards.bass.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{6/8 Standards (tenor)},p6_8_standards}, pagecommand={}]{./scores/standards/standards-standards.tenor.pdf} -\mysection{subsection}{2/4 Marches} -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Black Bear (side)},pblack_bear}, pagecommand={}]{./scores/2-4_marches/black_bear/2-4_marches-black_bear-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Duncan McInnes (side)},pduncan_mcinnes}, pagecommand={}]{./scores/2-4_marches/duncan_mcinness/2-4_marches-duncan_mcinness-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{MacKenzie Highlanders (side)},pmackenzie_highlanders}, pagecommand={}]{./scores/2-4_marches/mackenzie_highlanders/2-4_marches-mackenzie_highlanders-side.alt.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{MacKenzie Highlanders (side)},pmackenzie_highlanders}, pagecommand={}]{./scores/2-4_marches/mackenzie_highlanders/2-4_marches-mackenzie_highlanders-side.pdf} -\mysection{subsection}{3/4 Marches} -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Castle Dangerous (tenor)},pcastle_dangerous}, pagecommand={}]{./scores/3-4_marches/castle_dangerous/3-4_marches-castle_dangerous-tenor.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{On the Road to Passchendaele (side)},pon_the_road_to_passchendaele}, pagecommand={}]{./scores/3-4_marches/on_the_road_to_passchendaele/3-4_marches-on_the_road_to_passchendaele-side.pdf} -\mysection{subsection}{4/4 Marches} -\includepdf[pages=-, addtotoc={1,subsubsection,3,{51st Highland Division (side)},p51st_highland_division}, pagecommand={}]{./scores/4-4_marches/51st_highland_division/4-4_marches-51st_highland_division-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Flett from Flotta (side)},pflett_from_flotta}, pagecommand={}]{./scores/4-4_marches/flett_from_flotta/4-4_marches-flett_from_flotta-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Minstrel Boy (side)},pminstrel_boy}, pagecommand={}]{./scores/4-4_marches/minstrel_boy/4-4_marches-minstrel_boy-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Rowan Tree (side)},prowan_tree}, pagecommand={}]{./scores/4-4_marches/rowan_tree/4-4_marches-rowan_tree-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Scotland the Brave (side)},pscotland_the_brave}, pagecommand={}]{./scores/4-4_marches/scotland_the_brave/4-4_marches-scotland_the_brave-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Leaving of Liverpool (drums)},pthe_leaving_of_liverpool}, pagecommand={}]{./scores/4-4_marches/the_leaving_of_liverpool/4-4_marches-the_leaving_of_liverpool-drums.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Leaving of Liverpool (side)},pthe_leaving_of_liverpool}, pagecommand={}]{./scores/4-4_marches/the_leaving_of_liverpool/4-4_marches-the_leaving_of_liverpool-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Leaving of Liverpool (tenor)},pthe_leaving_of_liverpool}, pagecommand={}]{./scores/4-4_marches/the_leaving_of_liverpool/4-4_marches-the_leaving_of_liverpool-tenor.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Old Rustic Bridge (tenor)},pthe_old_rustic_bridge}, pagecommand={}]{./scores/4-4_marches/the_old_rustic_bridge/4-4_marches-the_old_rustic_bridge-tenor.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Pikeman's March (drums)},pthe_pikeman_s_march}, pagecommand={}]{./scores/4-4_marches/the_pikemans_march/4-4_marches-the_pikemans_march-drums.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Pikeman's March (side)},pthe_pikeman_s_march}, pagecommand={}]{./scores/4-4_marches/the_pikemans_march/4-4_marches-the_pikemans_march-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{The Pikeman's March (tenor)},pthe_pikeman_s_march}, pagecommand={}]{./scores/4-4_marches/the_pikemans_march/4-4_marches-the_pikemans_march-tenor.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Wings (side)},pwings}, pagecommand={}]{./scores/4-4_marches/wings/4-4_marches-wings-side.pdf} -\mysection{subsection}{5/4 Marches} -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Cullen Bay (bass)},pcullen_bay}, pagecommand={}]{./scores/5-4_marches/cullen_bay/5-4_marches-cullen_bay-bass.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Cullen Bay (drums)},pcullen_bay}, pagecommand={}]{./scores/5-4_marches/cullen_bay/5-4_marches-cullen_bay-drums.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Cullen Bay (side)},pcullen_bay}, pagecommand={}]{./scores/5-4_marches/cullen_bay/5-4_marches-cullen_bay-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Cullen Bay (tenor)},pcullen_bay}, pagecommand={}]{./scores/5-4_marches/cullen_bay/5-4_marches-cullen_bay-tenor.pdf} -\mysection{subsection}{6/8 Marches} -\includepdf[pages=-, addtotoc={1,subsubsection,3,{Hills of Glenorchy (side)},phills_of_glenorchy}, pagecommand={}]{./scores/6-8_marches/hills_of_glenorchy/6-8_marches-hills_of_glenorchy-side.pdf} -\mysection{section}{Hornpipes} -\includepdf[pages=-, addtotoc={1,subsection,2,{Itchy Fingers (pipes) (side)},pitchy_fingers}, pagecommand={}]{./scores/hornpipes/itchy_fingers/hornpipes-itchy_fingers-side.pdf} -\mysection{section}{Jigs} -\includepdf[pages=-, addtotoc={1,subsection,2,{Seaforth Sticks (drums)},pseaforth_sticks}, pagecommand={}]{./scores/jigs/seaforth_sticks/jigs-seaforth_sticks-drums.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Seaforth Sticks (side)},pseaforth_sticks}, pagecommand={}]{./scores/jigs/seaforth_sticks/jigs-seaforth_sticks-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Seaforth Sticks (tenor)},pseaforth_sticks}, pagecommand={}]{./scores/jigs/seaforth_sticks/jigs-seaforth_sticks-tenor.pdf} -\mysection{section}{Strathspeys} -\includepdf[pages=-, addtotoc={1,subsection,2,{A. A. Cameron's Strathspey (side)},pa._a._cameron_s_strathspey}, pagecommand={}]{./scores/strathspeys/aa_camerons/strathspeys-aa_camerons-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Lady MacKenzie of Fairburn (bass)},plady_mackenzie_of_fairburn}, pagecommand={}]{./scores/strathspeys/lady_mackenzie_of_fairburn/strathspeys-lady_mackenzie_of_fairburn-bass.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Lady MacKenzie of Fairburn (drums)},plady_mackenzie_of_fairburn}, pagecommand={}]{./scores/strathspeys/lady_mackenzie_of_fairburn/strathspeys-lady_mackenzie_of_fairburn-drums.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Lady MacKenzie of Fairburn (full)},plady_mackenzie_of_fairburn}, pagecommand={}]{./scores/strathspeys/lady_mackenzie_of_fairburn/strathspeys-lady_mackenzie_of_fairburn-full.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Lady MacKenzie of Fairburn (pipes)},plady_mackenzie_of_fairburn}, pagecommand={}]{./scores/strathspeys/lady_mackenzie_of_fairburn/strathspeys-lady_mackenzie_of_fairburn-pipes.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Lady MacKenzie of Fairburn (side)},plady_mackenzie_of_fairburn}, pagecommand={}]{./scores/strathspeys/lady_mackenzie_of_fairburn/strathspeys-lady_mackenzie_of_fairburn-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Lady MacKenzie of Fairburn (tenor)},plady_mackenzie_of_fairburn}, pagecommand={}]{./scores/strathspeys/lady_mackenzie_of_fairburn/strathspeys-lady_mackenzie_of_fairburn-tenor.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Molly Connell (bass)},pmolly_connell}, pagecommand={}]{./scores/strathspeys/molly_connell/strathspeys-molly_connell-bass.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Molly Connell (drums)},pmolly_connell}, pagecommand={}]{./scores/strathspeys/molly_connell/strathspeys-molly_connell-drums.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Molly Connell (side)},pmolly_connell}, pagecommand={}]{./scores/strathspeys/molly_connell/strathspeys-molly_connell-side.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Molly Connell (tenor)},pmolly_connell}, pagecommand={}]{./scores/strathspeys/molly_connell/strathspeys-molly_connell-tenor.pdf} -\newpage -\includepdf[pages=-, addtotoc={1,subsection,2,{Molly Connell (side)},pmolly_connell}, pagecommand={}]{./scores/strathspeys/molly_connell/strathspeys-rolls.side.pdf} -\mysection{section}{Reels} -\mysection{section}{Other} -\includepdf[pages=-, addtotoc={1,subsection,2,{Band of Brothers (snare)},pband_of_brothers}, pagecommand={}]{./scores/other/other-band_of_brothers.snare.pdf} diff --git a/makedrum b/makedrum index 4dddbf1..7458a22 100755 --- a/makedrum +++ b/makedrum @@ -51,6 +51,12 @@ class MakeDrum: action='store_true', dest='view_spacing', default=False, help='Turn on "Paper.annotatespacing".') + parser.add_argument('-g','--generated', + dest='gen_out', default=self.TMP_DIR, + help='Put generated lilyfiles in $gen_out') + parser.add_argument('--no-compile', default=True, + action='store_false', dest='compile', + help='Do not compile generated Lilypond files') parser.add_argument('--no-log', action='store_false', dest='log', default=True, help='Do not generate log files.') @@ -61,7 +67,7 @@ class MakeDrum: dest='out_dir', default='pdf', help='Output dir, for lilypond. If it doesn\'t exist, try to create it') parser.add_argument('music_file', - default='', nargs='+', + default='', nargs='*', help='file to process') parser.add_argument('-@', '--list_file', dest='list_file', default='', @@ -86,6 +92,11 @@ class MakeDrum: if self.args.list_file != '': self.args.music_file.append(open(self.args.list_file, 'r').readlines()) close(self.args.list_file) + # Check for files + if not self.args.music_file: + parser.print_usage() + return + # Clean up of files self.remove_tmp_dir = self.args.clean @@ -103,20 +114,14 @@ class MakeDrum: os.chdir(self.MASTER_DIR) for file_path in self.args.music_file: - self.processit(self.TMP_DIR, os.path.join(self.RUN_DIR, file_path)) + self.processit(self.TMP_DIR, os.path.join(self.RUN_DIR, file_path), self.args.gen_out, self.args.compile) #if not #os.rmdir(self.TMP_DIR) os.chdir(self.RUN_DIR) - def processit(self, tmp_dir, file): - if self.args.log: - logfile = os.path.join(self.TMP_DIR, os.path.relpath(file).replace(".ly", '').replace('/', '-')+'.log') - log = ' > '+logfile+' 2>&1' - else: - log = '' - + def processit(self, tmp_dir, file, gen_out, compile): if self.args.format is None: if file.endswith(".book"): header_format = "header_book" @@ -127,27 +132,49 @@ class MakeDrum: tmp_file = self.maketemplate(tmp_dir, file, header_format) - print ('Compiling ', file, end=' ', flush=True) - if not self.args.log: - print() + if gen_out is not None and gen_out != tmp_dir: + new_tmp_file = os.path.basename(tmp_file).replace(self.TMP_PREFIX, ''); + print ('Moving ', tmp_file, ' to ', new_tmp_file, end=' ', flush=True) + gen_dir = os.path.join(self.RUN_DIR, gen_out); + # if not dir $gen_out, make it + if not os.path.exists(gen_dir): + try: os.makedirs(gen_dir) + except: + print('[Error]') + print(' ! Seems like the {} directory cannot be created'.format(gen_dir)) + return + # mv file to dir, remove self.TMP_PREFIX + os.rename(tmp_file, os.path.join(gen_dir, new_tmp_file)) + tmp_file = new_tmp_file + print('[OK]') - lilyout = os.path.join(os.path.curdir, self.args.out_dir, os.path.basename(tmp_file).replace(self.TMP_PREFIX, '').replace(".ly", '')) - lilycmd = self.LILYPOND+' --pdf --output='+lilyout+' '+tmp_file+log - - if os.system(lilycmd) != 0: - self.remove_tmp_dir = False - print ('[Error]') + if compile: if self.args.log: - print (' ! Did not compile, please see the log at ', logfile) - else : - print ('[OK]') + logfile = os.path.join(self.TMP_DIR, os.path.relpath(file).replace(".ly", '').replace('/', '-')+'.log') + log = ' > '+logfile+' 2>&1' + else: + log = '' - if self.args.clean: - #remove files + print ('Compiling ', file, end=' ', flush=True) + if not self.args.log: + print() + lilyout = os.path.join(self.RUN_DIR, self.args.out_dir, os.path.basename(tmp_file).replace(self.TMP_PREFIX, '').replace(".ly", '')) + print (lilyout) + lilycmd = self.LILYPOND+' --pdf --output='+lilyout+' '+tmp_file+log + + if os.system(lilycmd) != 0: + self.remove_tmp_dir = False + print ('[Error]') if self.args.log: - os.remove(logfile) - os.remove(tmp_file) - + print (' ! Did not compile, please see the log at ', logfile) + else : + print ('[OK]') + + if self.args.clean: + #remove files + if self.args.log: + os.remove(logfile) + os.remove(tmp_file) def maketemplate(self, tmp_dir, file, header_format): lily_includes = '' @@ -157,11 +184,9 @@ class MakeDrum: for ext in ['full', 'side', 'tenor', 'bass', 'drum', 'snare']: if ext in file: include_drum_file = True - for ext in ['full', 'pipes']: if ext in file: include_pipe_file = True - if include_drum_file: lily_includes = lily_includes + u""" \\include \""""+self.args.lilydrum+"""\" @@ -178,14 +203,14 @@ class MakeDrum: out_file.write(u'\ufeff') out_file.write(u""" -% Generated from """+file+""" by """+__file__+""" +% Generated from """+file+""" by """+__file__+""" version """+self.VERSION+""" \\version "2.18.0" #(ly:set-option 'point-and-click #f) """+ lily_includes +""" -\\include \""""+header_format+""".ily" +\\include \""""+os.path.join(os.path.abspath(self.MASTER_DIR), header_format.strip(".ily")+""".ily""")+"""\" #(set-global-staff-size """+self.args.staffsize+""") #(set-default-paper-size \""""+self.args.papersize+"""\" '"""+self.args.orientation+""") @@ -204,7 +229,7 @@ class MakeDrum: # Rewrite includes to absolute location of file incline = line.replace('\\include', '').strip('"\' ') if not incline.startswith('\\'): #already absolute - incline = os.path.join(os.path.relpath(os.path.dirname(file)), incline) + incline = os.path.join(os.path.abspath(os.path.dirname(file)), incline) line = "\\include \""+incline+"\"" if printit: out_file.write(line.replace('\r', '')+'\n') @@ -212,6 +237,4 @@ class MakeDrum: # Return tmp_file_path return tmp_file - - MakeDrum(); diff --git a/strathspeys/molly_connell/notes.side.v1.1.ily b/strathspeys/molly_connell/notes.side.v1.1.ily index 6466955..ff78686 100755 --- a/strathspeys/molly_connell/notes.side.v1.1.ily +++ b/strathspeys/molly_connell/notes.side.v1.1.ily @@ -4,25 +4,25 @@ composerSide = "v1.1, 2015" snareA = \drummode { \flamddr d4 \flam g8.[\fr d16:64(] d8.[) \dragddr d16] d8.[ \fr g16] | - d8.:64[(-> g16]) \triplet { d16[ g d g d8]} \triplet { g8[ d8 \flam g8] } \flam d8.[ g16] \dr | + d8.:64[(-> g16]) \triplet { d16[ g d g d8]} \triplet { g8[ d8 \flamddr g8] } \flam d8.[ \fr g16] | - d16:64[( d8.]) \fr g8.[ \drag d16] \triplet { d16[ g d g d8] } g8.[ g16] \dr| - \flamd \triplet { d8 g d } \flam g8.[ \flam g16] \triplet { d16 g d g d8 } g8 \fr + d16:64[( d8.]) g8.[ \drag d16] \triplet { d16[ g d g d8] } g8.[ g16] | + \flamddr \triplet { d8 \fr g d } \flamddr g8.[ \flam g16] \triplet { d16 g d g d8 } g8 \fr } snareBA = \drummode { \partial 8 g8 \dr | d4:32( d8.[) \drag d16] \fr \triplet { d16[ g d g d8] } g8.[ g16] \dr | - \drag d16[ d8.] \flam d8.[ \flam g16] \fr \triplet { d16[ g d g d8] } \triplet { g8[ d g] \dr } | + \drag d16[ d8.] \flam d8.[ \flam g16] \fr \triplet { d16[ g d g d8] } \triplet { g8[ d g] } | - \flamd \triplet { d8[ \fr g16 g16 d8] } g8.[ g16]\dr \flamd \triplet { d8[->\fr g16 g16 d8] } g8.[ g16] \dr | - \flamd \triplet { d8[ g d] } \flam g8.[ \flam g16] \triplet { d16[ g d g d8] } g8 s8 \fr | + \flamddr \triplet { d8[ \fr g16 g16 d8] } g8.[ g16] \flamddr \triplet { d8[\fr g16 g16 d8] } g8.[ g16] | + \flamddr \triplet { d8[ \fr g d] } \flamddr g8.[ \flam g16] \triplet { d16[ g d g d8] } g8 s8 \fr | } snareBB = \drummode { \partial 8 g8 | d4:32( d8.[) \drag d16] \triplet { d16[ g d g d8] } g8.[ g16] | - \drag d16[ d8.] \flam d8.[ \flam g16] \triplet { d16[ g d g d8] } \triplet { g8[\> d g] } | + \drag d16[ d8.] \flam d8.[ \flam g16] \triplet { d16[ g d g d8] } \triplet { g8[\> d g]\! } | - \flam d4 \flam g8.[\! d16:64]( d8.[) \drag d16] d8.[ g16] | + \flam d4 \flam g8.[ d16:64]( d8.[) \drag d16] d8.[ g16] | \flamd \triplet { d8[ g d] } \flam g8.[ \flam g16] \triplet { d16[ g d g d8] } g8 s8 | -} \ No newline at end of file +}