Difference between revisions of "AutoHarmonizer"
| Line 29: | Line 29: | ||
| − | {|[[File:PCB Top.jpg|thumb|center]] | + | {|[[File:PCB Top.jpg|thumb|center]] [[File:PCB Bot.jpg|thumb|center]]|} |
Revision as of 20:03, 24 August 2025
Overview The AutoHarmonizer is a small, compact device that allows the user to sing, speak, or make whatever sound and based on user-input, output pitch shifted audio by the chosen amount of semi-tones. The device has an onboard screen that tells the user the frequency of the incoming audio, the closest calculated note, the semi-tone shift, as well as the outgoing audio's calculated note.
Intro Sometimes when singing, you want to harmonize! However you don't always have another person with you and they might not know how to sing! The intervals also might not be exact and maybe you don't have the same range! The idea of an AutoHarmonizer is a cool device that lets you fool around with cool harmonies all by yourself without any complicated hardware or software. It is a great tool to have some fun as well as to learn about musical intervals and harmonies in general.
Objectives
The goal of this project was to create a very small, compact device that is able to output the incoming audio at a different interval.
The device would be controlled on an microcontroller utilizing I2S communication.
A single encoder would be utilized to keep the device simple.
An onboard microphone will be used to detect the incoming audio.
Powered by a 9V for a longer use time.
And finally a 3D-printed shroud to keep everything together.
The Thought Process
Originally I started by searching for the correct microcontroller based on my requirements. The classic ESP-32 is great, however it doesn't have precise computation timing which isn't the best for audio. The teensy also has dedicated high speed peripherals including I2S. But most importantly, the teensy has an expansive Teensy Audio Library with many optimized functions that the ESP-32 lacks. And ultimately the teensy is tiny! Much smaller than an ESP-32, especially when choosing the teensy 4.0!
I needed a small screen that could display a lot of information at once. For this, an OLED just made sense as it is so customizable. I decided to go with an I2C OLED to utilize the very high speed of the teensy. The I2C bus would also be unutilized without it, so why not make use of it.
A very basic mechanical rotary encoder with detents would be perfect for the control knob, no built in switch needed, just channel A and channel B!
To power the teensy from a 9V, a 5V buck converter was necessary. I found the smallest one I could.
A simple 2 pole switch would be all that's needed to turn the device on and off.
For audio, an electret mic with a pre-amp already implemented would be great to pickup analog audio and feed it into the microcontroller. However, in order to do this seamlessly, I would utilize an audio shield for the teensy, which is also tiny and has tons of features. Mainly the Line-In and the 3.5mm audio jack on the shield, which I decided I could use as the audio output.
And of course a custom PCB in order to very neatly organize and connect together all the components!
- Rotary encoders with non clean edges
- Incredibly noisy I2C lines
- Very power hungry OLED
Final Thoughts This project was really fun. I learned a lot about different pitch shifting algorithms and how complicated and difficult it is to create natural sounding, non sped up or slowed down audio, that doesn't make you sound like a chipmunk. Even though I wasn't able to make it sound super natural, I am still happy with the outcome. I always love learning more about ECE and so this was another great learning experience. Maybe eventually I will return to this project and make it even cleaner and smaller!
