diff --git a/test-scripts/mxl2xml.js b/test-scripts/mxl2xml.js
index 34af2c6..a44ce0b 100644
--- a/test-scripts/mxl2xml.js
+++ b/test-scripts/mxl2xml.js
@@ -21,12 +21,9 @@ catch (e) {
}
(async function() {
- try {
- data = await MXML.unzip(data);
- }
- catch (e) {
+ data = await MXML.unzip(data);
+ if (!data) {
console.error('Cannot uncompress file:', input);
- console.error(e.message);
process.exit(1);
}
try {
diff --git a/test-scripts/xml2midi.js b/test-scripts/xml2midi.js
new file mode 100644
index 0000000..d82c877
--- /dev/null
+++ b/test-scripts/xml2midi.js
@@ -0,0 +1,43 @@
+#!/usr/bin/env node
+const fs = require('fs');
+const MXML = require('../jazz-mxml');
+
+if (process.argv.length < 3) {
+ console.log('Usage: ' + process.argv[1].split(/[\\/]/).slice(-1) + ' [