Skip to content

Instantly share code, notes, and snippets.

@researcx
Last active February 16, 2024 17:36
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save researcx/8e583f8cfc68562355408b9b854ff31c to your computer and use it in GitHub Desktop.
Save researcx/8e583f8cfc68562355408b9b854ff31c to your computer and use it in GitHub Desktop.
Linux System-wide Audio Tuning [24bit 192 kHz HD Audio + A=432 Hz Tuning + Equalizer]

24bit 192 kHz HD Audio + A=432 Hz Tuning + Equalizer

High-quality sampling

ALSA

echo 'defaults.pcm.rate_converter "speexrate_best"' | tee -a .asoundrc
sudo alsactl restore

PulseAudio

sudo echo 'default-sample-format = s24le' | sudo tee -a /etc/pulse/daemon.conf
sudo echo 'default-sample-rate = 192000' | sudo tee -a /etc/pulse/daemon.conf
sudo echo 'resample-method = soxr-vhq' | sudo tee -a /etc/pulse/daemon.conf
pulseaudio -k; pulseaudio -D

A4 432 Hz real-time tuning

A=432 Hz, known as Verdi’s ‘A’ is an alternative tuning that is mathematically consistent with the universe.

Sources:

Required: ladspa-devel, ladspa-tap-plugins

ALSA

Append to the end of ~/.asoundrc:

pcm.ladspa {
	type ladspa
	slave.pcm "hw:0,0";
	path "/usr/lib64/ladspa";
	plugins [{
		label tap_pitch
		input {
		controls [ -0.317667 0 -90 0 ]
		}
	}]
}

Reload ALSA

sudo alsactl restore

PulseAudio

Comment out these lines in /etc/pulse/default.pa:

.ifexists module-udev-detect.so
load-module module-udev-detect
.else
load-module module-detect
.endif

Append to the end of /etc/pulse/default.pa:

load-module module-alsa-sink device=hw:0,0
.ifexists module-ladspa-sink.so
.nofail
load-module module-ladspa-sink sink_name=ladspa_out master=alsa_output.hw_0_0 plugin=tap_pitch label=tap_pitch control=-0.317667,0,-90,0
.fail
.endif

Restart pulseaudio

pulseaudio -k; pulseaudio -D

Equalizer

Ziyad's Perfect EQ (included in pulseeffects): https://www.ziyadnazem.com/post/956431457/the-perfect-eq-settings-unmasking-the-eq

Arch Linux: yaourt -S pulseeffects calf

Others: pulseaudio-equalizer-ladspa, pulseaudio-equalizer, pulseeffects, qpaeq, alsaequal

@dm17
Copy link

dm17 commented Feb 13, 2021

I didn't realize you could tune a whole waveform to 432hz... I thought the original composition needed to be produced this way - it is an aspect of how it is in tune with itself. Does that make sense, or am I off?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment