📜 ⬆️ ⬇️

As the author of TV-B-Gone made ArduTouch music synthesizer

Arduino compliant musical instrument teaching digital signal processing




The article by Mitch Altman - the inventor who invented the universal remote to turn off the TV-B-Gone TVs, and the organizer of the hacker conferences

As a child, I was drawn to the music, and I was amazed at the sounds of the Moog synthesizer from the 1968 album Switched-On Bach . I needed to learn how to extract such sounds! So began the training and production of synthesizers with a length of life, parallel to my entry into the technology industry , where I eventually made TV-B-Gone , a gadget that allows you to turn off almost all models of TVs that are controlled from the console. Since gaining popularity in TV-B-Gone, I have made many kits for making fun open devices that I present around the world at homemade conferences . They begin to learn how to solder, make their way into the world of electronics and microcontrollers. Recalling my youth, I wanted to provide them with a set that is easy to assemble and use, but at the same time being a full-fledged musical synthesizer.

This is how the ArduTouch cost $ 30. This project includes a single board, a touch keyboard, an ATMega328P (the same processor used in the Arduino Uno) and an audio amplifier with a speaker. It also has a software library that can serve as an entry point into the world of digital signal processing.
')
The greatest difficulty in developing the board was the limited number of input / output pins of the ATMega328P. I used 12 pins for the keyboard to realize the entire chromatic music scale entirely. The keyboard is similar to the Stylophone - one of my favorite analog synths of the late 1960s - and uses a capacitive sensor for recognition. Two more pins are used for stereo audio output, while the other two are for serial data transmission (ArduTouch can be programmed using standard Arduino development tools , although an FTDI cable is required to connect to a computer). The remaining contacts were just enough for two buttons and two potentiometers controlling the synthesizer.

So that a person can immediately get audible results after soldering, I put an LM386 amplifier chip and a speaker on the board (the amplifier costs when connecting an audio jack). DAC chips are expensive, so I used pulse width modulation to encode the stereo audio channels coming out of the ATMega328P. Low-pass filters on each channel, consisting of a resistor and a capacitor, convert PWM to audio.

Experienced electronics engineers will understand that the ArduTouch scheme is simple. The basis of the project is a complex software synthesis audio library used for programming the ATMega328P.

It's pretty easy to get the microcontroller to give simple notes. Simply connect the speaker to the contacts, and alternate on and off, sending a square wave at different frequencies (this technology was used by Alan Turing himself in the Manchester Mark II computer). But the result is a sharp sound, far from the rich palette of the Moog synthesizer.

To improve the sound, I needed to turn to digital synthesizers. They are engaged in the creation of binary representations of audio waves, their distortion and the transformation of these numbers into analog signals. This can be done in many different ways, and I’m happy to note that ArduTouch supports quite a lot of different techniques, including the use of wave tables (using samples stored in memory) and the generation of sounds (audio counting on the fly).

After creating the basic binary representations of sound, we turn to the critical stage of its “distortion”. If you do not play with the sound, it is usually thin and sterile. Cool sounds are obtained after dynamic manipulation. ArduTouch is capable of applying many digital dynamic functions and effects, including tremolo, vibrato, portamento, as well as low and high pass filters.




ArduTouch uses relatively few components.


Even beginners can collect it.

And although conceptually all of the above is not something difficult to learn and understand, programming itself is quite complex. The ArduTouch library, which I created with my friend Bill Alessi, does all the low-level calculations — and it took us two years to create it.

The library is designed to be flexible and allow even inexperienced users to create new synthesizers that produce different sounds. The Thick synthesizer combining four sawtooth waves comes in a kit, and other synthesizers can be downloaded separately . Experienced users can learn how to create synthesizers from scratch, causing high level functions. I hope that people who like the project will create new synthesizers and share their code with me so that I can share it with others.

But even when using the default synthesizer, the sound is unexpectedly good for such a low-power microcontroller (which supports a sampling frequency of just 15 kHz) and inexpensive equipment. On my YouTube channel you can listen to many demonstrations of his work.

For the development of the project in the future, I will continue to improve the ArduTouch library for Arduino and upload additional ready-made synthesizers. I am also working on creating a more powerful version of ArduTouch, suitable for speeches. This will not be a set, but it will still be compatible with Arduino. It will have a 32-bit microcontroller with a lot of I / O pins, a DAC, a bunch of memory (which allows MIDI to be used), a small LCD screen, a few buttons and potentiometers, and LED indicators - and, of course, improved sound.

Source: https://habr.com/ru/post/433212/


All Articles