Comment

Comment by nyanpasu64

Oddly this sounds more like a 40% pulse wave than a 50% square wave. I assume the original was played on a 50% square wave.

EDIT: Upon reading the original code:

    int volume = 60;
    periodMicros = 1000000/((long)freq);
    onMicros = periodMicros * volume/100;
    offMicros = periodMicros * (100-volume)/100;
volume doesn't control the volume, but the duty cycle (timbre and harmonic content) of the waveform. And it looks like I guessed the 40% (audibly equivalent to 60%) duty cycle exactly!
parent nyanpasu64 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton