############################################################ # File randomizer for gating experiments # Written by Kyuchul Yoon (kyoon@ling.osu.edu) # The script reads in all the .wav files from the current directory, randomizes them, and # combines them all into one big file that can be burned into a CD ############################################################ # Get the user input form Select files and parameters comment Add some more options? word fileToProcess_(only_extensions) wav word fileNameList filename.list natural sampleRate_(in_Hz) 22050 natural intervalBtwSounds_(in_Seconds) 3 word outFile CD-01.wav endform Create Sound... silence 0 intervalBtwSounds sampleRate 0 Create Strings as file list... fileList *.'fileToProcess$' Randomize Randomize numFiles = Get number of strings pause 'numFiles' files identified. Continue? for i to numFiles select Strings fileList strFileName$ = Get string... i fileappend 'fileNameList$' 'i''tab$''tab$''strFileName$''newline$' endfor for iFile to numFiles select Strings fileList fileName$ = Get string... iFile Read from file... 'fileName$' Rename... 'iFile' endfor select Sound silence plus Sound 1 Concatenate Rename... tempCombined for iCombine from 2 to numFiles select Sound tempCombined plus Sound silence plus Sound 'iCombine' Concatenate select Sound tempCombined Remove select Sound chain Rename... tempCombined endfor Write to WAV file... 'outFile$'