author
2CommentsBarcelona, SpainJoined September 15th, 2017
Electronic technician and amateur musician.
  • Oscilador made the instructable Arduino Compatible Luna Mod Looper1 year ago
    Arduino Compatible Luna Mod Looper

    Great project!! Thanks for the guiding! I made the project basing on the JorgeG77 idea of putting two pots for independant recording a more crazy sound... I also added an extra led for advising the beggining of the cicle.It was made in a subwoofer box that I found in the street... Thanks again!Here the code:/*** LunaMod for Arduino & Attiny45* Remix by Rob Miles* Tacoma, WA August 8th 2011** I saw the original project in Make vol. 26* by Brian McNamara* Brian's was running on a PicAxe and I only have attiny45s so.......** The freqout section where the real magic happens is from Paul Badger's synth code on the main Arduino site** I kept this pretty straight forward but with an Arduino this could get a lot more complicated if you like* Even on an attiny45 if you use you add a button t...

    see more »

    Great project!! Thanks for the guiding! I made the project basing on the JorgeG77 idea of putting two pots for independant recording a more crazy sound... I also added an extra led for advising the beggining of the cicle.It was made in a subwoofer box that I found in the street... Thanks again!Here the code:/*** LunaMod for Arduino & Attiny45* Remix by Rob Miles* Tacoma, WA August 8th 2011** I saw the original project in Make vol. 26* by Brian McNamara* Brian's was running on a PicAxe and I only have attiny45s so.......** The freqout section where the real magic happens is from Paul Badger's synth code on the main Arduino site** I kept this pretty straight forward but with an Arduino this could get a lot more complicated if you like* Even on an attiny45 if you use you add a button to the led pin you coud sneak in more effects**/#define frequencyPot 0 //frequency pot tied to A0#define frequencyPot2 2 //frequency pot 2 tied to A2#define tempoPot 1 //tempo pot tied to A1#define buttonPin 8 //programming button tied to D8#define buttonPin2 9 //programming button 2 tied to D9#define ledPin 10 //status led tied to D10#define ledPin2 6 //status led tied to D6, comienzo de ciclo#define speakerPin 11 //speaker or output D11int currentStep = 0; //this is just to track which tone in memory we are currently playingint steps[] = {500,500,100,100,100,100,100,100, // this is our tone storage areae 100,100,100,100,100,100,100,100, //I used 64 tones or 8 tones per beat 500,500,100,100,100,100,100,100, //you can change these manually and experiment if you like 100,100,100,100,100,100,100,100, 500,500,100,100,100,100,100,100, 100,100,100,100,100,100,100,100, 500,500,100,100,100,100,100,100, 100,100,100,100,100,100,100,100};int steps2[] = {500,500,100,100,100,100,100,100, // this is our tone storage areae 100,100,100,100,100,100,100,100, //I used 64 tones or 8 tones per beat 500,500,100,100,100,100,100,100, //you can change these manually and experiment if you like 100,100,100,100,100,100,100,100, 500,500,100,100,100,100,100,100, 100,100,100,100,100,100,100,100, 500,500,100,100,100,100,100,100, 100,100,100,100,100,100,100,100};int tempo = 0; //tempo or speed between tonesint duration = 0; //how long each of the 64 tones playsint frequency = 0; //current toneint pitchval = 1;void setup() //set up your pins....{ pinMode (frequencyPot, INPUT); pinMode (tempoPot, INPUT); pinMode (buttonPin, INPUT); pinMode (buttonPin2, INPUT); digitalWrite(buttonPin, HIGH); digitalWrite(buttonPin2, HIGH); pinMode (ledPin, OUTPUT); pinMode (ledPin2, OUTPUT); pinMode (speakerPin, OUTPUT); }void loop(){ for (int i=0; i<63; i++) //64 individual notes played { currentStep = i; //save our current position in the loop for later if (i == 0 || i == 16 || i == 32 || i == 48){ //keep track of the beat on the led digitalWrite(ledPin, HIGH);} if (i == 7 || i == 23 || i == 39 || i == 55){ //keep track of the beat on the led digitalWrite(ledPin, LOW);} //Led rojo de inicio de loop if (i == 0) { //keep track of the beat on the led digitalWrite(ledPin2, HIGH);} if (i == 7) { digitalWrite(ledPin2, LOW);} //Primer oscilador if (digitalRead(buttonPin) == LOW) //is the program button being pressed { //if so lets write a new tone the this location steps[currentStep] = (analogRead(frequencyPot)); //read the frequency pot and set the new tone freqout (steps[currentStep], duration); //set the parameters for frequout below and play it freqout (steps[currentStep]+64, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking freqout (steps[currentStep]+128, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking } else { //else play the tone freqout (steps[currentStep], duration); //set the parameters for frequout below and play it freqout (steps[currentStep]+64, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking freqout (steps[currentStep]+128, duration); //play another tone a little bit different than the original to give } //it a little more depth. this can be changed to your liking //Segundo oscilador if (digitalRead(buttonPin2) == LOW) { steps2[currentStep] = (analogRead(frequencyPot2)); //read the frequency pot and set the new tone freqout (steps2[currentStep], duration); //set the parameters for frequout below and play it freqout (steps2[currentStep]+64, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking freqout (steps2[currentStep]+128, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking } else { freqout (steps2[currentStep], duration); //set the parameters for frequout below and play it freqout (steps2[currentStep]+64, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking freqout (steps2[currentStep]+128, duration); //play another tone a little bit different than the original to give //it a little more depth. this can be changed to your liking } //Velocidad tempo = (analogRead(tempoPot)/4); //read the tempo pot duration = tempo/8; //set the individual tone durations delay(tempo); //wait a bit}}void freqout(int freq, int t){ int hperiod; long cycles, i; hperiod = (500000 / ((freq - 7) * pitchval)); cycles = ((long)freq * (long)t) / 1000; for (i=0; i<= cycles; i++) { digitalWrite(speakerPin, HIGH); delayMicroseconds(hperiod); digitalWrite(speakerPin, LOW); delayMicroseconds(hperiod - 1); }}

    View Instructable »