Notes on engine sound and web audio
Notes on how EV·ENGINE works, one piece at a time. Firing orders and why a V10 sounds unlike a V8, what a comb filter does for an exhaust, how a gearbox model decides when to change up, and the bugs found while building it.
- The slowest firing rate in the libraryTwo presets in EV·ENGINE share the lowest firing rate in the library: the big single and the steam locomotive both produce one firing every two revolutions.
- Where an engine gets its weightAn engine's weight here comes from two low-end sliders: bass, which feeds the sub oscillator and an 82 Hz cabin peak, and the sub oscillator's own level.
- Building for a car's head unitEV·ENGINE runs in a Tesla's centre screen over the car's own cellular connection, and that link measures 1.3 Mbps with a cold page load of 22 MB.
- The shift point that changes with loadEV·ENGINE's presets carry a single upshift point, tuned for pressing on.
- What GPS speed gives youMost phones report speed directly through the Geolocation API's coords.speed field, but not all of them do, and when that field is missing EV·ENGINE works it out from the distance and time between two fixes instead.
- Pitch-shifting a recording, and where it breaksEV·ENGINE has three recorded engines: the Ferrari 458, the BAC Mono and the Procar M1.
- A jet turbine has one gearSeventeen of EV·ENGINE's machines shift gears.
- Why the engine runs in an AudioWorkletEV·ENGINE's engine sound is generated inside an AudioWorklet, code running on its own audio thread that must hand back a finished slab of samples every few milliseconds without waiting for the browser's main thread to answer.
- Scripting a rev sweep with suspend and resumeThe ten-second clip on every engine page is rendered by an OfflineAudioContext, which does not advance on its own and has no wall clock to schedule changes against.
- Why a soft clipper sits on the master busEV·ENGINE trims each preset to match loudness across twenty engines, but a trim is a single gain applied to the whole waveform, peaks included.
- Matching loudness across twenty enginesBefore any correction, the loudest and quietest of EV·ENGINE's twenty engine presets measured 19 loudness units apart under ITU-R BS.1770 K-weighting, a gap wide enough to reach for the volume control on every switch.
- Throttle without a pedalEV·ENGINE has no pedal to read.
- A gearbox that shifted four times in half a secondA gearbox bug made lifting off the accelerator at high revs shift up through every remaining gear in under a second, because the upshift threshold is set from acceleration rather than a fixed rpm, and acceleration collapses the instant a driver eases off.
- The exhaust is a comb filterEvery preset routes its exhaust through a feedback comb filter, and the pipe value sets how long that feedback loop takes to run.
- Why a diesel clattersA diesel clatters because compression ignition lights each charge the moment the fuel-air mixture is ready to burn, not at a spark-timed instant, and that readiness shifts slightly from one cycle to the next.
- Where the boxer rumble comes fromThe flat-four boxer preset carries a firing unevenness of 34, produced by unequal exhaust header lengths meeting a collector at uneven intervals.
- Crossplane and flat-plane V8: same firings, different growlThe Muscle V8 5.0 and the Euro V8 4.4 both fire four times a revolution, the same as every V8 built.
- Why a V10 screams and a V8 shoutsA V10 fires five times a revolution; a V8 fires four.
For the whole picture rather than a piece of it, start with how it works.