Saturday, January 7, 2012

Guitar Distortion in Python

I've written a Python program that computes the arctangent of every discrete value of a wave file. The arctangent is a non-linear function therefore the amplification of the input signal will also be non-linear resulting in a distorted sound. This script is perfect for performing distortion on a pre-recorded guitar sample.

Click here to download the script.

I recorded a clean guitar sample and then processed it with Audacity and distort.py. I did it in the following steps:

  • Apply Audacity's high-pass filter with settings: Rolloff=6dB , Filter Quality = 0.7, cutoff frequency = 1001HZ
  • Export the file as a 16-bit stereo wave at 44100HZ.
  • Close Audacity
  • Process the output with distort.py 
    • python distort.py clean.wav distorted.wav
  • Add the following code to your EQCurves.xml file (located at <user name eg. root>/.audacity-data, under Linux).
  • Open Audacity
  • Import the output file from distort.py into Audacity.
  • Go to the "Effect" menu and apply the Equalization effect, select the distortion curve.
  • Go to the "Effect" menu and apply the BassBoost effect with settings : Frequency = 200HZ , Boost = 12dB
  • Repeat applying BassBoost as much as you like.
  • Your final recording should sound something like this.

Enjoy :)



Links:


    No comments:

    Post a Comment