Pages: [1]   Go Down
Author Topic: Synthetiserphone finished !!!  (Read 1313 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
M0OOPHONE
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just finished building my own synthetiser  ! My first electronic device ever. Was so fun !! It s crazy how many hours i spent making holes and cutting wires, I m not a very craftish person, I like digital stuff more. But this electronic sculpture was a blast to build ! I ve never done any sort of electronics before this, so it was a lot of learning : )

I ve made a sound demo:

and here s some pics on Flickr : http://www.flickr.com/photos/12335826@N00/1306528722/in/photostream/
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

that is way cool, can we see the code and schematic?

D
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
M0OOPHONE
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
// TONES  ==========================================
//       note, period, &  frequency.

#define  R     0
#define  c     3830    // 261 Hz
#define  d     3400    // 294 Hz
#define  e     3038    // 329 Hz
#define  f     2864    // 349 Hz
#define  g     2550    // 392 Hz
#define  a     2272    // 440 Hz
#define  b     2028    // 493 Hz
#define  C     1912    // 523 Hz
#define  SN   10000    // SNARE
#define  KI   13000    // SNARE


// SETUP ============================================
int videoOut = 8;
int speakerOut = 9;
int subOut = 10;
int ledPin = 12;
int potPin = 2;    
int tempoOut = 0;    
int inPin = 7;   // choose the input pin (for a pushbutton)
int val = 0;     // variable for reading the pin status  


// Do we want debugging on serial out? 1 for yes, 0 for no
int DEBUG = 1;

void setup() {
  pinMode(speakerOut, OUTPUT);
  pinMode(subOut, OUTPUT);
  pinMode(videoOut, OUTPUT);
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  pinMode(inPin, INPUT);    // declare pushbutton as input
  
  if (DEBUG) {
    Serial.begin(9600); // Set serial out if we want debugging
  }
}

// MELODY and TIMING  =======================================
int melody[] = { KI};
int beats[]  = { 16};
int MAX_COUNT = sizeof(melody) / 2; // Melody length, for looping.

// CONFIG             =======================================
long tempo = 60000;
int pause = 5000;
int rest_count = 0; //<-BLETCHEROUS HACK; See NOTES
int tone = 0;
int beat = 0;
long duration  = 10;

// PLAY TONE  ==============================================
void playTone() {
  long elapsed_time = 0;
  if (tone > 0) {
    while (elapsed_time < duration) {

val = digitalRead(inPin);  // read input value

      digitalWrite(speakerOut,HIGH);
      if (val == HIGH) {     digitalWrite(subOut,HIGH); } else { };
      digitalWrite(videoOut,HIGH);
      digitalWrite(ledPin, HIGH);   // sets the LED on
      delayMicroseconds(tone / 2);

      digitalWrite(speakerOut, LOW);
      if (val == HIGH) {     digitalWrite(subOut,LOW); } else { };
      digitalWrite(videoOut, LOW);
      digitalWrite(ledPin, LOW);    // sets the LED off
      delayMicroseconds(tone / 2);

      // Keep track of how long we pulsed
      elapsed_time += (tone);
    }
  }
  else { // Rest beat; loop times delay
    for (int j = 0; j < rest_count; j++) { // See NOTE on rest_count
      delayMicroseconds(duration);  
    }                                
  }                                
}

// LET THE WILD RUMPUS BEGIN =============================
void loop() {
  int potone = analogRead(potPin);    // read the value from the sensor
  // Set up a counter to pull from melody[] and beats[]
  for (int i=0; i<MAX_COUNT; i++) {


    tone = potone*10 ;
    beat = beats[i];


    playTone();
    // A pause between notes...
    delayMicroseconds(potone*1000);

    if (DEBUG) { // If debugging, report loop, tone, beat, and duration
      Serial.print(i);
      Serial.print(":");
      Serial.print(beat);
      Serial.print(" ");    
      Serial.print(tone);
      Serial.print(" ");
      Serial.println(duration);
    }
  }
}




Voila!

I m glad you liek smiley-kitty

For the schematics well .. I ll make them tonight , they re gonna be a asshole to draw, there s 7-8 output pins and a couple more : p

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
What's that sound?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Aah, so that's why you've been so quiet.
Ecellent work!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
M0OOPHONE
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yay thanks narbotic : ) !!! no need to say you ve been my inspiration on this : ) Sorry bout the quietness smiley-kitty UPDATE YOUR BLOG !
Logged

Pages: [1]   Go Up
Jump to: