A small native Odin + raylib application for building, listening to, and visualizing sums of sinusoidal signals.
- Up to 8 sinusoidal components.
- Exact editable frequencies from 1 Hz to 20 kHz.
- Per-component amplitude, phase, mute, and removal.
- Real-time mono 48 kHz floating-point audio.
- Time-domain view of every component and their sum.
- Component spectrum.
- Optional automatic headroom to avoid hard clipping.
- Pure 4:5:6 and 12-EDO C-major presets.
- Resizable native window.
Install Odin:
sudo pacman -S odinThe project imports vendor:raylib, so installing the separate raylib
package is normally unnecessary.
Run directly:
odin run . -o:speedBuild an executable:
odin build . -out:sine-lab -o:speed
./sine-labOn Hyprland, raylib's normal Linux desktop build generally opens through XWayland. If no window appears, verify that XWayland is enabled.
-
Click a frequency field, type a value, and press Enter.
-
Escape cancels frequency editing.
-
The
-and+buttons change frequency by 1 Hz. -
Hold Shift while clicking them to change it by 10 Hz.
-
Audio ON/OFFonly gates output; the stream remains alive. -
Reset phaserestarts all oscillator running phases together. -
Auto headroomappliesgain = min(1, 0.95 / sum(amplitudes))before master volume, then the final PCM sample is clamped to
[-1, 1].
The component spectrum is intentionally not an FFT: these are analytically defined sinusoids, so their frequencies and amplitudes are already known exactly. Drawing stems at those frequencies is more accurate than estimating them from a finite FFT window.
The program searches these paths in order:
./ui-font.ttf/usr/share/fonts/noto/NotoSans-Regular.ttf/usr/share/fonts/TTF/DejaVuSans.ttf/usr/share/fonts/liberation/LiberationSans-Regular.ttf/usr/share/fonts/gnu-free/FreeSans.ttf
On Arch, the default choice is Noto Sans when noto-fonts is installed:
sudo pacman -S noto-fontsTo use any other TrueType font without changing the source, copy or symlink it
as ui-font.ttf in the directory from which you launch the application:
ln -s /path/to/MyFont-Regular.ttf ui-font.ttf
odin run . -o:speedThe font file is loaded at runtime; it is not embedded in the executable.