Other Stuff

This page is where I put useful things that don't fit into the other pages. If you are here you have most likely been sent here from one of my other pages. If you are just browsing here is a list of items on this page.

Items on this page

17th August 2008

FS Fender Reverb Impulse Response

This is an impulse response file that I made of my Fender Reverb unit which is an old (not sure how old) valve driven spring reverb. The sound has been heard on loads recordings. Neil Young or Dick Dale wouldn't leave home with out one. It is a very nice reverb (they cost about £400 new) mainly for guitars. I made it with Voxengo Deconvolver of which you can buy or use with limited functionality. The free one allowed me to do this. There is also a free vst plugins page on their site that is worth a look. I am yet to try any out but they do look very promising. To use the impulse you can use Jconv in linux or for windows a good realtime vst plugin is Freeverb3 Vst. The impulse is a very strong one as I wanted to be able to get the surfy slapback springy noises from it. For most music you will want to tame it down with the send fx knob. Freeverb3 already has a wet level slider but jconv will need to be used with a send fx or you can use something like JackMix to get the balance of dry to wet.

Click to go to the list of items on this page.


17th August 2008

Bash Script To Prepare Audio Samples & Record External FX

This script is what I used to record my external reverb unit for some of the samples on this site. The first time I used it was with my Seagull Acoustic Guitar sample. After recording the guitar and chopping the samples and putting them into the relevant folders I then wrote this script so that it would automate the task of playing each sample and recording what was being played after coming out of my reverb unit. On top of this it also created the release samples by playing just a bit of each file through the reverb and then chopping the original bit off, leaving just the reverb tail. Even automated like that it still took more than an hour to do, but it would have taken maybe two days to do each one manually in a program with a gui.

This sript was not intended to be used by anyone other than me. Your programs may be in different places to mine and your alsa ports will defintely have differnt names as I set these up especially in my asoundrc file. They are sox2 and sox3, which relate to the channels on my soundcard. It is well commented, which should help you find some of the functionality you may need when you either create your own or edit mine. The first two lines changes the permissions of all files and folders recursively so you need to make sure it is only your samples in the folder or any folders below from where the script is run. Don't run it directly from your home folder or anything. The audio programs that do the audio jobs are sox and ssrc. Sed is also used quite alot for formatting the text. If you use Gentoo linux most of the programs are there already and you can also use the Pro-Audio Overlay. If you use windows you can still use sox as there is a windows version also but you will have to write a batch file or something instead to automate the tasks. Sox is well worth a look into if you need any batch audio processing doing and you haven't the money to buy professional audio software or don't want to use cracked software, as it is free.

Here is an uncommented version if you would rather see it without all the comments.

#!/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)
############################################################

#change permissions of all directories recursively
/usr/bin/find . -type d -exec /bin/chmod 755 {} \;

#change permissions of all files recursively
/usr/bin/find . -type f -exec /bin/chmod 644 {} \;

#find all .wav files recursively from current directory
/usr/bin/find . -name "*.wav" > list

#replace spaces with ? in list filenames
/bin/sed 's/\ /?/' list >list2

#remove ./ from list2 filenames
/bin/sed 's/.\///' list2 >alloriginalsamples	

#copy directory structure to new folder tailrev.
/usr/bin/find . -type d -print | /bin/cpio -pdumv tailrev

for i in `/bin/cat alloriginalsamples`
do 

#convert to signed 16bit wavs ready for ssrc
sox "$i" -s -2 "$i".wav

#increase vol and limit peaks then remove silence from
#end of files. Back slash at end of line makes 2 lines as 1
/usr/bin/sox "$i".wav "$i" vol 1.5 amplitude 0.2 		\
silence 0 1 00:00:00.1 -46d

#normalize and dither
/usr/bin/ssrc --normalize --twopass --dither 3 		\
--pdf 2 "$i" "$i".wav
/bin/mv "$i".wav "$i"

#chop and fade out tailrev samples
/usr/bin/sox "$i" tailrev/"$i" fade p 0 0:00.5 0:00.125
done

#list all .wav files recursively from current directory
/usr/bin/find . -name "*.wav" > list

#replace spaces with ? in list filenames
/bin/sed 's/\ /?/' list >list2

#remove ./ from list2 filenames
/bin/sed 's/.\///' list2 >alldrysamples

#copy directory structure to new folder reverb.
/usr/bin/find . -type d -print | /bin/cpio -pdumv reverb

for i in `cat alldrysamples`
do 

#play all samples out of channel 3 and record in channel 2
#and stop recording when silence is detected (reverb hooked 
#to 3 out and returns to in2). save in reverb folder.
/usr/bin/sox "$i" -c 1 -r 44100 -2 -s -t alsa sox3 | 		\
/usr/bin/sox -c 1 -r 44100 -2 -s -t alsa sox2 -t wav -r 44100 	\
-2 -s reverb/"$i" silence 0 1 00:00:00.1 -70d
done

#list all .wav files recursively from reverb directory
/usr/bin/find ./reverb -name "*.wav" >list

#replace spaces with ? in list filenames
/bin/sed 's/\ /?/' list >list2

#remove ./ from list2 filenames
/bin/sed 's/.\///' list2 >allreverbsamples

for i in `/bin/cat allreverbsamples`
do 

#increase vol and limit peaks (of all Reverbed)
/usr/bin/sox "$i" "$i".wav vol 1.5 amplitude 0.2

#normalize all reverb samples
/usr/bin/ssrc --normalize --twopass "$i".wav "$i"
/bin/rm "$i".wav
done

/usr/bin/find ./reverb/tailrev -name "*.wav" >list	

#replace spaces with ? in list filenames
/bin/sed 's/\ /?/' list >list2

#remove ./ from list2 filenames
/bin/sed 's/.\///' list2 >allreverbtailsamples

for i in `/bin/cat allreverbtailsamples`
do 

#trim first 0.51 seconds off beginning leaving just tail
/usr/bin/sox "$i" "$i".wav trim 0:00.51

#fade in fast the start of reverb tail samples to avoid clicks
/usr/bin/sox "$i".wav "$i" fade 0:00.05
/bin/rm "$i".wav
done

for i in `/bin/cat allreverbsamples`
do 

#dither all reverb samples
/usr/bin/ssrc --twopass --dither 3 --pdf 2 "$i" "$i".wav
/bin/mv "$i".wav "$i"

#rename reverb sample from "blah nn.wav" to "blahReverb nn.wav"
/usr/bin/rename \  Reverb\  "$i"
done

cd reverb/tailrev

#rename all folders in tailrev to include reverb
for i in `/bin/ls`; do /bin/mv "$i" "$i"ReverbTail; done

cd ..

#name folders in tailrev to include ReverbTail
for i in `/bin/ls`; do /bin/mv "$i" "$i"Reverb; done

#back to main folder
cd ..

/bin/mv reverb/tailrevReverb reverb/tailrev

/usr/bin/find ./reverb/tailrev -name "*.wav" >list

#replace spaces with ? in list filenames	
/bin/sed 's/\ /?/' list >list2

#remove ./ from list2 filenames
/bin/sed 's/.\///' list2 >allreverbtailsamples

for i in `/bin/cat allreverbtailsamples`
do

#name files below tailrev to include ReverbTail
/usr/bin/rename Reverb\  ReverbTail\  "$i"
done


#clean up
/bin/rm all*
/bin/rm list*
/bin/rm -R tailrev
					

Click to go to the list of items on this page.


17th August 2008

Bash Script To Convert Final Wav To Mastered MP3

This script is what I used for mixing and converting the wav files to mp3 of the demos on the gigasamples page. It is another useful script as it is often needed for final mixes to be made to the right level and converted to a smaller format. This script uses lame to convert to mp3. It is meant for doing one file at a time but you could easily change it to do multiple files by using a for loop. This is mainly here just to give you some lines and a helping hand to get your own scripts for your own purposes although you might find it useful as it is. It is well commented and is actually a very short script with out all of the comments.

Here is an uncommented version if you would rather see it without all the comments.

#!/bin/bash
############################################################
# A script to remove silence, compress, fade out, normalize,
# dither and then convert to mp3 from a wav file. i.e. mix
# from sequencer to mp3.
#
# To run this script on a single file assuming the script is
# called MixToMp3.sh you would type:-
# sh MixToMp3.sh input.wav output.mp3
# changing input.wav to match your wav name and output.mp3
# to whatever you want to call the result. If you leave out
# the output name it will put the resulting file in a folder
# called mp3. If the filename has a space in it you have to
# surround it with quotes. i.e. MixToMp3.sh "blah blah.wav"
#
# To do multiple files in a folder, copy the script to the
# folder with the wavs in and assuming the script is called
# MixToMp3.sh you would type:-
# sh MixToMp3.sh
# and the script will search for all wav files in the folder
#  and put the converted files in a folder called mp3. 
############################################################

# $1 and $2 are the first and second arguments input when
# running the script.i.e. input.wav and output.mp3

# if there is no first argument then list all wav files in
# directory in file "list" else print the input filename in
# "list".
if [ "$1" = "" ]
then
ls *.wav > list
else
echo "$1" >list
fi

# if there is no second argument and there is not a
# directory called mp3 then create it.
if [ "$2" = "" ] && [ ! -d mp3 ]
then
mkdir mp3
fi

# replace spaces with ? in list filenames (else it is seen
# as 2 filenames and does not work)
/bin/sed 's/\ /?/' list >list2

# Start looping through the files named in "list" doing 
# the commands below to each file
for i in `/bin/cat list2`
do

# Using sox to reverse the file to silence the end prevents
# silence from being removed during the middle and also 
# means I can fade out with out having a time to start fading
# out by fading in the start while reversed instead.

# This reverses the file using sox
sox "$i" temp.wav reverse

# This compresses and expands the audio volume bringing the
# soft levels up abit and also make the mixes come out at
# about the same volume as other mixes and also removes
# silence from the beginning (really the end). to remove the
# compressor just remove compand and all the numbers up to
# silence. The values used I took from the soxexam man page.
# You can read it for the description either by typing
# "man soxexam" in a terminal or search for the same online.
sox temp.wav temp2.wav compand 0.3,1 6:-70,-60,-20 -5 -90 0.2 \
silence 1 00:00:01 -50d

# This fades in (really out). comment out if not wanted.
/usr/bin/sox temp2.wav temp.wav fade p 00:00:10

# This reverses it back again
sox temp.wav temp2.wav reverse

#This removes silence from the real beginning
sox temp2.wav temp.wav silence 1 00:00:01 -50d

# This command makes sure it is the right format (using sox)
/usr/bin/sox temp.wav -r 44100 -2 -s temp2.wav

# This command normalizes the file using ssrc
/usr/bin/ssrc --twopass --normalize temp2.wav temp.wav

# This command dithers the file using ssrc
/usr/bin/ssrc --dither 3 --pdf 2 temp.wav temp2.wav

# if there was no argument 2 then convert to mp3 (using
# lame) and put result in mp3 folder with .mp3 on the end
# of the original name and then remove the .wav from that
# name  so as just to leave in the form "blah.mp3" not
# "blah.wav.mp3". Then changes ?'s back to spaces
if [ "$2" = "" ]
then
lame temp2.wav -V2 -h mp3/"$i".mp3
rename .wav "" mp3/"$i".mp3

rename ? "" mp3/"$i".mp3

else

# This command converts it to mp3 using lame and names the
# result as the second argument to the script
lame temp2.wav -V2 -h "$2"
fi

# End of loop
done

# This removes the temp files
rm temp.wav temp2.wav list list2

Click to go to the list of items on this page.