1
0
Fork 0
mirror of https://github.com/kastdeur/lilydrum.git synced 2024-12-23 01:33:32 +01:00

Suffixes can be added to files using -r or --suffix

This commit is contained in:
Eric Teunis de Boone 2016-03-11 23:08:25 +01:00
parent b2c758c36c
commit 76dc1d858e
2 changed files with 12 additions and 18 deletions

View file

@ -21,12 +21,7 @@ drumPitchNames =
(left-hand () #f -1) (left-hand () #f -1)
) )
) )
\layout {
\context {% add hands to note definitions
\DrumStaff
drumStyleTable = #(alist->hash-table pipeband-style)
}
}
\layout { \layout {
indent = 0.0 indent = 0.0
\context { \context {
@ -34,6 +29,11 @@ drumPitchNames =
\name PipeBandDrumStaff \name PipeBandDrumStaff
\alias DrumStaff \alias DrumStaff
drumStyleTable = #(alist->hash-table pipeband-style)
% trying midi are you?
\override DrumStaff.midiInstrument = #"drums"
% one line per staff % one line per staff
\override StaffSymbol.line-positions = #'(0) \override StaffSymbol.line-positions = #'(0)
@ -95,15 +95,6 @@ drumPitchNames =
\accepts "PipeBandDrumStaff" \accepts "PipeBandDrumStaff"
} }
} }
\midi {
\context {
\DrumStaff
\name PipeBandDrumStaff
\alias DrumStaff
\override DrumStaff.midiInstrument = #"drums"
}
}
% =================================================== % % =================================================== %
% *Shorts* for Naming % % *Shorts* for Naming %

View file

@ -51,6 +51,9 @@ class MakeDrum:
action='store_true', dest='view_spacing', default=False, action='store_true', dest='view_spacing', default=False,
help='Turn on "Paper.annotatespacing".') help='Turn on "Paper.annotatespacing".')
parser.add_argument('-r','--suffix',
dest='suffix', default='',
help='String added at end of pdf\'s filename')
parser.add_argument('-g','--generated', parser.add_argument('-g','--generated',
dest='gen_out', default=self.TMP_DIR, dest='gen_out', default=self.TMP_DIR,
help='Put generated lilyfiles in $gen_out') help='Put generated lilyfiles in $gen_out')
@ -63,7 +66,7 @@ class MakeDrum:
parser.add_argument('--no-cleanup', parser.add_argument('--no-cleanup',
action='store_false', dest='clean', default=True, action='store_false', dest='clean', default=True,
help='Leave all temporary files in place') help='Leave all temporary files in place')
parser.add_argument('-d', '--out_dir', parser.add_argument('-d', '--out-dir',
dest='out_dir', default='pdf', dest='out_dir', default='pdf',
help='Output dir, for lilypond. If it doesn\'t exist, try to create it') help='Output dir, for lilypond. If it doesn\'t exist, try to create it')
parser.add_argument('music_file', parser.add_argument('music_file',
@ -193,8 +196,8 @@ class MakeDrum:
lily_includes = lily_includes + "\n\\include \"{}\"".format(f) lily_includes = lily_includes + "\n\\include \"{}\"".format(f)
# set up a tmp file with template and file combined # 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('../music-','',1).replace('/', '-')) tmp_file = os.path.join(tmp_dir, self.TMP_PREFIX + os.path.relpath(file).replace('../','').replace('music/','',1).replace('/', '-')[:-3] + self.args.suffix + '.ly')
print(tmp_file)
out_file = codecs.open(tmp_file, 'w+', 'utf8') out_file = codecs.open(tmp_file, 'w+', 'utf8')
out_file.write(u'\ufeff') out_file.write(u'\ufeff')