#!/usr/bin/env bash # Check if SoX is installed; exit if it is not found if ! command -v play &> /dev/null; then echo "Error: SoX is not installed. Please install it first (e.g., sudo apt install sox)." exit 1 fi # Set default playback duration DURATION="15:00" while true; do clear echo "=========================================================" echo " Advanced Therapeutic Frequency Generator " echo "=========================================================" echo "--- Standard Pure Tones ---" echo "1) 40 Hz Gamma Tone" echo " Benefit: Promotes advanced cognitive processing and focus." echo "" echo "2) 8 Hz Alpha Binaural Beat (Requires Headphones)" echo " Benefit: Reduces anxiety (200Hz Left / 208Hz Right)." echo "" echo "3) 5 Hz Theta Binaural Beat (Requires Headphones)" echo " Benefit: Encourages deep meditative states and sleep" echo " preparation (200Hz Left / 205Hz Right)." echo "" echo "--- Complex Modulations & Variable Beats ---" echo "4) Ascending Binaural Sweep: Theta to Beta (Requires Headphones)" echo " Benefit: Gently shifts the brain from a relaxed meditative" echo " state (5 Hz difference) into a sharp, focused state" echo " (15 Hz difference) over the full duration." echo "" echo "5) 174 Hz Isochronic Healing Pulse (No Headphones Needed)" echo " Benefit: Uses an aggressive 7 Hz volume modulation (tremolo)" echo " over a 174 Hz base tone. Often used for physical" echo " tension reduction and pain relief." echo "" echo "6) 432 Hz Atmospheric Modulated Drone" echo " Benefit: Combines slow amplitude modulation, phase shifting," echo " and heavy reverb. Prevents auditory fatigue and" echo " creates a dynamic, evolving soundscape for deep work." echo "" echo "7) Slow-Rolling Brown Noise 'Ocean' Modulations" echo " Benefit: Filters brown noise with a slow amplitude sweep." echo " Acts as an acoustic blanket to mask background" echo " distractions or tinnitus." echo "" echo "0) Exit" echo "=========================================================" read -p "Select an option [0-7]: " choice echo "" case $choice in 1) echo "Playing 40 Hz Gamma Tone for $DURATION. Press Ctrl+C to stop." play -n synth $DURATION sine 40 ;; 2) echo "Playing 8 Hz Alpha Binaural Beat for $DURATION. Press Ctrl+C to stop." play -n synth $DURATION sine 200 sine 208 remix 1 2 ;; 3) echo "Playing 5 Hz Theta Binaural Beat for $DURATION. Press Ctrl+C to stop early." play -n synth $DURATION sine 200 sine 205 remix 1 2 ;; 4) echo "Playing Ascending Binaural Sweep for $DURATION. Press Ctrl+C to stop." # Left stays at 200. Right sweeps linearly from 205 to 215. play -n synth $DURATION sine 200 sine 205-215 remix 1 2 ;; 5) echo "Playing 174 Hz Isochronic Pulse for $DURATION. Press Ctrl+C to stop." # tremolo speed=7Hz, depth=100% (creates the hard pulse effect) play -n synth $DURATION sine 174 tremolo 7 100 ;; 6) echo "Playing Modulated 432 Hz Drone for $DURATION. Press Ctrl+C to stop." # Adds slow tremolo (0.15Hz), a phaser for movement, and 50% reverb play -n synth $DURATION sine 432 tremolo 0.15 40 phaser 0.9 0.85 4 0.23 1 -s reverb 50 ;; 7) echo "Playing Brown Noise Ocean Modulations for $DURATION. Press Ctrl+C to stop." # bandpass filter around 400Hz, slow tremolo (0.1Hz at 60% depth), and reverb play -n synth $DURATION brownnoise band -n 400 400 tremolo 0.1 60 reverb 50 ;; 0) echo "Exiting..." exit 0 ;; *) echo "Invalid selection. Please press Enter to try again." read -r ;; esac echo "" read -p "Playback finished or stopped. Press Enter to return to the menu..." done