mirror of
https://github.com/kastdeur/lilydrum.git
synced 2024-12-22 09:13:33 +01:00
Small updates, fixed makedrum script
This commit is contained in:
commit
7767d88405
6 changed files with 76 additions and 44 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
#})
|
||||
|
|
|
@ -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 = ""
|
||||
|
|
|
@ -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
|
||||
|
|
31
lilydrum/naming.ily
Normal file
31
lilydrum/naming.ily
Normal file
|
@ -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 = ""
|
35
makedrum
35
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')
|
||||
|
|
Loading…
Reference in a new issue