Skip to content

Instantly share code, notes, and snippets.

@reachsumit
Last active March 25, 2024 16:06
Show Gist options
  • Save reachsumit/9f5583a904b43407e45b49e2fd1de2df to your computer and use it in GitHub Desktop.
Save reachsumit/9f5583a904b43407e45b49e2fd1de2df to your computer and use it in GitHub Desktop.
This code was shared by Audacity user edgar-rft (https://forum.audacityteam.org/memberlist.php?mode=viewprofile&u=5642) to generate silent subliminals and is an implementation of Oliver M. Lowery's 1989 patent (https://patents.google.com/patent/US5159703A/en).
;nyquist plug-in
;version 1
;type process
;name "Subliminal..."
;action "Subliminal..."
;control carrier "Carrier" real "Hz" 17500 14000 20000
(setf carrier (max 14000 (min carrier 20000)))
;; We have two Nyquist frequencies, carrier/2 and *sound-srate*/2.
;; The CUTOFF is the maximum allowed frequency in the modulator.
;; It must not be greater than carrier/2, but also not greater than
;; the difference between the carrier and *sound-srate*/2, because
;; otherwise the modulated carrier aliases.
(setf cutoff (min (/ carrier 2.0) (- (/ *sound-srate* 2.0) carrier)))
(defun cut (function sound frequency)
(dotimes (ignore 10 sound)
(setf sound (funcall function sound frequency))))
(defun subliminal (sound)
(let ((result (mult 2 (cut #'lowpass8 (hp sound 80) cutoff)
(hzosc carrier))))
(cut #'highpass8 result carrier)))
(if (< *sound-srate* 44100)
(princ "The track sample frequency must be minimum 44100Hz.")
(multichan-expand #'subliminal s))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment