Created
February 15, 2020 00:54
-
-
Save kristopherjohnson/9ee6cfdbc57b75be6b06597ffb296681 to your computer and use it in GitHub Desktop.
AppleScripts for using SoX to play white noise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Choose a white noise generator and play. | |
-- | |
-- Requires installation of SoX <http://sox.sourceforge.net> | |
-- With Homebrew: brew install sox | |
-- | |
-- Starts a background process. Kill it with command "killall play" or by running the "Stop Playing" script. | |
set theSynth to ¬ | |
choose from list {"pinknoise", "whitenoise", "brownnoise"} ¬ | |
with prompt ¬ | |
"Choose a synth" without multiple selections allowed and empty selection allowed | |
if not theSynth = false then | |
do shell script "/usr/local/bin/play -c2 -n synth " & (first item of theSynth) & " &>/dev/null & echo $!" | |
end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Stops all /usr/local/bin/play processes | |
do shell script "killall play &> /dev/null &" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment