Hi guys,
tackling a huge project. I’m new to Arduino making. Have started some courses and following a tutorial on this link http://www.instructables.com/id/DIY-Chewie-Monsta-Ed-Sheeran-Loop-Pedal/.
The website sums up what i’m doing I have spoken to the guy who has developed this loop pedal in the UK, but very hard to get in contact with him so would appreciate help from anyone on this forum I am making the loop pedal that Ed Sheeran uses to loop music (tracks), which is sent from the Arduino to a sound card then into my computer, into a software program called Ableton live. In Ableton live I use a VST looping software called Mobius loops the music/track. You can program what the foot switches do by using scripts he has attached in the link. I have been doing some programming tutorials for C++, I know, I know steep learning curve but i’m motivated to complete this project but I will really need alot of help.
To better understand how this all works check out the following links
This is the upgraded pedal he now sells
He has now upgraded to the following pedal which he does sell. Has added another pedal. He now has a midi in and out. I’m pretty sure he only had a midi out on his first version sending midi to Ableton software on the computer but I think he also has a midi in, into the Arudino to control his led’s from his mobius software on the computer then from the microchip itself. Not sure how he does this? I’m trying to look at the scripts from this page http://sonnit.co.uk/resourcescontent.html. You can see he says that he has some updated scripts with led functions. Those scripts are loading into the software on the computer (mobius). When I look at the scripts I can’t even see where he has even implemented this.
Have been doing some research to understand the code, but I am getting stumped because most of the literature for midi on the net says to use serial.begin, serial.write (cmd) (pitch) (velocity) etc, but he uses softwareserial in his code see below. I can also see how he’s using a pullup resister on the pedals and unsure why he is using momentary switches as for eg. When you push the pedal it should record the track and then when you press it again it should stop the recording of the track etc.
#include <SoftwareSerial.h>
SoftwareSerial midi(8,7); ///RX TX
int clearbtn = 14;
int recordbtn = 2;
int stopbtn = 3;
int track1btn = 5;
int track2btn = 6;
int track3btn = 11;
int modebtn = 4;
int undobtn = 13;
int led = 9;
int toggle1 = 0;
int toggle2 = 0;
int toggle3 = 0;
int toggle4 = 0;
int toggle5 = 0;
int toggle6 = 0;
int toggle7 = 0;
int toggle8 = 0;
int mode = 0;
void setup(){
pinMode (clearbtn, INPUT_PULLUP);
pinMode (undobtn, INPUT_PULLUP);
pinMode (recordbtn, INPUT_PULLUP);
pinMode (stopbtn, INPUT_PULLUP);
pinMode (track1btn, INPUT_PULLUP);
pinMode (track2btn, INPUT_PULLUP);
pinMode (track3btn, INPUT_PULLUP);
pinMode (modebtn, INPUT_PULLUP);
pinMode (undobtn, INPUT_PULLUP);
pinMode (led, OUTPUT);
digitalWrite(led, HIGH);
delay(250);
digitalWrite(led, LOW);
delay(250);
digitalWrite(led, HIGH);
delay(250);
digitalWrite(led, LOW);
delay(250);
digitalWrite(led, HIGH);
delay(250);
digitalWrite(led, LOW);
delay(250);
midi.begin(31250);
}
void loop(){
if (digitalRead(undobtn) == LOW && toggle1 == 0){
toggle1 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x41);
midi.write(0x01);
// delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x36);
midi.write(0x01);
// delay(300);
}
}
if (digitalRead(undobtn) == HIGH && toggle1 == 1){
toggle1=0;
if(mode == 0){
midi.write(0x90);
midi.write(0x41);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x36);
midi.write((byte)0x00);
delay(300);
}
}
if(digitalRead(clearbtn) == LOW && toggle2 == 0){
toggle2 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x01);
midi.write(0x45);
//delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x37);
midi.write(0x45);
//delay(300);
}
}
if(digitalRead(clearbtn) == HIGH && toggle2 == 1){
toggle2 = 0;
if(mode == 0){
midi.write(0x90);
midi.write(0x01);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x37);
midi.write((byte)0x00);
delay(300);
}
}
if(digitalRead(recordbtn) == LOW && toggle3 == 0){
toggle3 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x10);
midi.write(0x45);
//delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x35);
midi.write(0x45);
// delay(300);
}
}
if(digitalRead(recordbtn) == HIGH && toggle3 == 1){
toggle3 = 0;
if(mode == 0){
midi.write(0x90);
midi.write(0x10);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x35);
midi.write((byte)0x00);
delay(300);
}
}
if(digitalRead(stopbtn) == LOW && toggle4 == 0){
toggle4 = 1;
///Serial.println(“mute/stop”);
if(mode == 0){
midi.write(0x90);
midi.write(0x07);
midi.write(0x45);
//delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x34);
midi.write(0x45);
//delay(300);
}
}
if(digitalRead(stopbtn) == HIGH && toggle4 == 1){
toggle4 = 0;
if(mode == 0){
midi.write(0x90);
midi.write(0x07);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x34);
midi.write((byte)0x00);
delay(300);
}
}
if (digitalRead(track1btn) == LOW && toggle5 == 0){
toggle5 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x14);
midi.write(0x01);
// delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x33);
midi.write(0x01);
// delay(300);
}
}
if (digitalRead(track1btn) == HIGH && toggle5 == 1){
toggle5 = 0;
if(mode == 0){
midi.write(0x90);
midi.write(0x14);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x33);
midi.write((byte)0x00);
delay(300);
}
}
if (digitalRead(track2btn) == LOW && toggle6 == 0){
toggle6 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x15);
midi.write(0x01);
// delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x32);
midi.write(0x01);
// delay(300);
}
}
if (digitalRead(track2btn) == HIGH && toggle6 == 1){
toggle6 = 0;
if(mode == 0){
midi.write(0x90);
midi.write(0x15);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x32);
midi.write((byte)0x00);
delay(300);
}
}
if (digitalRead(track3btn) == LOW && toggle7 == 0){
toggle7 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x16);
midi.write(0x01);
// delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x31);
midi.write(0x01);
// delay(300);
}
}
if (digitalRead(track3btn) == HIGH && toggle7 == 1){
toggle7 = 0;
if(mode == 0){
midi.write(0x90);
midi.write(0x16);
midi.write((byte)0x00);
delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x31);
midi.write((byte)0x00);
delay(300);
}
}
if (digitalRead(modebtn) == LOW && toggle8 == 0){
toggle8 = 1;
if(mode == 0){
midi.write(0x90);
midi.write(0x17);
midi.write(0x01);
// delay(300);
}
if(mode == 1){
midi.write(0x90);
midi.write(0x30);
midi.write(0x01);
// delay(300);
}
}
if (digitalRead(modebtn) == HIGH && toggle8 == 1){
toggle8 = 0;
if(mode == 0){
mode = 1;
midi.write(0x90);
midi.write(0x17);
midi.write((byte)0x00);
digitalWrite(led, HIGH);
delay(300);
}
else if(mode == 1){
mode = 0;
midi.write(0x90);
midi.write(0x30);
midi.write((byte)0x00);
digitalWrite(led, LOW);
delay(300);
}
}
}
The videos will make more sense of all of this. I really want to understand this Arudino code. It’s seems like most of it is repeating but want to get my head around it.
Any help guys, I would be mostly appreciated and i’m motivated to completing this project.
Joey