Adafruit Voice changer (minimal sketch)?
Moderators: adafruit_support_bill, adafruit

Re: Adafruit Voice changer (minimal sketch)?

by xl97 on Thu Mar 14, 2013 9:03 pm

hi-

'some' of the code has been tailored for my 'custom' variant of the Waveshield.. I'd use the code pburgess posted originally..

then look for the portion(s) that only change the internal reference to +5v..

(I also didnt use a pot.. but hard coded a value for testing)
xl97
 
Posts: 144
Joined: Mon Jul 27, 2009 12:51 pm

Re: Adafruit Voice changer (minimal sketch)?

by pburgess on Thu Mar 14, 2013 9:19 pm

Connect the mic output to one of the Arduino's analog pins, and write a small program that just sits in a loop reading the pin and printing the value to the serial port. In silence, the numbers should hover around 512. Shout at it and you should get the full range 0-1023. Might also need to fiddle with the gain pot on the board.
User avatar
pburgess
 
Posts: 2703
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

by keeleon on Thu Mar 14, 2013 11:34 pm

Connect the mic output to one of the Arduino's analog pins, and write a small program that just sits in a loop reading the pin and printing the value to the serial port. In silence, the numbers should hover around 512. Shout at it and you should get the full range 0-1023. Might also need to fiddle with the gain pot on the board.


Ok, so I uploaded this

Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  pinMode(A0, INPUT);
}

void loop() {

  int State = analogRead(A0);
  Serial.println(State);
  delay(1);
}


into the arduino, and connected the mic to 5v, GND and A0. All it does is cycle through around 540. I can yell into it, or snap at it or bang next to it with no change. I also tried it on A1 with the same result :(
keeleon
 
Posts: 29
Joined: Sun Jul 17, 2011 6:39 pm

Re: Adafruit Voice changer (minimal sketch)?

by keeleon on Thu Mar 14, 2013 11:37 pm

I am not using a pot for the mic, as I plan on just hardcoding it. Do you mean adjust the "volume" knob? That doesn't do anything either. I hope this mic didn't show up dead :( Is there something I could have done to break it? I barely touched it other than to solder the 3 wires.
keeleon
 
Posts: 29
Joined: Sun Jul 17, 2011 6:39 pm

Re: Adafruit Voice changer (minimal sketch)?

by pburgess on Fri Mar 15, 2013 12:38 pm

Well bummer, that does sound like a DOA board.

Please email support@adafruit.com and include your order number and a link to this post, and we'll get a replacement out to you.
User avatar
pburgess
 
Posts: 2703
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

by janz on Tue Apr 30, 2013 7:08 pm

Hello,
I've got a working wave shield and microphone wired as in the tutorial. The startup chime plays. Using the short code above I've tested the microphone. The analogRead(A0) sits around 330 with a range of 0 - 700 with loud sounds.

How do I hard code the pitch? I've tried putting different large and small integers instead of analogRead(1) but nothing happens.

Code: Select all | TOGGLE FULL SIZE

//////////////////////////////////// PITCH-SHIFT CODE

void startPitchShift() {

  // Read analog pitch setting before starting audio sampling:
  int pitch = analogRead(1);
  Serial.print("Pitch: ");
  Serial.println(pitch);


janz
 
Posts: 30
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

by janz on Tue Apr 30, 2013 7:50 pm

OK, something does happen...the pitch of my static changes..
janz
 
Posts: 30
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

by janz on Tue Apr 30, 2013 8:27 pm

Got it working. Because I wasn't using a pot, I didn't think that I needed the 3V to AREF. Then when i was looking through the code I noticed analogReference(external). I don't quite understand why, but with the extra wire least now it works.
janz
 
Posts: 30
Joined: Tue Mar 12, 2013 6:52 pm

Re: Adafruit Voice changer (minimal sketch)?

by heimerdanger on Sun Oct 26, 2014 8:50 am

I was going to make a third eye variation of the Demon and have mine wired like the Voice changer and Wave shield tutorial says. However, I am using the blue breadboard pot instead of the metallic looking 10k. Would that cause an issue with getting the voice changer to work? I've gotten the PiSpeak to work and have also had the shield play a song I put on the SD card and it sounds pretty nice. However when I try the adavoice sketch that does not use the SD card I get this odd kind of static. And since seeing this thread I tried that sketch that reads the mic output? and It hovers anywhere between 970 and 1023 on the Serial monitor. Any idea on what may be causing this issue? I have one new mic I was trying and an old one from a VU meter hat that worked to play with and they both haven't panned out. If it comes into question I am using Codebender, I have the Class D amplifier powered by the 3 AAAs pack and its running two of the speakers. The Uno is plugged into my computer and when I was going to make it portable I was going to power it with a powerbank. None of the LED backpacks are connected
heimerdanger
 
Posts: 4
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

by pburgess on Sun Oct 26, 2014 12:52 pm

Breadboard pot is fine.

Do you have 3.3V connected to AREF on the Arduino?
User avatar
pburgess
 
Posts: 2703
Joined: Sun Oct 26, 2008 2:29 am

Re: Adafruit Voice changer (minimal sketch)?

by heimerdanger on Sun Oct 26, 2014 2:25 pm

Does it also need to be joined with the vcc on the mic and the right leg of the pot? Thats how I had it but I may have had a bad grouping. Would it work the same to have the Aref connected directly to the 3.3v and the other connections on the second pinout of the 3.3v?
heimerdanger
 
Posts: 4
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

by heimerdanger on Sun Oct 26, 2014 6:21 pm

Update: Now that I tried to redo the group its just reads 1023 and something in the 900s when I tap on the mic using that code above. I just seen that if I wiggle the Class D amplifier that the digits will vary by about ten. Hmm Oh and thank you for the quick reply. I was up all night trying to figure out what may be wrong.
heimerdanger
 
Posts: 4
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

by heimerdanger on Sun Oct 26, 2014 9:05 pm

Yeah so the only thing that kept mine from working was a single ground wire I overlooked to the board from the 3 AAA and mic.
heimerdanger
 
Posts: 4
Joined: Sat Nov 02, 2013 1:19 am

Re: Adafruit Voice changer (minimal sketch)?

by pburgess on Sun Oct 26, 2014 10:23 pm

Whew...so you're all good then?
User avatar
pburgess
 
Posts: 2703
Joined: Sun Oct 26, 2008 2:29 am