# takes a folder of pairs of files (ending in "suffix1.wav" and "suffix2.wav") # and makes two new files for each pair in both orders suffix1$ = "_m" suffix2$ = "_f" fileSuffix$ = ".wav" # silence between the members of the pair in each file, in seconds silenceLength = 0.9 # path to the folder that contains the files path$ = "/Users/tulip/Documents/temp/" ################################ ## you probably won't need to edit below this line select all if numberOfSelected() > 0 Remove endif Create Strings as file list... list 'path$'*'suffix1$''fileSuffix$' numberOfFiles = Get number of strings for ifile to numberOfFiles # make file of suffix1 + silence + suffix2 select Strings list fileName1$ = Get string... ifile fileName2$ = "'fileName1$'" - "'suffix1$''fileSuffix$'" + "'suffix2$''fileSuffix$'" newFile$ = "'fileName1$'" - "'suffix1$''fileSuffix$'" + "'suffix1$''suffix2$''fileSuffix$'" Read from file... 'path$''fileName1$' Create Sound from formula... silence Mono 0 silenceLength 44100 0 Read from file... 'path$''fileName2$' select all minus Strings list Concatenate Write to WAV file... 'path$''newFile$' select all minus Strings list Remove # make file of suffix2 + silence + suffix1 select Strings list fileName1$ = Get string... ifile fileName2$ = "'fileName1$'" - "'suffix1$''fileSuffix$'" + "'suffix2$''fileSuffix$'" newFile$ = "'fileName2$'" - "'suffix2$''fileSuffix$'" + "'suffix2$''suffix1$''fileSuffix$'" Read from file... 'path$''fileName2$' Create Sound from formula... silence Mono 0 silenceLength 44100 0 Read from file... 'path$''fileName1$' select all minus Strings list Concatenate Write to WAV file... 'path$''newFile$' select all minus Strings list Remove endfor select all Remove