🔗 Live Demo: tinnitune.naudycastellanos.com
Tinnitune is an interactive web-based tool designed for sound exploration, tinnitus frequency mapping, and custom masking sound therapy. Built natively using HTML5, CSS3, Vanilla JavaScript, and the Web Audio API, it delivers a seamless, zero-dependency audio experience with a premium, glassmorphic dark mode user interface.
- Selectable Waveform: Pure Tone (sine wave), narrowband noise (resembling a sharp whistle), and broadband noise (pink or white noise).
- Precise Frequency Control: Logarithmic coarse slider (20 Hz - 16 kHz) combined with fine tuning adjustments (±100 Hz).
- Tremolo Modulation: Pulsating zumbido simulation via a Low Frequency Oscillator (LFO) with adjustable rate and depth.
- Stereo Balance & Volume: Independent controls to shift the sound location or adjust the generator's volume.
- Therapeutic Notch Filter: When enabled, it dynamically cuts out a narrow band around your matched tinnitus frequency from all background soundscapes. This promotes neural retraining by giving fatigued auditory receptors a rest.
- Synthesized Soundscapes: Ocean waves (lowpass pink noise modulated by LFO), gentle rain (brown noise with high-pass droplets), and forest wind (slow LFO modulating a bandpass filter).
- Clinical Noise Generators: Playback of dynamically generated White, Pink, and Brown noise.
- A circular visual timer (30s, 60s, 120s) that plays your matched tinnitus frequency at a similar volume level to test residual inhibition (the temporary reduction or elimination of tinnitus perception that occurs after auditory stimulation).
- Demonstrates constructive (0° in phase) and destructive (180° out of phase) wave interference. Learn how sound waves collide in physical space and cancel each other out when using external stereo speakers.
- Saves your current configurations (waveform type, frequencies, LFO rates, ambient volumes, and Notch Filter status) locally in the browser (
localStorage) for quick one-click load or deletion.
- Set a sleep timer (15, 30, 45, or 60 minutes) to play therapy soundscapes as you sleep.
- Gentle Fade Out: During the last 60 seconds of the timer, the master volume declines exponentially to 0 to prevent waking the user up, resetting safely to your initial volume level afterward.
Tinnitune leverages the power of the Web Audio API to process audio in real-time. The following diagram illustrates the routing path and connections of the audio nodes:
graph TD
%% Synthesizer Input Nodes
subgraph Synthesizer
A[Tinnitus Generator<br>Oscillator or Filtered Noise] --> B[Modulation Gain<br>LFO Tremolo]
B --> C[Generator Volume]
C --> D[Stereo Panner]
end
%% Therapy & Masking Nodes
subgraph Therapy & Masking
E[Synthesized Soundscapes<br>Rain, Waves, Wind] --> H[Therapeutic Notch Filter<br>Cut at Tinnitus Freq]
F[Clinical Noise<br>White, Pink, Brown] --> H
end
%% Phase Experiment Nodes
subgraph Phase Experiment
I[Phase Oscillator] --> J[Left Channel Gain]
I --> K[Right Channel Gain<br>Inversion to -1.0 at 180°]
J --> L[Stereo Merger]
K --> L
end
%% Analyzer & Destination Connections
D --> M[Spectrum Analyser<br>FFT Canvas]
H --> M
L --> M
M --> N[Master Gain<br>General Volume]
N --> O[Audio Destination<br>Speakers / Headphones]
style H fill:#06c6e3,stroke:#fff,stroke-width:2px,color:#000
style M fill:#a21cf3,stroke:#fff,stroke-width:2px,color:#fff
Browsers restrict some Web Audio features and buffer loads when running directly from local files (file://). Running a lightweight local HTTP server is recommended:
- Launch the server from your project folder:
npx http-server
- Open the URL shown in your console (usually
http://localhost:8080).
- Start the HTTP server from the command line:
python -m http.server 8000
- Open
http://localhost:8000in your web browser.
This is a fully static web application and can be hosted on any modern static hosting provider.
- Connect Repository: Connect your GitHub repository to Cloudflare Pages via the Cloudflare Dashboard.
- Build Configuration: Since this is a vanilla HTML/JS project, configure the build settings as follows:
- Framework preset:
None - Build command: Leave empty (no build step required)
- Build output directory:
/(root directory)
- Framework preset:
- Deploy: Click Save and Deploy.
- Custom Domain:
- Go to your Page's project settings -> Custom domains -> Set up a custom domain.
- Enter your desired subdomain (e.g.,
tinnitune.naudycastellanos.com). - If your domain
naudycastellanos.comis managed by Cloudflare DNS, Cloudflare will automatically set up the CNAME record for you. If managed externally, add the provided CNAME record in your DNS registrar.
index.html: Semantic page structure, SVG icons, visualizer canvas, and panels.style.css: Vanilla CSS styling featuring CSS variables, glassmorphic elements, and a responsive grid.app.js: Main JS file handling Web Audio nodes, canvas render loop (requestAnimationFrame), and DOM event listeners.CHANGELOG.md: Chronological log of versions and features added.Docs/: Directory for extended documentation. Contains future_development_ideas.md detailing clinical sound therapy expansion concepts (audiograms, symptom trackers, pulsed masking, etc.).
This application is an educational sound exploration and therapeutic support tool. It is not a medical device, does not provide diagnostics, and does not replace the advice, diagnosis, or treatment of a health professional or audiologist. Use headphones at safe volumes to avoid further hearing damage.
This project is licensed under the MIT License - see the LICENSE file for details.