PWM in Audio Synthesis: Creating Unique Sounds

Pulse Width Modulation (PWM) Control / Visits:0

For decades, the pursuit of unique sound in electronic music and synthesis has driven artists and engineers to repurpose technology in radical ways. From circuit-bending children’s toys to hacking game consoles, the ethos has always been to find the hidden voice within the machine. Today, a fascinating convergence is happening on workbenches and in studios, where a technique as fundamental as Pulse Width Modulation (PWM) is escaping the silicon chip and finding a thrilling, physical expression through an unlikely agent: the micro servo motor. This isn't just about generating a signal; it's about making sound tangible, visual, and unpredictably organic.

The Digital Heartbeat: Understanding PWM

Before we hear the whirr and click of servos, we must understand the core principle.

What is Pulse Width Modulation?

At its simplest, PWM is a method of encoding information in a digital signal. Unlike an analog voltage that varies smoothly, a PWM signal is a rapid series of on/off pulses. The key parameter is the duty cycle—the percentage of time the signal is "on" (high) within each cycle. A 50% duty cycle is square; 25% is a narrow pulse; 75% is a wide pulse. By varying this duty cycle at an audio rate (frequencies we can hear, roughly 20 Hz to 20 kHz), we can directly synthesize sound.

PWM in Traditional Synthesis

In classic analog synthesizers, PWM is famously applied to a square wave. By modulating the duty cycle of that square wave with a low-frequency oscillator (LFO), you create a rich, chorusing, moving sound—the iconic PWM string pad heard in 80s pop and film scores. It works because changing the duty cycle changes the harmonic content of the wave; narrower pulses contain more high-frequency harmonics. This is PWM as a timbral tool.

But what if the PWM signal itself is the sound source? And what if it’s not driving a speaker, but something mechanical?

The Unlikely Instrument: The Micro Servo Motor

Enter the humble micro servo (like the ubiquitous SG90). Designed for precise angular positioning in RC models and robotics, it contains a small DC motor, a gear train, and control circuitry. It’s commanded by—you guessed it—a PWM signal. But this PWM is for positioning, not sound: a pulse of 1.5ms width typically centers the servo at 90 degrees.

The Sonic Potential of Mechanical Agitation

A servo’s purpose is to move. When fed a standard 50Hz control signal, it moves quietly to a position and holds. But when we start feeding it signals at audio frequencies, everything changes. The servo can no longer settle; it jitters, vibrates, and strains against its own mechanics in a desperate attempt to follow impossible commands. This struggle is not a failure—it’s a symphony.

The servo becomes a transducer. Its gear train grinds, its motor whines, its plastic casing resonates. The entire physical assembly transforms electrical pulses into a complex palette of percussive clicks, resonant drones, and textured noise. This is physical modeling synthesis in its most direct, brutal form.

Crafting Sound from Movement: Techniques and Textures

Hacking a micro servo for audio synthesis involves bypassing its control board or exploiting it creatively. Here are the primary methods.

Direct Drive: The Raw Signal

By disconnecting the servo’s motor from its control circuitry and connecting it directly to an audio amplifier, you can drive it with audio-rate PWM from a microcontroller (like an Arduino or Raspberry Pi Pico). The motor coil acts as a crude speaker, but with enormous distortion and fascinating nonlinearities. The resulting sound is raw, gritty, and full of character—perfect for industrial percussion or distorted bass tones.

The Gear Train as a Percussive Element

Leaving the gear train engaged is where true magic happens. An audio signal sent through the motor causes the gears to chatter against each other. This isn't a pure tone; it's a complex, noisy impact sound. By carefully tuning the frequency and PWM width, you can highlight specific resonant frequencies of the plastic housing, creating tuned "thuds" or "clacks."

Physical Audio Processing: The Servo as a Modular Effect

This is perhaps the most innovative application. Mount a small object—a piezo contact microphone, a metal spring, a bell—to the servo’s arm. Now, use audio-rate PWM to control the servo’s position. You are no longer synthesizing sound electronically; you are using the servo to physically manipulate a sound source.

  • Tremolo & Amplitude Modulation: Attaching a piezo disc to the arm and letting it tap rhythmically against a surface creates a mechanical tremolo effect.
  • Pitch Bending: Attach a tensioned string or rod to the arm. The servo’s movement changes the tension, bending the pitch of the sound induced in the string.
  • Granular Textures: Rapid, random movements can create a form of physical granular synthesis, as the striker interacts with different parts of an object in quick succession.

The Aesthetic of Failure: Embracing Chaos

Micro servos are not designed for this. They overheat, they jitter unpredictably, and they introduce glitches. In the world of glitch art and post-digital music, this is a feature. The instability of the system—the way a servo’s response changes as it warms up, the unique wear pattern of its gears—becomes part of the compositional process. Each servo has its own "voice."

Practical Project: Building a Servo-Based Synth Module

Let’s outline a basic project to create a standalone noise/percussion module.

Components Needed:

  1. Micro servo motor (SG90 or similar)
  2. Microcontroller (Arduino Nano/Teensy)
  3. Audio amplifier module (LM386 based)
  4. Piezo disc or small speaker
  5. Potentiometers for control
  6. Power supply

The Code: Audio-Rate PWM Manipulation

The core innovation is in the code. Instead of using the standard Servo.h library, we write directly to the microcontroller’s timers to generate PWM at kilohertz frequencies.

cpp // Simplified conceptual code for an Arduino void setup() { // Set up a timer for audio-rate PWM on a specific pin // This involves direct register manipulation for speed }

void loop() { int freq = analogRead(A0); // Read pot for frequency int width = analogRead(A1); // Read pot for pulse width (duty cycle)

// Update PWM frequency and duty cycle in real-time updateAudioPWM(freq, width); }

Sound Design Parameters:

  • PWM Frequency: Controls the fundamental pitch of the motor whine. Lower ranges (50-200Hz) produce recognizable tones; higher ranges become clicks and noise.
  • Pulse Width: The core timbral control. Sweeping it creates dramatic harmonic shifts, from hollow to nasal.
  • Physical Damping: Where and how you mount the servo (on wood, metal, loose) drastically affects the sound via resonance.

The Broader Impact: Why This Matters

The use of micro servos in audio synthesis is more than a niche hack. It represents a growing movement in electronic music:

1. Tangible Algorithmic Sound: It makes a digital process (PWM) physically manifest. You can see the sound in the jittering arm, creating a profound visual-auditory connection. 2. Democratization of Unique Sound: Servos are cheap, accessible, and hackable. This lowers the barrier to creating truly custom instruments. 3. Bridging the Digital and Physical: In an age of pristine software synths, servo-based sound reintroduces the warmth, unpredictability, and texture of the physical world. It’s a form of digital lutherie. 4. Inspiration for New Interfaces: Imagine a array of dozens of micro servos, each striking, scraping, or shaking different objects—a kinetic orchestra controlled by a single laptop. This is the realm of robotic musical instruments, and the micro servo is its gateway drug.

From the rhythmic ticking of a dozen servos playing a plastic grid like a marimba to the haunting drone of a single unit pushed to its resonant limit, the sonic world of PWM-driven micro servos is vast and largely unexplored. It reminds us that sound is, at its root, movement—and that by commandeering the precise, digital movement of a common robotic component, we can unlock a universe of unique, chaotic, and deeply expressive new voices. The future of sound might just be a slight modification away, whirring quietly in a hobbyist’s spare parts bin.

Copyright Statement:

Author: Micro Servo Motor

Link: https://microservomotor.com/pulse-width-modulation-pwm-control/pwm-audio-synthesis.htm

Source: Micro Servo Motor

The copyright of this article belongs to the author. Reproduction is not allowed without permission.

About Us

Lucas Bennett avatar
Lucas Bennett
Welcome to my blog!

Archive

Tags