Skip to content

Commit

Permalink
added an optional parameter to the script to decode only single midi …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
klesun authored and klesun committed Dec 13, 2015
1 parent 4229938 commit bb52f27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/org/shmidusic/stuff/scripts/MidiToReadableMidi.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ public static void main(String[] args) throws IOException
String base = "/home/klesun/Dropbox/midiCollection/";

MutableInt counter = new MutableInt(0);

String pattern = args.length > 0 ? args[0] : ".mid";

dirNames.stream()
.map(d -> base + d).map(File::new).flatMap(f -> Arrays.stream(f.listFiles()))
.filter(f -> f.getPath().endsWith(".mid")).forEach(source -> {
.filter(f -> f.getPath().endsWith(pattern)).forEach(source -> {

/** @debug */
System.out.println(counter.incr() + " Processing " + source);
Expand Down

0 comments on commit bb52f27

Please sign in to comment.