Skip to content

Commit

Permalink
Add initial op 2 files.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Apr 26, 2024
1 parent 1cd5423 commit 6b7b581
Show file tree
Hide file tree
Showing 17 changed files with 4,151 additions and 21 deletions.
Empty file added README.md
Empty file.
30 changes: 21 additions & 9 deletions bin/makeAllKern
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,34 @@
##
## Programmer: Craig Stuart Sapp <[email protected]>
## Creation Date: Wed Apr 3 19:08:16 PDT 2024
## Last Modified: Wed Apr 3 19:08:23 PDT 2024
## Last Modified: Fri Apr 26 09:03:31 PDT 2024
## Syntax: PERL 5
## Filename: bin/makeAllMuseData
## vim: ts=3
##
## Description: Convert source files that contain metadata and URLs to individual
## part files into a single musedata file store in the op##/musedata
## subdirectories.
## Description: Convert combined MuseData files into a Humdrum file.
##
## Usage: make musedata
##

use strict;
use Getopt::Long;

my $bindir = "../bin";

my @opusDirs = sort glob("op[01][0-9]");
my $multipleQ = 0;
Getopt::Long::Configure("bundling");
GetOptions (
'm|multiple|a|all' => \$multipleQ
);

foreach my $opus (@opusDirs) {
processOpus($opus);
if ($multipleQ) {
my @opusDirs = sort glob("op[01][0-9]");
foreach my $opus (@opusDirs) {
processOpus($opus);
}
} else {
processOpus(".");
}

exit(0);
Expand All @@ -33,6 +44,7 @@ exit(0);

sub processOpus {
my ($opus) = @_;
die "Cannot fine source directory $opus/source" if !-d "$opus/source";
my @musedata = sort glob("$opus/musedata/*.mds");
foreach my $musedata (@musedata) {
processMusedata($opus, $musedata);
Expand All @@ -50,11 +62,11 @@ sub processMusedata {
my $base = $musedata;
$base =~ s/.*\///;
$base =~ s/\.mds$//;
`mkdir -p $opus/kern`;
my $target = "$opus/kern/$base.krn";
my $command = "bin/makeKern $musedata > $target";
my $command = "$bindir/makeKern $musedata > $target";
print stderr "$command\n";
`$command`;
`bin/updateKeyDesignations $target`;
}


Expand Down
24 changes: 19 additions & 5 deletions bin/makeAllMuseData
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@
##

use strict;
use Getopt::Long;

my @opusDirs = sort glob("op[01][0-9]");
my $bindir = "../bin";

foreach my $opus (@opusDirs) {
processOpus($opus);
my $multipleQ = 0;
Getopt::Long::Configure("bundling");
GetOptions (
'm|multiple|a|all' => \$multipleQ
);

if ($multipleQ) {
my @opusDirs = sort glob("op[01][0-9]");
foreach my $opus (@opusDirs) {
processOpus($opus);
}
} else {
processOpus(".");
}

exit(0);
Expand All @@ -33,6 +45,7 @@ exit(0);

sub processOpus {
my ($opus) = @_;
die "Cannot fine source directory $opus/source" if !-d "$opus/source";
my @sources = sort glob("$opus/source/*.mdss");
foreach my $source (@sources) {
processSource($opus, $source);
Expand All @@ -50,9 +63,10 @@ sub processSource {
my $base = $source;
$base =~ s/.*\///;
$base =~ s/\.mdss$//;
`mkdir -p $opus/musedata`;
my $target = "$opus/musedata/$base.mds";
my $command = "bin/makeMuseData $source > $target";
print stderr "$command\n";
my $command = "$bindir/makeMuseData $source > $target";
print STDERR "$command\n";
`$command`;
}

Expand Down
16 changes: 9 additions & 7 deletions Makefile → op01/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
##
## Programmer: Craig Stuart Sapp <[email protected]>
## Creation Date: Wed Apr 3 18:53:57 PDT 2024
## Last Modified: Wed Apr 3 18:54:00 PDT 2024
## Last Modified: Fri Apr 26 08:32:33 PDT 2024
## Syntax: GNU Makefile
## Filename: Makefile
## Filename: op02/Makefile
## vim: ts=3
##
## Description: Makefile to run tasks for the vivaldi repository.
## Description: Makefile to prepare data for op. 1.
##
## Make targets:
## musedata == convert source files into MuseData multi-file Stage 2 files.
## humdrum == convert MuseData multi Stage 2 files into Humdrum files.
## (Need to run "make musedata" first).
##

BINDIR = ./bin
BINDIR = ../bin

.PHONY: source musedata kern
.PHONY: source musedata kern pdf pages

all:
@echo "Makefile targets:"
Expand All @@ -40,8 +40,10 @@ humdrum:


clean:
rm op*/musedata/*.mds
rm op*/kern/*.krn
rm musedata/*.mds
rm kern/*.krn
rmdir musedata
rmdir kern



49 changes: 49 additions & 0 deletions op02/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
##
## Programmer: Craig Stuart Sapp <[email protected]>
## Creation Date: Wed Apr 3 18:53:57 PDT 2024
## Last Modified: Fri Apr 26 08:32:33 PDT 2024
## Syntax: GNU Makefile
## Filename: op02/Makefile
## vim: ts=3
##
## Description: Makefile to prepare data for op. 2.
##
## Make targets:
## musedata == convert source files into MuseData multi-file Stage 2 files.
## humdrum == convert MuseData multi Stage 2 files into Humdrum files.
## (Need to run "make musedata" first).
##

BINDIR = ../bin

.PHONY: source musedata kern pdf pages

all:
@echo "Makefile targets:"
@echo " make musedata == create MuseData (stage 2) multi-files"
@echo " make humdrum == create Humdrum files from the MuseData files"
@echo " make both == create MuseData and Humdrum files in one step"
@echo " make clean == earse all MuseData and Humdrum files"

both: musedata kern

cb: clean both

musedata:
$(BINDIR)/makeAllMuseData


kern: humdrum
hum: humdrum
humdrum:
$(BINDIR)/makeAllKern


clean:
rm musedata/*.mds
rm kern/*.krn
rmdir musedata
rmdir kern



Loading

0 comments on commit 6b7b581

Please sign in to comment.