annotate jrp/Makefile @ 2:1e94d64e1d9e tip

Many fixes to remove spurious notes, correct time signatures and clefs. Still some problems remain.
author samer
date Fri, 24 Apr 2015 18:19:47 +0100
parents 968db103ad92
children
rev   line source
samer@0 1 ## jrp-scores Makefile
samer@0 2 ##
samer@0 3 ## Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
samer@0 4 ## Creation Date: Thu Dec 26 16:48:50 PST 2013
samer@0 5 ## Last Modified: Mon Dec 30 07:56:34 PST 2013
samer@0 6 ## Filename: Makefile
samer@0 7 ## Syntax: GNU makefile
samer@0 8 ##
samer@0 9 ## Description:
samer@0 10 ##
samer@0 11 ## Makefile for basic processing of JRP meta-repository data files.
samer@0 12 ## To run this makefile, type (without quotes) one of the following
samer@0 13 ## commands in a bash terminal (usually the default terminal shell
samer@0 14 ## in linux, and also /Applications/Utilities/Terminal.app in OS X
samer@0 15 ## computers).
samer@0 16 ##
samer@0 17 ## "make" -- Download any updates to online JRP files.
samer@0 18 ##
samer@0 19 ## "make update" -- Download any updates to online JRP files.
samer@0 20 ##
samer@0 21 ## "make clean" -- Delete directories of data created by this makefile,
samer@0 22 ## such as kern-reduced, pdf, and midi which may be found
samer@0 23 ## in each composer's directory.
samer@0 24 ##
samer@0 25 ## "make notitle" -- Make a version of the files where the title is
samer@0 26 ## removed from the filename.
samer@0 27 ##
samer@0 28 ## ===============================================================
samer@0 29 ##
samer@0 30 ## Make commands which require Humdrum Extras to be installed:
samer@0 31 ##
samer@0 32 ## "make reduced" -- Create reduced-rhythm versions of the data files
samer@0 33 ## by dividing note durations by 4 so that whole notes become
samer@0 34 ## quarter notes. This is necessary to use the data with rhythm
samer@0 35 ## analysis tools in the standard Humdrum Toolkit.
samer@0 36 ##
samer@0 37 ## "make notext" -- Remove **text spines from data and store
samer@0 38 ## output in kern-notext directories for each composer directory.
samer@0 39 ##
samer@0 40 ## "make genres" -- Groups work by genre by downloading from kernScores.
samer@0 41 ##
samer@0 42 ## "make notearray" -- Create note array files.
samer@0 43 ##
samer@0 44 ## ===============================================================
samer@0 45 ##
samer@0 46 ## If Humdrum Extras is not installed, you can use web downloaded versions
samer@0 47 ## of the above make commands:
samer@0 48 ##
samer@0 49 ## "make web-pdf" -- Download PDF graphical music scores from the JRP website.
samer@0 50 ##
samer@0 51 ## "make web-pdf-notext" -- Download PDFs of graphical music scores from JRP
samer@0 52 ## website which do not include lyrics.
samer@0 53 ##
samer@0 54 ## "make web-reduced" -- Same as "make reduced", but download from the
samer@0 55 ## JRP website without the need to have Humdrum Extras installed.
samer@0 56 ##
samer@0 57 ## "make web-musedata" -- Download MuseData files used to create PDF files.
samer@0 58 ##
samer@0 59 ## ===============================================================
samer@0 60 ##
samer@0 61 ## Humdrum Toolkit dependent make commands:
samer@0 62 ##
samer@0 63 ## "make census" -- Run census -k on all files.
samer@0 64 ##
samer@0 65 ##
samer@0 66
samer@0 67
samer@0 68 # targets which don't actually refer to files/directories:
samer@0 69 .PHONY :
samer@0 70
samer@0 71 all:
samer@0 72 @echo ''
samer@0 73 @echo 'Run this makefile with one of the following labels:'
samer@0 74 @echo ' "make update" : download any new changes in online data repository.'
samer@0 75 @echo ' "make notitle" : remove titles from filenames.'
samer@0 76 @echo ' "make clean" : delete data directories created by this makefile.'
samer@0 77 @echo ''
samer@0 78 @echo 'Comands requiring Humdrum Extras to be installed.'
samer@0 79 @echo ' "make reduced" : create rhythmically reduced kern files.'
samer@0 80 @echo ' "make notext" : remove lyrics from scores.'
samer@0 81 @echo ' "make genres" : group works by genre.'
samer@0 82 @echo ' "make notearray" : create notearray files.'
samer@0 83 @echo ''
samer@0 84 @echo 'JRP website downloads:'
samer@0 85 @echo ' "make web-pdf" : download score PDFs from JRP website.'
samer@0 86 @echo ' "make web-pdf-notext" : download score PDFs without lyrics.'
samer@0 87 @echo ' "make web-reduced" : download rhythmically reduced kern files.'
samer@0 88 @echo ' "make web-musedata" : download MuseData files from JRP website.'
samer@0 89 @echo ''
samer@0 90
samer@0 91 BASEURL = http://josquin.stanford.edu
samer@0 92 DATAURL = $(BASEURL)/data?
samer@0 93 PDFTYPE = notationwitheditorialwithtext
samer@0 94 PDFNOTEXT = notationwitheditorialnotext
samer@0 95 REDUCED = humdrumreduced
samer@0 96
samer@0 97 # If wget is not present on the computer, try using curl since the
samer@0 98 # computer is most likely an OS X one:
samer@0 99
samer@0 100 WGET = `which wget`
samer@0 101 ifeq ($(WGET),)
samer@0 102 WGET = curl
samer@0 103 else
samer@0 104 WGET = wget -O-
samer@0 105 endif
samer@0 106
samer@0 107 ############################################################################
samer@0 108 ##
samer@0 109 ## General make commands:
samer@0 110 ##
samer@0 111
samer@0 112
samer@0 113 ##############################
samer@0 114 #
samer@0 115 # make update -- Download any changes in the Github repositories for
samer@0 116 # each composer.
samer@0 117 #
samer@0 118
samer@0 119 update: github-pull
samer@0 120 githubupdate: github-pull
samer@0 121 githubpull: github-pull
samer@0 122 github-pull:
samer@0 123 git pull --recurse-submodules
samer@0 124 git submodule foreach git pull
samer@0 125
samer@0 126
samer@0 127
samer@0 128 ##############################
samer@0 129 #
samer@0 130 # make clean -- Remove all automatically generated or downloaded data files.
samer@0 131 # Make sure that you have not added your own content into the directories
samer@0 132 # in which these derivative files are located; otherwise, these will be
samer@0 133 # deleted as well.
samer@0 134 #
samer@0 135
samer@0 136 clean:
samer@0 137 -rm -rf [A-Z]??/kern-reduced
samer@0 138 -rm -rf [A-Z]??/kern-notext
samer@0 139 -rm -rf [A-Z]??/kern-notitle
samer@0 140 -rm -rf [A-Z]??/midi
samer@0 141 -rm -rf [A-Z]??/pdf
samer@0 142 -rm -rf [A-Z]??/pdf-notext
samer@0 143 -rm -rf [A-Z]??/notearray
samer@0 144 -rm -rf [A-Z]??/musedata
samer@0 145 -rm -rf Zma
samer@0 146 -rm -rf Zmo
samer@0 147 -rm -rf Zso
samer@0 148 -rm -rf Joa
samer@0 149 -rm -rf Job
samer@0 150
samer@0 151
samer@0 152 ##############################
samer@0 153 #
samer@0 154 # make kern-notext -- Remove titles from filenames and store in a
samer@0 155 # directory called kern-notext within each composer directory.
samer@0 156 #
samer@0 157
samer@0 158 notitle: kern-notitle
samer@0 159 no-title: kern-notitle
samer@0 160 kern-no-title: kern-notitle
samer@0 161 kernnotitle: kern-notitle
samer@0 162 kern-notitle:
samer@0 163 for dir in [A-Z]??/kern; \
samer@0 164 do \
samer@0 165 echo Processing composer $$dir; \
samer@0 166 (cd $$dir; mkdir -p ../kern-notitle; \
samer@0 167 for file in *.krn; \
samer@0 168 do \
samer@0 169 cp $$file ../kern-notitle/`echo $$file | sed 's/-.*krn//'`.krn; \
samer@0 170 done \
samer@0 171 ) \
samer@0 172 done
samer@0 173
samer@0 174
samer@0 175
samer@0 176 ############################################################################
samer@0 177 ##
samer@0 178 ## Web downloading related make commands:
samer@0 179 ##
samer@0 180
samer@0 181
samer@0 182 ########################################
samer@0 183 #
samer@0 184 # make web-midi -- Download PDF files of graphical music notation
samer@0 185 # which are generated from the source **kern Humdrum data.
samer@0 186 #
samer@0 187
samer@0 188 midi: web-midi
samer@0 189 webmidi: web-midi
samer@0 190 web-midi:
samer@0 191 for dir in [A-Z]??/kern; \
samer@0 192 do \
samer@0 193 echo Processing composer $$dir; \
samer@0 194 (cd $$dir; mkdir -p ../midi; \
samer@0 195 for file in *.krn; \
samer@0 196 do \
samer@0 197 echo " Downloading MIDI for $$file ..."; \
samer@0 198 $(WGET) "$(DATAURL)a=midi&f=$$file" \
samer@0 199 > ../midi/`basename $$file .krn`.mid; \
samer@0 200 done \
samer@0 201 ) \
samer@0 202 done
samer@0 203
samer@0 204
samer@0 205
samer@0 206 ########################################
samer@0 207 #
samer@0 208 # make web-pdf -- Download PDF files of graphical music notation
samer@0 209 # which are generated from the source **kern Humdrum data.
samer@0 210 #
samer@0 211
samer@0 212 pdf: web-pdf
samer@0 213 webpdf: web-pdf
samer@0 214 web-pdf:
samer@0 215 for dir in [A-Z]??/kern; \
samer@0 216 do \
samer@0 217 echo Processing composer $$dir; \
samer@0 218 (cd $$dir; mkdir -p ../pdf; \
samer@0 219 for file in *.krn; \
samer@0 220 do \
samer@0 221 echo " Downloading PDF for $$file ..."; \
samer@0 222 $(WGET) "$(DATAURL)a=$(PDFTYPE)&f=$$file" \
samer@0 223 > ../pdf/`basename $$file .krn`.pdf; \
samer@0 224 done \
samer@0 225 ) \
samer@0 226 done
samer@0 227
samer@0 228
samer@0 229
samer@0 230 ########################################
samer@0 231 #
samer@0 232 # make web-pdf-notext -- Download PDF files of graphical music notation,
samer@0 233 # removing any lyrics from the music.
samer@0 234 #
samer@0 235
samer@0 236 pdfnotext: web-pdf-notext
samer@0 237 pdf-notext: web-pdf-notext
samer@0 238 webpdfnotext: webpdf-notext
samer@0 239 webpdf-notext: web-pdf-notext
samer@0 240 web-pdfnotext: web-pdf-notext
samer@0 241 web-pdf-notext:
samer@0 242 for dir in [A-Z]??/kern; \
samer@0 243 do \
samer@0 244 echo Processing composer $$dir; \
samer@0 245 (cd $$dir; mkdir -p ../pdf-notext; \
samer@0 246 for file in *.krn; \
samer@0 247 do \
samer@0 248 echo " Downloading PDF for $$file ..."; \
samer@0 249 $(WGET) "$(DATAURL)a=$(PDFNOTEXT)&f=$$file" \
samer@0 250 > ../pdf-notext/`basename $$file .krn`.pdf; \
samer@0 251 done \
samer@0 252 ) \
samer@0 253 done
samer@0 254
samer@0 255
samer@0 256
samer@0 257
samer@0 258
samer@0 259 ############################################################################
samer@0 260 ##
samer@0 261 ## Humdrum Extras related make commands:
samer@0 262 ##
samer@0 263
samer@0 264
samer@0 265 ##############################
samer@0 266 #
samer@0 267 # make kern-reduced -- Create Humdrum **kern data which does not contain any
samer@0 268 # rational reciprocal rhythms. Standard **recip data cannot represent
samer@0 269 # non-integer subdivisions of the whole note (excluding augmentation
samer@0 270 # dots). The extended reciprocal value for a triplet whole note is
samer@0 271 # 3%2 which means that the duration is 2/3rds of a whole note.
samer@0 272 #
samer@0 273 # After running "make reduced", a subdirectory called "kern-reduced"
samer@0 274 # will be generated in each composer directory (parallel to the
samer@0 275 # "kern" subdirectories that contain the original Humdrum **kern data
samer@0 276 # for the scores.
samer@0 277 #
samer@0 278 # This label requires that the "rscale" tool from the Humdrum Extras
samer@0 279 # package is installed (see https://github.com/craigsapp/humextra).
samer@0 280 # If you do not have it installed, instead run "make webreduced").
samer@0 281 #
samer@0 282
samer@0 283 reduced: kern-reduced
samer@0 284 kernreduced: kern-reduced
samer@0 285 kern-reduced:
samer@0 286 for dir in [A-Z]??/kern; \
samer@0 287 do \
samer@0 288 echo Processing composer $$dir; \
samer@0 289 (cd $$dir; mkdir -p ../kern-reduced; \
samer@0 290 for file in *.krn; \
samer@0 291 do \
samer@0 292 rscale -f 1/4 $$file > ../kern-reduced/$$file; \
samer@0 293 done \
samer@0 294 ) \
samer@0 295 done
samer@0 296
samer@0 297 #
samer@0 298 # make webreduced -- same result as "make reduced" but download data from
samer@0 299 # JRP website (much slower, but no extra software installation is required).
samer@0 300 #
samer@0 301
samer@0 302 webkernreduced: web-kern-reduced
samer@0 303 webreduced: web-kern-reduced
samer@0 304 web-kernreduced: web-kern-reduced
samer@0 305 webkern-reduced: web-kern-reduced
samer@0 306 web-kern-reduced:
samer@0 307 for dir in [A-Z]??/kern; \
samer@0 308 do \
samer@0 309 echo Processing composer $$dir; \
samer@0 310 (cd $$dir; mkdir -p ../kern-reduced; \
samer@0 311 for file in *.krn; \
samer@0 312 do \
samer@0 313 echo " Downloading file $$file ..."; \
samer@0 314 $(WGET) "$(DATAURL)a=$(REDUCED)&f=$$file" \
samer@0 315 > ../kern-reduced/$$file; \
samer@0 316 done \
samer@0 317 ) \
samer@0 318 done
samer@0 319
samer@0 320 musedata: web-musedata
samer@0 321 webmusedata: web-musedata
samer@0 322 web-musedata: web-musedata
samer@0 323 web-musedata:
samer@0 324 for dir in [A-Z]??/kern; \
samer@0 325 do \
samer@0 326 echo Processing composer $$dir; \
samer@0 327 (cd $$dir; mkdir -p ../musedata; \
samer@0 328 for file in *.krn; \
samer@0 329 do \
samer@0 330 echo " Downloading file $$file ..."; \
samer@0 331 $(WGET) "$(DATAURL)a=musedata&f=$$file" \
samer@0 332 > ../musedata/`basename $$file .krn`.msd; \
samer@0 333 done \
samer@0 334 ) \
samer@0 335 done
samer@0 336
samer@0 337
samer@0 338
samer@0 339 ##############################
samer@0 340 #
samer@0 341 # make kern-notext -- Remove **text spines from data and store in
samer@0 342 # directory called "kern-notext".
samer@0 343 #
samer@0 344
samer@0 345 kernnotext: kern-notext
samer@0 346 kern-notext:
samer@0 347 for dir in [A-Z]??/kern; \
samer@0 348 do \
samer@0 349 echo Processing composer $$dir; \
samer@0 350 (cd $$dir; mkdir -p ../kern-notext; \
samer@0 351 for file in *.krn; \
samer@0 352 do \
samer@0 353 extractx -i '**kern' $$file > ../kern-notext/$$file; \
samer@0 354 done \
samer@0 355 ) \
samer@0 356 done
samer@0 357
samer@0 358
samer@0 359
samer@0 360 ##############################
samer@0 361 #
samer@0 362 # make notearray -- Create note array files. Output is stored in a directory
samer@0 363 # called "notearray" in each composer directory.
samer@0 364 #
samer@0 365
samer@0 366 notearray:
samer@0 367 for dir in [A-Z]??/kern; \
samer@0 368 do \
samer@0 369 echo Processing composer $$dir; \
samer@0 370 (cd $$dir; mkdir -p ../notearray; \
samer@0 371 for file in *.krn; \
samer@0 372 do \
samer@0 373 notearray -jicale --mel $$file \
samer@0 374 | egrep -v 'LO:LB|break.*default' \
samer@0 375 > ../notearray/`basename $$file .krn`.dat; \
samer@0 376 done \
samer@0 377 ) \
samer@0 378 done
samer@0 379
samer@0 380
samer@0 381
samer@0 382 ##############################
samer@0 383 #
samer@0 384 # make genres -- Download scores organized by genres from the
samer@0 385 # kernScores website.
samer@0 386 #
samer@0 387
samer@0 388 genres: Zma Zmo Zso
samer@0 389
samer@0 390 #
samer@0 391 # Download files from kernScores related to masses (excluding fragments):
samer@0 392 #
samer@0 393
samer@0 394 zma: Zma
samer@0 395 Zma:
samer@0 396 mkdir -p Zma/kern; (cd Zma/kern; humsplit h://jrp/Zma)
samer@0 397
samer@0 398 #
samer@0 399 # Download files from kernScores related to motets:
samer@0 400 #
samer@0 401
samer@0 402 zmo: Zmo
samer@0 403 Zmo:
samer@0 404 mkdir -p Zmo/kern; (cd Zmo/kern; humsplit h://jrp/Zmo)
samer@0 405
samer@0 406 #
samer@0 407 # Download files from kernScores related to songs:
samer@0 408 #
samer@0 409
samer@0 410 zso: Zso
samer@0 411 Zso:
samer@0 412 mkdir -p Zso/kern; (cd Zso/kern; humsplit h://jrp/Zso)
samer@0 413
samer@0 414 #
samer@0 415 # Download securely attributed works of Josquin:
samer@0 416 #
samer@0 417
samer@0 418 joa: Joa
samer@0 419 Joa:
samer@0 420 mkdir -p Joa/kern; (cd Joa/kern; humsplit h://jrp/Joa)
samer@0 421
samer@0 422 #
samer@0 423 # Download not securely attributed works of Josquin:
samer@0 424 #
samer@0 425
samer@0 426 job: Job
samer@0 427 Job:
samer@0 428 mkdir -p Job/kern; (cd Job/kern; humsplit h://jrp/Job)
samer@0 429
samer@0 430 joab: Joa Job
samer@0 431 Joab: Joa Job
samer@0 432
samer@0 433
samer@0 434 ############################################################################
samer@0 435 ##
samer@0 436 ## standard Humdrum Toolkit related make commands:
samer@0 437 ##
samer@0 438
samer@0 439
samer@0 440 ##############################
samer@0 441 #
samer@0 442 # make census -- Count notes in all score for all composers.
samer@0 443 #
samer@0 444
samer@0 445 census:
samer@0 446 (for i in [A-Z]??/kern; do cat $$i/*.krn; done) | census -k
samer@0 447
samer@0 448
samer@0 449