Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2023
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;type process
  2. ;version 4
  3.  
  4. ; Get the path to the current project file (not very reliable)
  5. set fullfilepath = first(AUD-DO("GetPreference: Name=/RecentFiles/file12"))
  6.  
  7. ; Extract the directory path by cutting off the file name after the last slash:
  8. loop
  9.     for i from 0 below length(fullfilepath) - 1 by 1
  10.     if char-int(char(fullfilepath, i)) = 47 then set lastslashindex = i;
  11. end
  12. set dirpath = subseq(fullfilepath, 0, lastslashindex)
  13.  
  14. ; Get the track name (This doesn't work)
  15. set trackname = get(*track*, "NAME")
  16.  
  17. ; Generate the full path for the wav file we will be exporting with s-save
  18. set filepath = strcat(dirpath, "/", trackname, ".wav")
  19.  
  20. ; Export track(s) as wav to the project directory using {TRACKNAME}.wav as the file name
  21. exec s-save(*track*, ny:all, filepath, format: snd-head-Wave, mode: snd-mode-pcm, bits: 16)
  22.  
  23. return filepath
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement