Envelope Time Calculator
Convert an ADSR envelope stage duration from milliseconds into the equivalent number of audio samples at a given sample rate. Essential when programming synthesizers or audio plugins that specify envelope times in samples rather than milliseconds.
About this calculator
Digital audio represents sound as a discrete sequence of samples taken at a fixed rate — the sample rate — measured in Hertz (samples per second). When a synthesizer or audio plugin defines an envelope stage (attack, decay, sustain release) internally, it often works in samples rather than wall-clock time. To convert a time in milliseconds to samples, first convert milliseconds to seconds by dividing by 1000, then multiply by the sample rate: Samples = (timeMs / 1000) × sampleRate. For example, at 44,100 Hz a 10 ms envelope stage lasts exactly 441 samples. Understanding this conversion is critical for writing DSP code, tuning envelopes in sample-accurate hosts, and ensuring consistent envelope behavior across different sample rates.
How to use
Imagine you want an attack time of 25 ms on a synthesizer running at 48,000 Hz. Step 1 — convert milliseconds to seconds: 25 / 1000 = 0.025 s. Step 2 — multiply by the sample rate: 0.025 × 48,000 = 1,200 samples. So you would set the attack stage to 1,200 samples in your plugin or DSP code. If the same patch is loaded in a session at 96,000 Hz, repeat the calculation: 0.025 × 96,000 = 2,400 samples — exactly double, reflecting the higher sample density.
Frequently asked questions
Why do some synthesizers specify envelope times in samples instead of milliseconds?
Sample-accurate timing is fundamental to digital audio processing because the sample is the smallest indivisible unit of time in a digital system. Expressing envelope stages in samples avoids floating-point rounding of fractional milliseconds and ensures perfectly reproducible, click-free transitions at the hardware level. Many classic hardware synthesizers and modern plugin DSP engines use sample counts internally for this reason. When you export or automate a parameter, sample-based values guarantee the same musical result regardless of project tempo.
How does sample rate affect the length of an ADSR envelope stage?
Higher sample rates pack more samples into every second, so the same number of samples represents a shorter wall-clock duration. For a fixed time in milliseconds, the sample count scales linearly with sample rate — doubling the sample rate doubles the number of samples needed for the same envelope time. This means patches designed at 44,100 Hz must have their sample counts recalculated when moved to a 96,000 Hz project to preserve the intended envelope shape. This calculator automates that recalculation instantly.
What is a typical attack time in milliseconds for common synthesizer sounds?
Percussive sounds like kicks and plucks use very short attacks, typically 0–5 ms, to create an immediate transient punch. Pads and strings commonly use attacks of 50–500 ms to produce a smooth, gradual swell. Brass and wind emulations often sit in the 10–30 ms range to mimic the natural reed or valve response. These are general guidelines; the ideal value depends on the musical context, the filter envelope, and the source waveform being shaped.