
ANNOYINGLY PERFECT PITCH
Put the mic in your mouth and give your Autotune
Kazoo a go. It will automatically turn your out-of-
tune humming into an appropriately annoying,
buzzy sawtooth wave — with perfect pitch!
Here’s a breakdown of the project code; you
can follow along in autotune_kazoo.ino.
The setup() initialization function (line 196) is
straightforward (Figure
E
on the following page
):
1. First we create a new instance of the
SawtoothWaveGenerator (line 200). This is
what produces the synthesized sound samples
that get fed out to the speaker.
2. Then we initialize the Yin algorithm (line 202)
implementation. We pass it a float value (0.2f ...