Sound Effect Generator
Pick an instrument for a new bell, gong, chime or pluck sound, shape it, check its loudness and save it as WAV or MP3.
Pick an instrument
Hand bell
- Length
- Loudness
- Peak
- Click check
Shape the sound
Output and export
MP3 files are encoded on your device with lamejs 1.2.1 (LGPL-3.0), embedded in this page.
Variants and recent sounds
Recent sounds
Sounds you make appear here (the last 12 are kept on this device).
Runs on your device. Nothing you type or record is uploaded. Keeps working without a connection while the page is open. Works with touch. Saves your current sound settings, the Play after each change choice and your 12 most recent sounds on this device.
Added
How to use it
Each instrument button makes a new random sound of that kind and plays it: a new variation seed and new values for pitch, decay time, brightness, mallet hardness, strike noise, beating, glide, reverb and stereo width, around the instrument's own settings; length and fade-out follow the new decay time. Random does the same with a random instrument. Mutate keeps the instrument and the seed and moves about half of those sliders by up to 8 % of their range, sometimes also the pitch by one semitone. Make 10 variants lists ten new sounds of the current instrument to compare. Generators in the style of sfxr make 8-bit game sounds; this page models struck and plucked instruments and measures the result.
Settings
- Pitch: semitones from the instrument's default note (−24 to +24). It moves all notes together; the readout and the Pitch value list them (G4 + D5 struck together, E5, C5 one after the other) with the frequency of the first, A4 = 440 Hz.
- Length and Fade-out: the file length (0.5 to 8 s) and the part at its end that fades to silence (up to 3 s; Off cuts the sound).
- Decay time: multiplies the decay time of every partial (×0.25 to ×4). A larger church bell: Pitch −12 to −24, Decay time ×3 to ×4, Length 6 to 8 s (at −24 half its energy lies below 150 Hz).
- Brightness and Mallet hardness: make the higher partials weaker or stronger (formula below); a harder mallet also makes the attack faster, from twice to half the model's attack time, and the strike noise higher and shorter.
- Strike noise: the short noise burst of the strike; at 100 % its peak is a quarter of the main partial's amplitude.
- Beating (detune): multiplies the gap of each pair of close partials (the gaps are in the table; 0 % removes the pairs). Above 100 % every gap also grows by 0.6 Hz per 100 %, so partials without a partner get one and the plucked string a second string: the hand bell's lowest pair is 0.5, 1.6 and 2.7 Hz apart at 100, 200 and 300 %.
- Pitch glide: the pitch starts this much higher (lower if negative) and settles (−5 to +5 %).
- Reverb size, Reverb mix, Stereo width: the room's reverberation times (×0.3 to ×3), the level of the reverb, and the difference between the channels (0 % = mono, 150 % = half as much again).
- Notes and Strike spacing: for the doorbell and the alert chime only.
- Variation seed: a whole number from 1 to 999999 for the random parts: start phases, strike noise and reverb.
- Output: target loudness, sample rate, stereo or mono (the average of both channels), WAV or MP3 and its bit rate, and Small speaker. All but the file format re-render the sound.
How a sound is made
Most instruments are a sum of partials, each a sine wave that dies away exponentially:
x(t) = Σ aₖ · e^(−t · ln 1000 / Tₖ) · sin(2π fₖ t + φₖ)
aₖ is the amplitude of partial k, fₖ its frequency (a multiple of the note, see the table), Tₖ the time in which it falls by 60 dB (times Decay time) and φₖ a start phase from the seed. Two partials fₖ ± d/2 with unequal levels beat d times a second. A glide uses the phase 2π fₖ (t + g τ (1 − e^(−t/τ))): the frequency starts at fₖ (1 + g) and settles with the time constant τ (0.35 s for the gong, 0.05 s for the kalimba, 0.3 s otherwise). Brightness B (−1 to +1) and hardness H (0 to 1) multiply aₖ by (fₖ / f₀)q with q = 0.6 B + 0.5 (H − 0.5), where f₀ is the struck note; at the default values q is 0. Each strike rises as sin² over its attack time (0.8 to 14 ms), so the slope at the start is zero; the strike noise is a Hann-windowed burst of Gaussian noise through a 2nd-order Butterworth band-pass filter.
The plucked string uses the Karplus–Strong method with a shaped pluck: a delay line of fs/f samples starts with one period of the string's plucked shape (a triangle that peaks at 15 % of the string) plus a little noise from the seed, low-passed more for a softer pick. Every pass multiplies the signal by g and mixes each sample with the one before it (weights 1 − s and s, s = 0.5 by default, lower for a brighter string), so high harmonics fade first. g makes the fundamental fall by 60 dB in the decay time; linear interpolation gives the fractional part of the delay.
The reverb is an FFT convolution with an impulse response made for the sound: Gaussian noise in three bands (below 600 Hz, 600 Hz to 3 kHz, above 3 kHz), each falling by 60 dB in its own reverberation time, with a 10 ms pre-delay, a 15 ms build-up and five early reflections, separately for each channel and 1.2 times as long as the longest reverberation time. Then a 2nd-order Butterworth high-pass filter at 20 Hz removes the lowest rumble, the width scales the difference between the channels, and the fade-out multiplies the last m samples by ½ (1 + cos(π i / (m − 1))), so the last sample is exactly zero.
| Instrument | Partials (multiples of the note), pairs and the rest of the model | Default note |
|---|---|---|
| Gong | 1, 2.01, 2.97 (the first two as pairs 0.9 and 1.4 Hz apart); 2.38, 3.43, 4.15, 5.06 and 6.2 ring up over about 80 ms; pitch starts 1.2 % high | C4, 261.6 Hz |
| Church bell | hum 0.5, prime 1, tierce 1.2, quint 1.5, nominal 2, then 3.01, 4, 5.34, 6; hum, prime and nominal as pairs 0.6, 0.8 and 0.5 Hz apart | A4, 440 Hz |
| Hand bell | 1, 2.62, 3, 5.2, 7.7; the first three as pairs 0.5, 0.8 and 0.4 Hz apart | A5, 880 Hz |
| Tubular bell | 0.62, 1.21, 2, 2.99, 4.17, 5.56, 7.14: bending modes 2 to 8 of a free bar (2.757, 5.404, 8.933 … times mode 1); no partial sits at the note, which is the pitch heard an octave below the strongest one | G4, 392 Hz |
| Singing bowl | 1, 2.71, 5.15, 8.3, 12; the first four as pairs 1.5 to 3.8 Hz apart | E4, 329.6 Hz |
| Vibraphone | 1, 3.99, 9.85; the fundamental swings by 22 % 4.2 times a second | C5, 523.3 Hz |
| Marimba | two bars, G4 and D5, each 1, 3.93, 9.2 | G4, 392 Hz |
| Music box | two teeth, E5 and B5, each 1, 2, 6.27; the main tones as pairs 0.5 Hz apart | E5, 659.3 Hz |
| Kalimba | 1, 2, 5.9 and a box resonance fixed at 285 Hz; pitch starts 0.4 % high | A4, 440 Hz |
| Glass | 1, 2.43, 4.55 as pairs 0.8, 1.3 and 2.0 Hz apart | G5, 784 Hz |
| Electric piano | chord C4, G4, E5, each 1, 2, 3 and a short 6.9; left-right tremolo at 3 Hz | C4, 261.6 Hz |
| Plucked string | Karplus–Strong with a shaped pluck: harmonics 1, 2, 3 … whose highs fade first; the fundamental falls by 60 dB in 3.5 s | A3, 220 Hz |
| Triangle | twelve partials from 1 to 10.05, each as a pair 0.35 Hz apart | E5, 659.3 Hz |
| Wood block | 1, 1.52, 2.26, 3.51, gone by 60 dB in about 0.3 s; hollow body at 420 Hz; strike noise; a small room | D6, 1174.7 Hz |
| Doorbell | tone bars 1, 2.757, 5.404; ding-dong down a major third or a fourth, one ding, or E, C, D, G | E5, 659.3 Hz |
| Alert chime | 1, 2, 2.757, 5.4, the fundamental as a pair 0.2 Hz apart; one to three notes 0.14 s apart | G5, 784 Hz |
Loudness, peak and the click check
Integrated loudness follows ITU-R BS.1770: each channel goes through the K-weighting filter (a shelf of about +4 dB above 1.7 kHz and a high-pass near 38 Hz), the mean square is taken in 400 ms blocks every 100 ms and summed over the channels, blocks below −70 LUFS are dropped, then blocks more than 10 LU below the mean of the rest, and
L = −0.691 + 10 · log₁₀(mean power of the remaining blocks)
The page multiplies the sound by 10^((target − L) / 20) and measures again, up to four times, because the gates let other blocks through once the level changes. The sample peak may not exceed −1 dBFS; when it would, the gain stops there and the note under the readout says how far the loudness stayed below the target. Off scales the sound to a sample peak of −1 dBFS. −23 LUFS is the EBU R 128 target for broadcast programmes; for a sound that plays next to other audio, pick the level that audio uses.
The click check calls a start clean when the first sample is at most 0.001 (−60 dBFS) and the energy above 6 kHz in the first 3 ms is under 1 % or at most four times its share between 10 and 40 ms. An end is clean when the last sample is at most 0.001. A plucked string starts brighter than it rings, because it damps its high harmonics within a few periods, so for it the 6 kHz rule alone gives Bright pluck start, not Sharp start. The energy below 150 Hz and above 6 kHz comes from the spectrum of the whole sound. Small speaker, for a phone or a small loudspeaker, uses a 2nd-order Butterworth high-pass at 150 Hz and a 4th-order low-pass at 5.5 kHz instead of the 20 Hz filter, and leaves out the marimba and music box partials from 5 kHz and the electric piano partials from 4.5 kHz.
Example
Example: doorbell at −16 LUFS loads the doorbell with the ding-dong a major third down (E5, then C5 0.55 s later), seed 2026, the instrument's own slider values, −16 LUFS, 44.1 kHz stereo and Small speaker off. The readout shows 2.60 s, −16.0 LUFS, a sample peak of −7.0 dBFS, a clean start and end, and under 0.01 % of the energy below 150 Hz and above 6 kHz. The peak stays far below the ceiling, so the target is met exactly. Switch on Small speaker and dashed lines in the spectrogram mark the band that is kept.
Export and sharing
WAV files are 16-bit PCM, rounded without dither. MP3 files are encoded on your device at a constant bit rate by lamejs 1.2.1, a JavaScript port of the LAME encoder under the LGPL-3.0 licence, embedded unchanged in this page. An MP3 decodes slightly longer than the WAV: the encoder adds a short delay at the start and fills its last frame of 1152 samples with silence. Files are named after the instrument and the seed, for example doorbell-2026.wav. Link to this sound holds every setting after the # of the address; opening it renders the same samples again.
Limits
- The instruments are short lists of partials with fixed ratios and exponential decay, plus one string model; they do not simulate a real instrument's shape or material, and no recordings are used. The church bell partials (hum, prime, tierce, quint, nominal), the free-bar modes of the tubular bell and the doorbell bars, and the first overtone near four times the fundamental of the marimba and vibraphone bars follow the kinds of data described by Fletcher and Rossing. The ratios of the gong, singing bowl, hand bell, music box, kalimba, glass, electric piano, triangle, wood block and alert chime were set for this page, not measured on a particular instrument.
- The ceiling is a sample peak, not a true peak: the waveform between samples, and an MP3 after decoding, can go slightly higher.
- Loudness is measured before MP3 encoding; at 128 to 192 kbit/s the decoded file can read a few tenths of a dB different. A sound shorter than one 400 ms block, such as the wood block, can read several dB different, because the encoder's short delay at the start moves the sound against the blocks and changes which ones pass the gate.
- Short, hard strikes have a high peak for their loudness, so −14 LUFS (or Small speaker on the plucked string) can stop at the ceiling; the readout then says by how much.
- The shortest length is 0.5 s, because the meter needs one 400 ms block.
- The same settings give the same samples in the same browser; another browser engine may differ in the last bits of its maths functions.
Sources
- ITU-R Recommendation BS.1770, Algorithms to measure audio programme loudness and true-peak audio level: itu.int/rec/R-REC-BS.1770
- EBU R 128, Loudness normalisation and permitted maximum level of audio signals: tech.ebu.ch/publications/r128
- K. Karplus and A. Strong (1983), Digital synthesis of plucked-string and drum timbres, Computer Music Journal 7(2), 43–55: doi.org/10.2307/3680062
- N. H. Fletcher and T. D. Rossing (1998), The Physics of Musical Instruments, 2nd edition, Springer, New York: chapter 2 (strings and bars), chapter 19 (mallet percussion instruments) and chapter 21 (bells); doi:10.1007/978-0-387-21603-4