Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Console.clear();
- // txt_path = "Z:/Versilian Studios/Trumpet & Trombone/file list.txt";
- // file_creation_path = "D:/Desktop/the_created_files/";
- // filelist = File.readText(txt_path);
- // file_array = filelist.split("\n");
- // for (i = 0; i < file_array.length; ++i)
- // {
- // txt = file_creation_path+file_array[i] + "\n";
- // txt = Regex.replace(txt, "(.+?)[\\r\\n]+$", "$1");
- // File.createFile(txt);
- // }
- // Items.import(file_creation_path);
- Items.setWithRegex("fileName", "instrument", "(.*?)_.*");
- Items.setWithRegex("fileName", "articulation", "_(.*?)[`.]");
- Items.setWithRegex("fileName", "d", "d=(.*?)[`.]");
- Items.setWithRegex("fileName", "n", "n=(.*?)[`.]");
- Items.setWithRegex("fileName", "rr", "rr=(\\d+)");
- Items.setWithRegex("fileName", "vl", "vl=(.*?)[`.]");
- Items.setWithRegex("articulation", "articulation", "MP Sweeps", "SweepsMP");
- Items.setWithRegex("articulation", "articulation", "Sus Mp5", "SusMP5");
- Items.setWithRegex("articulation", "articulation", "Sus mp10", "SusMP10");
- for (i = 0; i < Items.count(); ++i)
- {
- item = Items.get(i);
- item.mic = "Close";
- if (item.articulation == "Sus" || item.articulation == "Stac")
- {
- if (item.rr == "1")
- {
- item.vl = 1;
- item.rr = 1;
- }
- else if (item.rr == "2")
- {
- item.vl = 1;
- item.rr = 2;
- }
- else if (item.rr == "3")
- {
- item.vl = 2;
- item.rr = 1;
- }
- else if (item.rr == "4")
- {
- item.vl = 2;
- item.rr = 2;
- }
- else if (item.rr == "5")
- {
- item.vl = 3;
- item.rr = 1;
- }
- else if (item.rr == "6")
- {
- item.vl = 3;
- item.rr = 2;
- }
- }
- else if (item.articulation == "Flutter")
- {
- item.vl = item.rr;
- item.rr = 1;
- }
- if (item.articulation == "Stac" ||
- item.articulation == "Flutter") item.vls = 2;
- else if (item.articulation == "Sus") item.vls = 3;
- else item.vls = 1;
- layer = Math.max(parseInt(item.vl), 1);
- layers = parseInt(item.vls);
- item.min_vel = Math.floor(126 / layers * (layer-1)) + 1;
- item.max_vel = Math.floor(126 / layers * layer) + 1;
- item.low_note =
- item.high_note = Midi.num(item.n);
- item.nki_group = item.mic+"."+item.articulation+".rr"+item.rr;
- // build path for tree
- path = [];
- path.push("instrument");
- path.push("articulation");
- path.push("name/fileName");
- item.path = path.join("/");
- }
- Items.setWithTagScript("name", "<instrument>/<articulation>/<mic>/<instrument>_<mic>.<articulation>[.rr<rr>]_<n>_<min_vel>_<max_vel>.<fileExt>");
- for (x = 0; x < Items.count(); ++x)
- {
- item = Items.get(x);
- //File.createFile("D:/desktop/new created files/"+item.name);
- //File.moveFile(item.filePath, item.new_file_path)
- }
Advertisement
Add Comment
Please, Sign In to add comment