When you played these games in a real arcade, the QSound hardware (a dedicated DSP chip on the motherboard) handled all this processing. Emulators like MAME have to replicate that chip.
Example command line: