elanhickler

Untitled

Sep 7th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Console.clear();
  2. // txt_path = "Z:/Versilian Studios/Trumpet & Trombone/file list.txt";
  3. // file_creation_path = "D:/Desktop/the_created_files/";
  4.  
  5. // filelist = File.readText(txt_path);
  6.  
  7. // file_array = filelist.split("\n");
  8.  
  9. // for (i = 0; i < file_array.length; ++i)
  10. // {
  11. //  txt = file_creation_path+file_array[i] + "\n";
  12. //  txt = Regex.replace(txt, "(.+?)[\\r\\n]+$", "$1");
  13. //  File.createFile(txt);
  14. // }
  15.  
  16. // Items.import(file_creation_path);
  17.  
  18. Items.setWithRegex("fileName", "instrument", "(.*?)_.*");
  19. Items.setWithRegex("fileName", "articulation", "_(.*?)[`.]");
  20.  
  21. Items.setWithRegex("fileName", "d",    "d=(.*?)[`.]");
  22. Items.setWithRegex("fileName", "n",    "n=(.*?)[`.]");
  23. Items.setWithRegex("fileName", "rr",   "rr=(\\d+)");
  24. Items.setWithRegex("fileName", "vl",   "vl=(.*?)[`.]");
  25.  
  26. Items.setWithRegex("articulation", "articulation", "MP Sweeps", "SweepsMP");
  27. Items.setWithRegex("articulation", "articulation", "Sus Mp5", "SusMP5");
  28. Items.setWithRegex("articulation", "articulation", "Sus mp10", "SusMP10");
  29.  
  30. for (i = 0; i < Items.count(); ++i)
  31. {
  32.     item = Items.get(i);
  33.     item.mic = "Close";
  34.    
  35.     if (item.articulation == "Sus" || item.articulation == "Stac")
  36.     {
  37.         if (item.rr == "1")
  38.         {
  39.             item.vl = 1;
  40.             item.rr = 1;
  41.         }
  42.         else if (item.rr == "2")
  43.         {
  44.             item.vl = 1;
  45.             item.rr = 2;               
  46.         }
  47.         else if (item.rr == "3")
  48.         {
  49.             item.vl = 2;
  50.             item.rr = 1;
  51.         }
  52.         else if (item.rr == "4")
  53.         {
  54.             item.vl = 2;
  55.             item.rr = 2;
  56.         }
  57.         else if (item.rr == "5")
  58.         {
  59.             item.vl = 3;
  60.             item.rr = 1;
  61.         }
  62.         else if (item.rr == "6")
  63.         {
  64.             item.vl = 3;
  65.             item.rr = 2;
  66.         }
  67.     }
  68.     else if (item.articulation == "Flutter")
  69.     {
  70.         item.vl = item.rr;
  71.         item.rr = 1;
  72.     }
  73.  
  74.     if (item.articulation == "Stac" ||
  75.         item.articulation == "Flutter") item.vls = 2;
  76.     else if (item.articulation == "Sus") item.vls = 3;
  77.     else item.vls = 1;
  78.  
  79.     layer = Math.max(parseInt(item.vl), 1);
  80.     layers = parseInt(item.vls);
  81.  
  82.     item.min_vel = Math.floor(126 / layers * (layer-1)) + 1;
  83.     item.max_vel = Math.floor(126 / layers * layer) + 1;
  84.     item.low_note =
  85.     item.high_note = Midi.num(item.n);
  86.     item.nki_group = item.mic+"."+item.articulation+".rr"+item.rr;
  87.  
  88.     // build path for tree
  89.     path = [];
  90.     path.push("instrument");
  91.     path.push("articulation");
  92.     path.push("name/fileName");
  93.     item.path = path.join("/");
  94. }
  95.  
  96. Items.setWithTagScript("name", "<instrument>/<articulation>/<mic>/<instrument>_<mic>.<articulation>[.rr<rr>]_<n>_<min_vel>_<max_vel>.<fileExt>");
  97.  
  98. for (x = 0; x < Items.count(); ++x)
  99. {
  100.     item = Items.get(x);
  101.    
  102.     //File.createFile("D:/desktop/new created files/"+item.name);
  103.     //File.moveFile(item.filePath, item.new_file_path)
  104. }
Advertisement
Add Comment
Please, Sign In to add comment