A minimal, neon-aesthetic music visualizer built with p5.js that creates stunning circular frequency visualizations with real-time audio analysis and interactive volume control.
- File Upload: Support for MP3, WAV, and other audio formats
- Microphone Input: Real-time visualization from your microphone
- Web Audio API: High-quality audio processing and analysis
- Circular Spectrum: 64 frequency bars arranged in a perfect circle
- Neon Glow: Dynamic HSB color cycling with authentic glow effects
- Kick Detection: Screen flashes and visual pulses on bass hits
- Smooth Animations: Fluid bar movements with neighbor influence
- Volume Knob: Large interactive knob (60px radius) with visual feedback
- Dynamic Arc: Volume arc thickness increases from 2px to 12px
- Frequency Indicators: Color-coded bass (pink), mid (green), high (blue) indicators
- Responsive UI: Clean minimal interface that adapts to screen size
https://prime2510.github.io/Audio-Visualizer/
- Clone or download the project files
- Ensure all three files are in the same directory:
📁 neon-music-visualizer/ ├── 📄 index.html ├── 🎨 style.css └── ⚡ script.js
- Local Server: Use a local web server or VS Code Live Server extension
- Open: Navigate to
index.htmlin your browser - Enable Audio: Click anywhere to enable Web Audio context
- Load Music: Click "Load Audio" to upload a music file, or "Mic" for microphone input
- Enjoy: Watch your music come to life in neon!
| Control | Action |
|---|---|
| Load Audio | Upload audio file (MP3, WAV, etc.) |
| Play/Pause | Control audio playback |
| Mic | Toggle microphone input |
| Volume Knob | Click/drag center knob to adjust volume |
- FFT Analysis: 512-point Fast Fourier Transform
- Frequency Bands: Bass (0-10%), Mid (10-40%), High (40-100%)
- Kick Detection: Algorithm detects bass spikes >30% above previous level
- Smoothing: 15% smoothing factor for stable visualizations
- Color System: HSB color mode for smooth rainbow transitions
- Glow Effects: Canvas shadow blur for authentic neon appearance
- Performance: 60 FPS rendering with optimized drawing functions
- Responsive: Automatic scaling and repositioning on window resize
Clean HTML structure with minimal controls and proper script loading order.
Minimal styling focused on:
- Monospace typography (Courier New)
- Transparent button styling
- Mobile-responsive design
- Proper z-indexing for overlay elements
Core visualization engine featuring:
- p5.js setup and draw loop
- Web Audio API integration
- FFT analysis and frequency band separation
- Circular bar rendering with glow effects
- Interactive volume control
- Kick detection algorithm
Modify the color generation in drawBars() function:
// Change the hue offset for different color schemes
let hue = (colorShift + (i * 5)) % 360; // Current rainbow
let hue = 200; // Static blue theme
let hue = (colorShift + (i * 2)) % 180; // Warm colors onlyAdjust the number of frequency bars:
const BARS_COUNT = 64; // Change to 32, 128, etc.Modify kick detection sensitivity:
if (smoothBass > prevBassLevel * 1.3 && smoothBass > 80) {
// Change 1.3 to 1.1 (more sensitive) or 1.5 (less sensitive)
// Change 80 to lower/higher threshold
}🐛 Troubleshooting
Audio Not Playing
- Ensure you click somewhere on the page first (browser audio policy)
- Check browser console for audio loading errors
- Verify audio file format is supported
No Microphone Input
- Grant microphone permissions when prompted
- Check browser privacy settings
- Ensure microphone is not used by other applications
Performance Issues
- Close other browser tabs using audio
- Disable browser extensions that might interfere
📄 License
This project is open source and available under the MIT License.
🤝 Contributing
Contributions are welcome! Feel free to:
- Report bugs or issues
- Suggest new features
- Submit pull requests
- Share your customizations
🙏 Acknowledgments
- p5.js Community - For the amazing creative coding framework
- Web Audio API - For making real-time audio processing possible in browsers
- Inspiration - Electronic music visualizers and codedex challanges
Made with 💜 and p5.js**
Turn up the volume and watch your music dance in neon!