Looper
Introduction
The initial idea for this project was to develop a device that could read colored paper strips and, depending on the color detected, play a different note. However, I encountered a problem: when the tape was turned, the paper would tear. As a result, I adapted the project and ended up creating a looper.
A looper is an electronic instrument that allows recording, playing back, and layering sound in real time. In this case, the looper developed will not record audio but will detect physical changes such as color detection, button presses, and motor rotations. Based on these inputs, it will generate sounds that repeat in a loop.
Materials Used
- Lego EV3 Mindstorms
- Linux ALSA (Advanced Linux Sound Architecture) library
- C programming language
- Cross-compiler arm-ev3-linux-gnueabi-gcc
How It Works
The looper works by generating sound waves from physical events detected by the Lego EV3 sensors and motors. Digital signal generation is done using the formula for a sinusoidal wave:
where A represents the amplitude of the signal, f the frequency, and t the time instant. The amplitude determines the volume of the sound, while the frequency defines the pitch of the note. The time parameter t is essential as it allows calculating the instantaneous value of the wave, reconstructing the complete signal through sampling.
For digital sampling, the time instant t is replaced by the sample number (frame), using the following relation:
This way, the corresponding value of the wave is calculated for each sample, allowing the generation of a continuous digital signal that is then sent to the audio device via the ALSA library.
The system consists of several physical components, including:
- A motor responsible for rotating the conveyor belt.
- A motor dedicated to dynamically controlling the sound frequency.
- A sensor that detects white strips on the belt, used for loop synchronization.
- A button that initializes the system.
- A color sensor that identifies the paper colors to create the melody.
When the system initializes, the belt remains stopped, and the color sensor of the colored sheet starts working. Depending on the color it detects, it will generate a different note.
The right button activates the conveyor belt. As it moves, the color sensor detects the white strips on the belt, creating a background rhythm.
Detected events are temporarily stored, allowing cyclical playback in a loop. In this way, the system can layer sounds generated at different moments, simulating a traditional looper but replacing audio recording with procedural sound generation.
This design allows creating dynamic musical sequences based on physical interaction with the device, achieving an integration of mechanics, electronics, and programming.