Skip to content

sound/cem3340.cpp: Anti-aliasing. Streaming frequency and PW control.#15267

Merged
galibert merged 1 commit intomamedev:masterfrom
m1macrophage:cem3340
Apr 27, 2026
Merged

sound/cem3340.cpp: Anti-aliasing. Streaming frequency and PW control.#15267
galibert merged 1 commit intomamedev:masterfrom
m1macrophage:cem3340

Conversation

@m1macrophage
Copy link
Copy Markdown
Contributor

@m1macrophage m1macrophage commented Apr 27, 2026

  • Used the PolyBLEP algorithm for the ramp and pulse waves.
  • Used the PolyBLAMP algorithm for the triangle wave.
  • Made waveform outputs conditional on the output actually being connected.
  • Added support for streaming control of the frequency control current and pulse width control voltage.

Effects of anti-aliasing:
comparison

  • From top to bottom: ramp, pulse and triangle waveforms.
  • Each spectogram shows a sequence of notes, increasing by 1 octave per step.
  • Before (left column): the ramp and pulse waveforms suffered from significant aliasing. Aliasing on the triangle wave was only noticeable at high frequencies.
  • After (right column): Significant reduction in aliasing on all waveforms. The ramp and pulse spectra look much cleaner, and the triangle is missing some of the "stray" harmonics in the top octaves.

* Used the *PolyBLEP* algorithm for the ramp and pulse waves.
* Used the *PolyBLAMP* algorithm for the triangle wave.
* Made waveform outputs conditional on the output actually being connected.
* Added support for streaming control of the frequency control current and pulse width control voltage.
@galibert
Copy link
Copy Markdown
Member

Yay for band-limited oscillators :-)

@galibert galibert merged commit 9783c10 into mamedev:master Apr 27, 2026
7 checks passed
@m1macrophage m1macrophage deleted the cem3340 branch April 28, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants