#!/bin/bash - ############################################################ # This script is destructive recursively, to any files # and directories, from where it is run from. Backup first! # All samples should be named like "blah 12.wav" or # "blah 25.wav" etc "blah n.wav" where n is the note number. # It should be run from the folder above the folders with # the samples in. # # This script will play samples out and record them back in # capturing external fx and also create release samples # from the captured fx samples (for reverb). It will remove # silence from the ends of the samples (fx'ed and non fx'ed). # Sounds should not have gaps in the middle of them as it # will count everything after as silence for that sample.It # will also put all samples through a slight limiter, # normalise them and dither them. It was made to record an # external reverb unit on guitar samples and create release # samples to be used in gigasudio/linuxsampler. It should # work on anything else that fits this description (with a # few tweaks, such as silence detection level etc or # commenting out lines i.e. if no release samples are needed). # # sh GigaSampleSort.sh (from top sample folder) or # sh GigaSampleSort.sh 2>&1 | tee /tmp/output2.txt (for log) ############################################################ /usr/bin/find . -type d -exec /bin/chmod 755 {} \; /usr/bin/find . -type f -exec /bin/chmod 644 {} \; /usr/bin/find . -name "*.wav" > list /bin/sed 's/\ /?/' list >list2 /bin/sed 's/.\///' list2 >alloriginalsamples /usr/bin/find . -type d -print | /bin/cpio -pdumv tailrev for i in `/bin/cat alloriginalsamples` do sox "$i" -s -w "$i".wav /usr/bin/sox "$i".wav "$i" vol 1.5 amplitude 0.2 \ silence 0 1 00:00:00.1 -73d /usr/bin/ssrc --normalize --twopass --dither 3 \ --pdf 2 "$i" "$i".wav /bin/mv "$i".wav "$i" /usr/bin/sox "$i" tailrev/"$i" fade p 0 0:00.5 0:00.125 done /usr/bin/find . -name "*.wav" > list /bin/sed 's/\ /?/' list >list2 /bin/sed 's/.\///' list2 >alldrysamples /usr/bin/find . -type d -print | /bin/cpio -pdumv reverb for i in `cat alldrysamples` do /usr/bin/sox "$i" -r 44100 -2 -s -t alsa sox3 | \ /usr/bin/sox -r 44100 -2 -s -t alsa sox2 -t wav -r 44100 \ -2 -s reverb/"$i" silence 0 1 00:00:00.1 -70d done /usr/bin/find ./reverb -name "*.wav" >list /bin/sed 's/\ /?/' list >list2 /bin/sed 's/.\///' list2 >allreverbsamples for i in `/bin/cat allreverbsamples` do /usr/bin/sox "$i" "$i".wav vol 1.5 amplitude 0.2 /usr/bin/ssrc --normalize --twopass "$i".wav "$i" /bin/rm "$i".wav done /usr/bin/find ./reverb/tailrev -name "*.wav" >list /bin/sed 's/\ /?/' list >list2 /bin/sed 's/.\///' list2 >allreverbtailsamples for i in `/bin/cat allreverbtailsamples` do /usr/bin/sox "$i" "$i".wav trim 0:00.51 /usr/bin/sox "$i".wav "$i" fade 0:00.05 /bin/rm "$i".wav done for i in `/bin/cat allreverbsamples` do /usr/bin/ssrc --twopass --dither 3 --pdf 2 "$i" "$i".wav /bin/mv "$i".wav "$i" /usr/bin/rename \ Reverb\ "$i" done cd reverb/tailrev for i in `/bin/ls`; do /bin/mv "$i" "$i"ReverbTail; done cd .. for i in `/bin/ls`; do /bin/mv "$i" "$i"Reverb; done cd .. /bin/mv reverb/tailrevReverb reverb/tailrev /usr/bin/find ./reverb/tailrev -name "*.wav" >list /bin/sed 's/\ /?/' list >list2 /bin/sed 's/.\///' list2 >allreverbtailsamples for i in `/bin/cat allreverbtailsamples` do /usr/bin/rename Reverb\ ReverbTail\ "$i" done /bin/rm all* /bin/rm list* /bin/rm -R tailrev