This is a quick tool to fix midi triplets. First save the file on your computer (remember the location). Open NWC with the file you want to convert and do Alt/F8. Choose New and pick a group and a name for it. Browse for the file you saved. In the command line insert "wscript " at the beginning of the line (note trailing space after wscript). Now you can select Run.
/* Midi triplet conversion by Warren Porter "MidiTriplets.js"
After downloading this file, when setting it up in NWC User Tools create this command line:
wscript "'Browse can insert the path for you' \MidiTriplets.js"
This can convert "midi triplets" (16th, dotted; 16th, dotted; 16th) into a set of 8th, triplets
*/
var rc=0, errMsg=""
function calculate(clip) {
var i, j=0, dsi;
var lines = new Array(), result = new Array(), mt=0, measureTab = new Array, beatletCount=0, targetMeasure = 768;
var thisDur, thisNote, durSplit;
lines = clip.split("\r\n");
var lineLength3 = lines.length - 3;
for (i=0; i < lineLength3; i++) {
if (/Dur:16th,Dotted/.test(lines[i]) && !/Dur2/.test(lines[i]) && /Dur:16th,Dotted/.test(lines[i+1]) && !/Dur2/.test(lines[i+1]) &&
!/Dur2/.test(lines[i+2]) && /Dur:16th/.test(lines[i+2]) && !/Dotted/.test(lines[i+2])) {
lines[i] = lines[i].replace("Dur:16th,Dotted","Dur:8th,Triplet=First");
lines[i+1]= lines[i+1].replace("Dur:16th,Dotted","Dur:8th,Triplet");
lines[i+2]=lines[i+2].replace("Dur:16th","Dur:8th,Triplet=End");
i+=2; }
} //End main processing loop
return lines;
}
var myLines=calculate(WScript.StdIn.ReadAll()).join("\r\n")
if (rc == 0)
WScript.StdOut.Write(myLines);
else
WScript.StdErr.Write(errMsg);
WScript.quit(rc);