Distort Voice to Something Scary for Halloween?

Status
Not open for further replies.

r0b0ty

New member
Hi, guys.

I purchased a Teensy 3.2 with the Audio Kit (and amp + speaker) to make a Halloween project. Basically, I want to speak into the mic and output a heavily distorted, scary ("demonic") voice. I tried modifying the various sample code from the Audio Tutorial, but I didn't even come close. I just sound like I swallowed a frog or something. Can anyone steer me the right way? I am just not well-versed with audio and corresponding theory, so any help is greatly appreciated! Thanks in advance!
 
Hi, guys.

I purchased a Teensy 3.2 with the Audio Kit (and amp + speaker) to make a Halloween project. Basically, I want to speak into the mic and output a heavily distorted, scary ("demonic") voice. I tried modifying the various sample code from the Audio Tutorial, but I didn't even come close. I just sound like I swallowed a frog or something. Can anyone steer me the right way? I am just not well-versed with audio and corresponding theory, so any help is greatly appreciated! Thanks in advance!

You might find something in the code here: https://learn.sparkfun.com/tutorials/vox-imperium-stormtrooper-voice-changer
Stormtrooper voice shifting seems like a similar proposition.

D
 
The code below creates a sort of "Dalek" effect by multiplying the microphone input with a low frequency sine wave. It works with a T3.2 (or higher) and audio board.
Is this distorted enough?

Pete

Code:
// A Dalek sort of effect for Teensy 3.2 (or higher) and the audio board.
// Also needs a microphone and headphones.
// Copyright 2017 by Pete (El_Supremo) but 

#define ARM_MATH_CM4
#include <arm_math.h>
#include <Audio.h>
#include <Wire.h>
#include <SD.h>
#include <SPI.h>

const int myInput = AUDIO_INPUT_MIC;
//const int myInput = AUDIO_INPUT_LINEIN;

AudioInputI2S            audioInput;     // audio shield: mic or line-in

AudioSynthWaveformSine   sine1;          //xy=357,126
AudioEffectMultiply      multiply1;      //xy=521,242
AudioEffectMultiply      multiply2;      //xy=522,443
AudioOutputI2S           i2s1;           //xy=781,308
// See comment about mixers below (mixer_gain)
AudioMixer4              mix1;
AudioMixer4              mix2;

AudioConnection          patchCord1a(audioInput,0,mix1,0);
AudioConnection          patchCord1b(audioInput,1,mix2,0);
AudioConnection          patchCord2a(mix1, 0, multiply1, 0);
AudioConnection          patchCord3a(sine1, 0, multiply1, 1);
AudioConnection          patchCord2b(mix2, 0, multiply2, 0);
AudioConnection          patchCord3b(sine1, 0, multiply2, 1);
AudioConnection          patchCord4a(multiply1, 0, i2s1, 0);
AudioConnection          patchCord4b(multiply2, 0, i2s1, 1);

AudioControlSGTL5000 audioShield;

void setup() {

  Serial.begin(9600);
  unsigned long t_start = millis();
  // wait for Serial to instantiate or for 10 seconds to elapse
  // whichever comes first.
  while (!Serial && (millis() - t_start < 10000)) ;

  // 16 is plenty of memory
  AudioMemory(16);

  audioShield.enable();
  audioShield.inputSelect(myInput);
  // The MEMS microphone already has 60dB of gain.
  // It doesn't need any more!
  audioShield.micGain(0);
  audioShield.volume(.5);

  AudioProcessorUsageMaxReset();
  AudioMemoryUsageMaxReset();

  // Play with the frequency of the sine wave.
  // 25 seems to give a nice growl
  sine1.frequency(25);
  // amplitude of sine wave is floating point number from 0 to 1
  sine1.amplitude(1.0);

  /* The mixers are used to reduce the gain on a MEMS microphone
    which has a builtin gain of 60dB (or more). With that much gain
    the microphone picks up room noises, such as the computer fans,
    and amplifies and "daleks" them. Reducing the gain reduces the
    sensitivity to background noise.
    If you aren't using a MEMS microphone, you might find it best to
    increase audioShield.micGain and set mixer_gain to 1.0
   */
  float mixer_gain = 0.25;
  mix1.gain(0, mixer_gain);
  mix2.gain(0, mixer_gain);
   
  Serial.println("setup done");

}

void loop() {
  static int volume = 0;

  int n = analogRead(15);
  if (n != volume) {
    volume = n;
    audioShield.volume(n / 1023.);
  }
}
 
I was just thinking about a Dalek simulation. I'm gonna have to try this out. Thanks for posting, I was thinking not enough time before halloween to try something.

"Exteeerminaaate"

I think sawtooth waves are kinda grating, but not sure how one would do that.
 
To play with other waveforms, change
Code:
AudioSynthWaveformSine   sine1;
to
Code:
AudioSynthWaveform       sine1;

and before this
Code:
  // Play with the frequency of the sine wave.
  // 25 seems to give a nice growl
  sine1.frequency

insert this:
Code:
/*
  Choose a waveform:
  WAVEFORM_SINE
  WAVEFORM_SAWTOOTH
  WAVEFORM_SAWTOOTH_REVERSE
  WAVEFORM_SQUARE
  WAVEFORM_TRIANGLE
*/
  sine1.begin(WAVEFORM_TRIANGLE);

The square and sawtooth add lots of noise - although I didn't play with their amplitude which might help. The triangle is OK though.

Pete
 
I tried recording it to USB but the gain was really low. Not sure why.

I mainly came here to say that I found this site:
http://webaudio.prototyping.bbc.co.uk/ring-modulator/

The ring modulator works by taking two inputs and multiplying them together. In the original Ring Modulator a tape loop with a 30Hz sine wave tone was combined in real time as an actor spoke into a microphone. The diodes in the machine also gave the effect its characteristic distortion.
 
What kind of microphone are you using? If it's not a MEMS microphone with 60dB on the module, this comment in the code above applies:
If you aren't using a MEMS microphone, you might find it best to
increase audioShield.micGain and set mixer_gain to 1.0

Pete
 
I'm using an electret mic, but the gain is fine w/headphones or line out.

It was just the output over USB. I'm not sure why cause I had it working in another sketch at nice levels.

I'll try and make sure my other sketch is working fine too, but I didn't really need it, was just wanting to do a recording.
 
Thanks a lot, guys! I'll try to make use of some of this. I will need to lower the pitch of my wife's voice (as this experiment is for her). I'll play around with this. Thanks again, and if you have further advice, please let me know. Thanks, again!
 
Status
Not open for further replies.
Back
Top