An artistic journey through sound and math, visualized in code.
2024-08-06.12-39-50.mp4
- Introduction
- Features
- System Requirements
- Installation
- Usage
- Technical Details
- Architecture
- Performance Optimization
- Future Enhancements
- Contributing
- License
Jingle Bells Synth is a state-of-the-art audio synthesis and visualization project that demonstrates advanced techniques in digital signal processing, real-time audio generation, and graphical rendering. This project synthesizes the "Jingle Bells" melody using various waveforms and applies envelope shaping, while simultaneously providing a high-performance, real-time spectral analysis visualization.
- Advanced Waveform Synthesis: Generates sine, square, triangle, and sawtooth waves with high precision.
- ADSR Envelope Shaping: Applies attack, decay, sustain, and release envelopes to each note for realistic sound shaping.
- Real-time Spectral Analysis: Performs fast Fourier transform (FFT) based spectral analysis on the audio output.
- High-performance Visualization: Utilizes GPU-accelerated rendering for smooth, real-time spectrum visualization.
- Optimized Audio Processing: Employs efficient algorithms for minimal CPU usage and low-latency output.
- OS: Debian-based Linux distribution (Ubuntu 20.04 LTS or later recommended)
- CPU: x86_64 architecture, 2.0 GHz dual-core or better
- RAM: 4 GB minimum, 8 GB recommended
- GPU: OpenGL 3.3 compatible graphics card
- Audio: ALSA-compatible audio device
- Development Tools: GCC 9.3.0 or later, Make 4.2.1 or later
-
Clone the repository:
git clone https://github.com/yezzfusl/HarmonicVoyage.git
cd HarmonicVoyage
-
Install dependencies:
sudo apt-get update
sudo apt-get install gcc make libsdl2-dev libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev
-
Install Raylib:
git clone https://github.com/raysan5/raylib.git
sudo apt install libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev
cd raylib/src/
make PLATFORM=PLATFORM_DESKTOP # To make the static version.
sudo make install # Static version.
-
Build the project:
cd HarmonicVoyage/build
make clean && make
-
Run the executable from the build directory:
./jingle_bells_synth
-
The application will start playing the Jingle Bells melody and display the real-time spectral analysis. Close the window to exit the program.
- Sample Rate: 44.1 kHz
- Bit Depth: 16-bit signed integer
- Waveforms: Sine, Square, Triangle, Sawtooth
- Envelope: ADSR (Attack, Decay, Sustain, Release)
- FFT Size: 2048 samples
- Window Function: Hann window
- Frequency Resolution: ~21.5 Hz
- Time Resolution: ~46.4 ms
- Rendering Engine: Raylib
- Color Space: HSV for spectrum visualization
- Frame Rate: 60 FPS (V-Sync enabled)
- Resolution: 800x450 pixels
The project follows a modular architecture with the following key components:
- Sound Generator: Responsible for waveform synthesis and ADSR envelope application.
- Fourier Transform: Performs real-time FFT for spectral analysis.
- Visualizer: Handles rendering of the spectral data using Raylib.
- Main Controller: Orchestrates audio playback and visualization updates.
- SIMD Vectorization: Utilizes SSE/AVX instructions for parallel audio processing.
- Cache-friendly Algorithms: Optimized data structures and memory access patterns for improved cache utilization.
- GPU Acceleration: Offloads visualization rendering to the GPU for reduced CPU load.
- Lock-free Audio Buffer: Implements a custom lock-free ring buffer for low-latency audio output.
- Implement real-time parameter adjustment for waveforms and ADSR envelopes.
- Add support for MIDI input for live performance capabilities.
- Integrate a reverb engine for enhanced audio output.
- Implement a more sophisticated spectral analysis using the STFT (Short-Time Fourier Transform) method.
- Develop a user interface for dynamic control of synthesis parameters.
We welcome contributions to the Jingle Bells Synth project. Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with clear, descriptive commit messages.
- Push your branch and submit a pull request.
Please ensure your code adheres to the existing style conventions and includes appropriate test coverage.
This project is licensed under the MIT License. See the LICENSE file for details.
For more information, please contact the project maintainer at [email protected]