[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Open Music Labs Forums • View topic - Guitar Effects Algorithms

Guitar Effects Algorithms

Guitar Effects Algorithms

Postby diydsp » Mon Jul 23, 2012 7:03 pm

This is a dual tremelo that I've been having fun with:
Attachments
RingAndTrem05.zip
Each knob controls one tremelo. Explore the combinations of slow and fast settings.
(1.69 KiB) Downloaded 585 times
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Re: Guitar Effects Algorithms

Postby diydsp » Mon Jul 23, 2012 7:08 pm

This one is a digital divide-by-1.5x sound with a noise gate. In goes 999 Hz, out comes 666 Hz.... under a certain set of conditions... usually guitar sounds progress through a sequence of dominant tones and choosing different pickups and tone settings on the guitar leads to different envelopes.

It's kind of like setting up a guitar signal to drive a divide-by-3 counter, except that the counter is clocked on both up-going and down-going transitions of the input waveform. There are some long, drawn-out reasons why you might want to do this and I'll get to them at another time.. For now, just enjoy it as a sound :)
Attachments
DividingDistortion01.zip
frequency divider, divided-by-1.5
(2.26 KiB) Downloaded 595 times
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Re: Guitar Effects Algorithms

Postby diydsp » Mon Jul 23, 2012 7:26 pm

Although this one is named "Wah05," it's not actually a wah-wah pedal yet, just the filter part, with a distortion module inline following the filter. Mod 1 = Distortion, Mod 0 = filter frequency...

stick around and we'll modify this code to be a wah pedal with just a few adjustments.

Wah05.zip
Mod1= Distortion Depth, Mod2=Wah/Band-Pass filter center frequency, implemented as a state-variable filter (SVF).
(1.9 KiB) Downloaded 570 times


p.s. I'm developing these programs with a prototype Aristocrat pedal, but all of this will work identically for any audio system built from an Audio Codec Shield and a Maple. Arduino can not handle this type of stuff at full sample rate and 16-bits like Maple can.
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Re: Guitar Effects Algorithms

Postby diydsp » Mon Jul 23, 2012 8:03 pm

....and in case anyone wants an audio demo... here's Wah05, hand-controlling mod0 (of "Fc", center frequency) on the Audio Codec Shield:

Wah05.mp3.zip
9 Second loop of two open chords playing through medium-Q bandpass filter sweeping up and down + light clipping distortion.
(217.37 KiB) Downloaded 578 times
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Re: Guitar Effects Algorithms

Postby diydsp » Mon Jul 23, 2012 8:15 pm

...all while we're at it, I'd like to include the frequency spectrum of this simple program... you can see how the frequency hops up and down as I twist the knob super fast. you can also see the distortion at the beginning of the second half as a ghost image of overtones, slightly above the fundamentals :)
Attachments
Wah05small.jpg
Frequency Spectrum plot of the 9 second Wah05 demo audio above.
Wah05small.jpg (159.5 KiB) Viewed 8593 times
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Re: Guitar Effects Algorithms

Postby clee » Wed Aug 15, 2012 1:18 pm

What fun! Thanks for the code and spectrum.
clee
 
Posts: 7
Joined: Thu Jul 05, 2012 10:18 pm

Re: Guitar Effects Algorithms

Postby diydsp » Mon Aug 27, 2012 5:00 pm

Attachments
SpectralShot02.jpg
Spectral representation of the what the sequenced pitch-shifter does do a guitar signal
SpectralShot02.jpg (237.31 KiB) Viewed 8519 times
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Sample and Hold and Bit Crusher

Postby diydsp » Thu Oct 11, 2012 7:56 pm

Here's a little program I've been working on. It does two Lo-Fi effects: A BitCrusher and a Sample and Hold. One reduces information in the time domain and the other lessens dynamic range by creating an increased noise floor. If you twirl the knobs, you get some nice timbres... this would be good with an LFO :) or envelope follower :)


// SampleAndHoldAndBitCrush03 (diydsp)
// mod0 = BitCrusher amount
// mod1 = Sample and Hold frequency
//
//based on Open Music Lab's GuestPitch01
/* Pitch Shifter loosely based on Open Music Lab's miCrODEC pitch shifter */
// -no interpolation between points yet
// -two taps move through the buffer at the same rate
// -tap amplitudes have triangle overlap windows
// -MOD1 controls amount of pitch shift

#define SAMPLE_RATE 44 // 44.1kHz sample rate
#define ADCS 2
#include <AudioCodec_Maple.h>


int16 left_in, right_in, left_out, right_out;
uint16 prev_left_in_mag=0;
uint16 mod0_value = 0,mod1_value=0;

uint16 countDownMax=1000;
int16 countDownVal=100;

int16 BitCrush(int16 inVal);
int16 SampleAndHold(int16 inVal);


void setup() {
SerialUSB.end();
AudioCodec_init();

//nvic_irq_disable(NVIC_USB_LP_CAN_RX0);
}

void loop() {
while (1);
} // reduce clock jitter

int32 inputFilt=0;

uint16 SampHoldOut=0;

// timer4_ch1 interrupt routine - all data processed here
void AudioCodec_interrupt()
{

AudioCodec_data(&left_in, &right_in, left_out, right_out);
AudioCodec_ADC(&mod0_value,&mod1_value);

// Main Processing Chain
SampHoldOut = SampleAndHold(left_in);

left_out = BitCrush(SampHoldOut);
}

int16 SampleAndHold(int16 inVal)
{
static int16 outVal = 0; // keep local to this function

countDownVal = countDownVal - 1;
if(countDownVal <= 0){

// Mod1 controls interval
countDownMax = 1 + ( (0xffff^mod1_value) >> 8);
countDownVal = countDownMax;

outVal = inVal;
}
return outVal;
}

int16 BitCrush(int16 inVal)
{
// bit crush
uint16 numberOfBits = mod0_value>>12;
uint16 mask = 0xffff<< numberOfBits;
uint16 andVal = (0x8000|mask);
int16 outVal = inVal & andVal;

return outVal;
}
http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm


Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 1 guest


cron