Giter Site home page Giter Site logo

guitarpedal's Introduction

GuitarPedal

the purpose of this project is to create a DIY digital guitar pedal using an Arduino UNO. C/C++ the guitar signal, depedning on the potentiomenter/volume knob, will spit out an audio signal from -1V -> +1V we will use op amp setups to boost the signal by 2.5X, and then adjust it by +2.5V so taht it runs from 0V-5V. the arduino's input range is 0 -> 5V. the arduino has a built in ADC that will take the impedence matched input signal and convert it to digital. within the arduino there will be multiple programmed digital effects. the output will need to use a resistor set up to convert the signal back to digital and and op amp setup to modify it back to the original -1 -> +1V

guitarpedal's People

Watchers

Andrew Skowronski avatar

guitarpedal's Issues

Delay

what extra components does the setup need to store up to a couple minutes of audio information?
the arduino can only store like 1s.
also what would the code look like? what part of the sound wave gets delayed?

reverb

how does one code reverb?

understanding the inside of an op amp?

so i understand what op amps can do...impedance matching, voltage boosting, voltage shifting, volltage splitting, and i understand roughly how to set up an op amp, but i am unsure on what goes on in the inside of these common beasts.

code submitted for final project

here is the code i submitted for my final project...lol and attached below is my final paper

define Audio 0

define pwm3 OCR2B \sets the top of timer cycle

define pwm5 OCR0B

define pwm6 OCR0A

define pwm9 OCR1A

define pwm10 OCR1B

define pwm11 OCR2A

define phaseCorrect 0

define fastPWM 1

define analogPrescale2 B001

define analogPrescale4 B010

define analogPrescale8 B011

define analogPrescale16 B100

define analogPrescale32 B101

define analogPrescale64 B110

define analogPrescale128 B111

void setup() {
// put your setup code here, to run once:

pinMode(Audio, INPUT);\set pin as input
analogWrite(audioinput,0);\duty 0
waveformGenerationMode(0, fastPWM);\sets to fastPWM mode
timerPrescale(0, 1);\prescales timer 2
pinMode(pwm3, OUTPUT);\sets PWM3 to output
pinMode(pwm11, OUTPUT);\sets PWM11 to output
analogPrescale(analogPrescale32); \prescales the input by 9
}

void loop() {

\overdrive
value50 = 1 + ((float) 10 / (float) 20);
byte input = analogRead(left);
input = (input * value50);
output(left, input);
\crunch Delay
for(int i = 0; i < 2000; i ++) { // set up a loop
//array[i] = array[i] + array[i - 1]; //removes noise and some delay
output(left, array[i]);
array[i] = analogRead(left);
}
}
void output(int channel, short value) {
if(channel == audioinput) {
pwm3 = value >> 2;\outpus 6 bits
pwm11 = (value & B11) << 6;\outputs 2 bits
analogWrite(3,pwm3);\writes the top of the counter to change cycle frequency
analogWrite(11,pmw11);
}
}
void analogPrescale(int divisionFactor) {
ADCSRA &= ~B111; // clear analog prescale
ADCSRA |= divisionFactor;
}
int getTimer(int pin) {
switch(pin) {
case 5: case 6: return 0;\returns which timer is associated with each pin
case 9: case 10: return 1;
}
return 2; // 3, 11
}

int getChannel(int pin) {
switch(pin) {
case 6: case 10: case 11: return 0;
}
return 1; // 3, 9, 5
}
// - - -- timer settings

void waveformGenerationMode(int pin, int type) {
int timer = getTimer(pin);
int wgm = type == phaseCorrect ? B001 : B011;
if(timer == 0) {
TCCR0B &= ~(B1 << 3); // clear WGM02
TCCR0A &= ~B11; // clear WGM01 and WGM00
TCCR0A |= wgm; // set WGM01 and WGM00
} else if(timer == 2) {
TCCR2B &= ~(B1 << 3); // clear WGM23
TCCR2A &= ~B11; // clear WGM21 and WGM20
TCCR2A |= wgm; // set WGM21 and WGM20
}
}

void waveformGenerationMode(int pin, int type, int bits) {
int timer = getTimer(pin);
if(timer == 1) {
TCCR1B &= ~(B11 << 3); // clear WGM13 and WGM12
TCCR1A &= ~B11; // clear WGM11 and WGM10
TCCR1B |= (type << 3); // set WGM12
TCCR1A |= (bits - 7);
}
}

void timerPrescale(int pin, int prescale) {
int timer = getTimer(pin);
if(timer == 0) {
TCCR0B &= ~B111; // clear CS02 CS01 CS00
TCCR0B |= getPrescale01(prescale);
} else if(timer == 1) {
TCCR1B &= ~B111; // clear CS12 CS11 CS10
TCCR1B |= getPrescale01(prescale);
} else if(timer == 2) {
TCCR2B &= ~B111; // clear CS22 CS21 CS20
TCCR2B |= getPrescale2(prescale);
}
}

int getPrescale01(int prescale) {
switch(prescale) {
case 1: return B001;
case 8: return B010;
case 64: return B011;
case 256: return B100;
case 1024: return B101;
default: return B000;
}
}

int getPrescale2(int prescale) {
switch(prescale) {
case 1: return B001;
case 8: return B010;
case 32: return B011;
case 64: return B100;
case 128: return B101;
case 256: return B110;
case 1024: return B111;
default: return B000;
}
}

what really is pulse width modulation?

PWM is going to be the key to taking the digital output from the arduino and turning it back into an analog signal.
the way i understand it now is that pulse width modulation is a frequency based square signal that gets output through a resistor to obtain a certain difference in potential.

how this goes from a square wave through a resistor at a changing frequency to give a -5 -> 5V signal is still to be understood.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.