diff --git a/lilydrum.ly b/lilydrum.ly index 63b6db2..d4a89c2 100644 --- a/lilydrum.ly +++ b/lilydrum.ly @@ -28,6 +28,7 @@ #(ly:set-option 'relative-includes #t) \include "lilydrum/layout_tweaks.ily" +\include "lilydrum/naming.ily" \include "lilydrum/musical_functions.ily" \include "lilydrum/embellishments.ily" \include "lilydrum/flourishing.ily" diff --git a/lilydrum/embellishments.ily b/lilydrum/embellishments.ily index d0b17e5..a58c1f5 100644 --- a/lilydrum/embellishments.ily +++ b/lilydrum/embellishments.ily @@ -69,28 +69,37 @@ autohand = #(define-music-function (parser location note left right) (ly:music? flam = #(define-music-function (parser location note) (ly:music?) #{ \autohand $note { \flamg } { \flamd } #}) +flamdr = #(define-music-function (parser location note) (ly:music?) #{ + \autohand $note { \flamgdr } { \flamddr } +#}) % Drag drag = #(define-music-function (parser location note) (ly:music?) #{ \autohand $note \dragg \dragd #}) +dragdr = #(define-music-function (parser location note) (ly:music?) #{ + \autohand $note \draggdr \dragddr +#}) % Open Drag odrag = #(define-music-function (parser location note) (ly:music?) #{ \autohand $note \odragg \odragd #}) +odragdr = #(define-music-function (parser location note) (ly:music?) #{ + \autohand $note \odraggdr \odragddr +#}) % Ruff ruff = #(define-music-function (parser location note) (ly:music?) #{ \autohand $note \ruffg \ruffd #}) +ruffdr = #(define-music-function (parser location note) (ly:music?) #{ + \autohand $note \ruffgdr \ruffddr +#}) % Swiss Ruff sruff = #(define-music-function (parser location note) (ly:music?) #{ - % is note right-handed? then \flamd - % if left, then \flamg - #(if (string=? (symbol->string (ly:music-property note 'drum-type)) "left-hand") - #{ \sruffg #} - #{ \sruffd #}) - % print the note, else it won't show up - $note + \autohand $note \sruffg \sruffd +#}) +sruffdr = #(define-music-function (parser location note) (ly:music?) #{ + \autohand $note \sruffgdr \sruffddr #}) diff --git a/lilydrum/layout_tweaks.ily b/lilydrum/layout_tweaks.ily index f731ac6..4191f80 100644 --- a/lilydrum/layout_tweaks.ily +++ b/lilydrum/layout_tweaks.ily @@ -93,20 +93,3 @@ drumPitchNames = \accepts "PipeBandDrumStaff" } } - -% =================================================== % -% *Shorts* for Naming % -% =================================================== % - -instrumentSide = "Side" -instrumentTenor = "Tenor" -instrumentBass = "Bass" -instrumentPipes = "Pipes" -shortInstrumentSide = "S.D." -shortInstrumentTenor = "T.D." -shortInstrumentBass = "B.D." -shortInstrumentPipes = "P." -composerSide = "" -composerTenor = "" -composerBass = "" -composerPipes = "" diff --git a/lilydrum/musical_functions.ily b/lilydrum/musical_functions.ily index 29b7a18..c15094e 100644 --- a/lilydrum/musical_functions.ily +++ b/lilydrum/musical_functions.ily @@ -5,13 +5,13 @@ eighthBeaming = { \set baseMoment = #(ly:make-moment 1/8) - \set beatStructure = #'( 2 2 ) + \set beatStructure = #'( 2 ) } eighthReelBeaming = { \set baseMoment = #(ly:make-moment 1/8) - \set beatStructure = #'( 4 4) + \set beatStructure = #'( 4 ) } -compoundEighthBeaming = { +eighthCompoundBeaming = { \set baseMoment = #(ly:make-moment 1/8) \set beatStructure = #'( 3 ) } @@ -22,10 +22,6 @@ triplet = #(define-music-function (parser location notes) (ly:music?) #{ \tuplet % dynamics v = #(define-event-function (parser location) () #{ \upbow #}) -% repeat brackets -dr = #(define-event-function (parser location) () #{ \startGroup #}) -fr = #(define-event-function (parser location) () #{ \stopGroup #}) - % dynamics with extended lines dynLine = #(define-music-function (parser location text) @@ -41,7 +37,10 @@ dynLine = #(define-music-function \once \override TextSpanner.bound-details.right.text = \markup { \draw-line #'(0 . -1) } #}) +% unison brackets % still to add: a little 'u' +dr = #(define-event-function (parser location) () #{ \startGroup #}) +fr = #(define-event-function (parser location) () #{ \stopGroup #}) tutti = #(define-event-function (parser location notes) (ly:music?) #{ \startGroup $notes diff --git a/lilydrum/naming.ily b/lilydrum/naming.ily new file mode 100644 index 0000000..988e72f --- /dev/null +++ b/lilydrum/naming.ily @@ -0,0 +1,31 @@ +% =================================================== % +% *Shorts* for Naming % +% =================================================== % +#(newline) +#(display "Short naming loaded") + +instrumentSide = "Side" +instrumentTenor = "Tenor" +instrumentBass = "Bass" +instrumentLyrics = "Lyrics" +instrumentPipes = "Pipes" +instrumentPipessecnd = "Seconds" +instrumentPipesthrd = "Thirds" +instrumentSecnd = "Seconds" +instrumentThrd = "Thirds" +shortInstrumentLyrics = "" +shortInstrumentSide = "S.D." +shortInstrumentTenor = "T.D." +shortInstrumentBass = "B.D." +shortInstrumentPipes = "P." +shortInstrumentPipessecnd = "P2" +shortInstrumentPipesthrd = "P3" +shortInstrumentSecnd = "2nd" +shortInstrumentThrd = "3rd" +composerLyrics = "" +composerSide = "" +composerTenor = "" +composerBass = "" +composerPipes = "" +composerPipessecnd = "" +composerPipesthrd = "" diff --git a/makedrum b/makedrum index 768c436..c302825 100755 --- a/makedrum +++ b/makedrum @@ -32,7 +32,7 @@ class MakeDrum: dest='lilydrum', default=os.path.join(self.MASTER_DIR,'lilydrum.ly'), help='Use the specified file for drums') parser.add_argument('-c', '--pipefile', - dest='lilypipe', default='bagpipe.ly', + dest='lilypipe', default=os.path.join(self.MASTER_DIR,'bagpipe.ly'), help='Use the specified file for pipes') parser.add_argument('-i', '--include', dest='includes', nargs='*', default=[],action='append', @@ -96,9 +96,9 @@ class MakeDrum: # Input files if self.args.list_file != '': - with io.open(self.args.list_file, 'r', encoding='utf8') as list_file: - for line in list_file.readlines(): - self.args.music_file.append(line) + with io.open(self.args.list_file, 'r', encoding='utf8') as list_file: + for line in list_file.readlines(): + self.args.music_file.append(line) # Check for files if not self.args.music_file: @@ -179,27 +179,35 @@ class MakeDrum: if not self.args.compilable: os.remove(tmp_file) + def maketemplate(self, tmp_dir, file, compilable): lily_includes = '' include_drum_file = False include_pipe_file = False - # find out whether drum, pipes, or full score - for ext in ['full', 'side', 'tenor', 'bass', 'drum', 'snare']: - if ext in file: - include_drum_file = True - break - for ext in ['full', 'pipes']: - if ext in file: - include_pipe_file = True - break + # find out whether drum, pipes, or full score + if self.args.lilydrum: + for ext in ['full', 'side', 'tenor', 'bass', 'drum', 'snare']: + if ext in file: + include_drum_file = True + break + else: + print('no lilydrum file') + if self.args.lilypipe: + for ext in ['full', 'pipes']: + if ext in file: + include_pipe_file = True + break + else: + print('no lilypipe file') if include_drum_file: self.args.includes.insert(0, self.args.lilydrum) if include_pipe_file: self.args.includes.insert(0, self.args.lilypipe) + # set up a tmp file with template and file combined tmp_file = os.path.join(tmp_dir, self.TMP_PREFIX + os.path.relpath(file).replace('../','').replace('music/','',1).replace('/', '-')[:-3] + self.args.suffix + '.ly') @@ -217,6 +225,7 @@ class MakeDrum: if not incline.startswith('\\'): #already absolute incline = os.path.join(os.path.abspath(os.path.dirname(relpath)), incline) + if compilable: try: inc_file = io.open(incline,'r',encoding='utf8')