Welcome, Guest
Username: Password: Remember me

TOPIC: Echo + Delay Effect.

Echo + Delay Effect. 4 months 1 day ago #1649

  • Ray
  • Ray's Avatar
  • OFFLINE
  • Moderator
  • Posts: 615
  • Thank you received: 138
  • Karma: 38
This effect combines the Delay and Effect. Both are essentially the same in terms of programming, the only difference is the audio relays:

delay_2019-01-25.jpg

echo_2019-01-25.jpg


This code will change the configuration of the relay when you push the TAP button, so when is not pushed stay in Delay configuration and when pressed goes into Echo.
You can check the Delay and the Echo codes if you have any question:
The complete code looks like this:
// CC-by-www.ElectroSmash.com Delay + Echo Effect Pedal.
// More info about the project at www.ElectroSmash.com/Time-Manipulator
 
// Pin Definitions: 
#define DELAY1 10
#define DELAY2 9
#define SWA 3
#define SWB 14
#define SWC 2
#define SWD 4 
#define LED1_G 1 
#define LED1_R 0
#define LED2_G 5
#define LED2_R 6
#define ENC_A 16
#define ENC_B 18
#define ENC_GND 17
#define ENC_PUSH 19
#define BYPASS_DETECT 8
#define TAP_DETECT  15

//VARIABLES
unsigned int ENC_counter = 100; 
int ENC_aState;
int ENC_aLastState;  
int ENC_aState_selection=0;
int ENC_aLastState_selection=0;
 
// the setup function runs once when you press reset or power the board
void setup() 
{
//set the pins //init the values
pinMode(DELAY1, OUTPUT);    analogWrite(DELAY1, 100);
pinMode(DELAY2, OUTPUT);    analogWrite(DELAY2, 100);
pinMode(SWA, OUTPUT);       digitalWrite(SWA, LOW);
pinMode(SWB, OUTPUT);       digitalWrite(SWB, LOW);
pinMode(SWC, OUTPUT);       digitalWrite(SWC, LOW);
pinMode(SWD, OUTPUT);       digitalWrite(SWD, LOW);
pinMode(LED1_G, OUTPUT);    analogWrite(LED1_G, 0);
pinMode(LED1_R, OUTPUT);    analogWrite(LED1_R, 0);
pinMode(LED2_G, OUTPUT);    analogWrite(LED2_G, 0);
pinMode(LED2_R, OUTPUT);    analogWrite(LED2_R, 0);
pinMode(ENC_A, INPUT_PULLUP);
pinMode(ENC_B, INPUT_PULLUP);
pinMode(ENC_GND, OUTPUT);
pinMode(ENC_PUSH, INPUT_PULLUP);
pinMode(BYPASS_DETECT, INPUT_PULLUP);
pinMode(TAP_DETECT, INPUT_PULLUP);
ENC_aLastState = digitalRead(ENC_A); 
void read_encoder(void);
}
 
 
void loop() // the loop function runs over and over again forever
{
//detect if the effect is on or off
while((digitalRead(BYPASS_DETECT) == LOW)) 
  {
  digitalWrite(LED1_R,LOW);digitalWrite(LED2_R,LOW);digitalWrite(LED1_G,LOW);digitalWrite(LED2_G,LOW); 
  }  
read_encoder();
//update the delay value based on the encoder reading
analogWrite(DELAY1, ENC_counter);
analogWrite(DELAY2, ENC_counter);
 
//set the audio relays & LEDs  depending on the TAP footswitch (so you have delay or echo)
if (digitalRead(TAP_DETECT) == LOW)
  {//echo
  digitalWrite(LED1_G,HIGH); digitalWrite(LED2_G,HIGH);digitalWrite(LED1_R,LOW);  digitalWrite(LED2_R,LOW);
  digitalWrite(SWA, HIGH);digitalWrite(SWB, HIGH);digitalWrite(SWC, HIGH);digitalWrite(SWD, HIGH); 
  }
  else
  {//delay
  digitalWrite(LED1_G,LOW); digitalWrite(LED2_G,LOW);digitalWrite(LED1_R,HIGH);  digitalWrite(LED2_R,HIGH);   
  digitalWrite(SWA, LOW);digitalWrite(SWB, HIGH);digitalWrite(SWC, HIGH);digitalWrite(SWD, LOW);
  }
}
 
void read_encoder(void)
{
 ENC_aState = digitalRead(ENC_A); // Reads the "current" state
   if (ENC_aState != ENC_aLastState)
   {    
     if (digitalRead(ENC_B) != ENC_aState) 
          {if(ENC_counter>50)ENC_counter-=5;}
     else 
          {if(ENC_counter<230)ENC_counter+=5;}   
   } 
ENC_aLastState = ENC_aState; // Updates the prev. state 
 
}


File Attachment:

File Name: Time-Manipulator_delay_and_echo.zip
File Size: 1 KB
The administrator has disabled public write access.
Time to create page: 0.130 seconds
Powered by Kunena Forum
Joomla SEF URLs by Artio