A Python-based wave generator with modular audio backends, featuring professional-quality audio output, custom waveform drawing, and real-time visualization. Includes both GUI and console interfaces for maximum flexibility.
- Multiple Wave Types: Sine, square, sawtooth, and custom waveforms
- Frequency Control: Adjustable frequency with customizable step sizes
- Volume Control: 0-100% volume adjustment
- Frequency Sweep: Sweep through frequency ranges with customizable duration and looping
- Custom Waveform Drawing: Draw your own waveforms using mouse input (GUI version)
- Real-time Visualization: Live waveform display with animation
- Dual Interfaces: Choose between console-based or GUI-based operation
The wave generator uses a modular architecture for maximum flexibility:
wave_engine.py- Core wave generation engine with smooth transitions and anti-click protectionprofessional_tone_generator.py- Professional audio backend using sounddevice for low-latency, high-quality audiosimple_tone_generator.py- Fallback audio backend using pygame for basic functionalitywave_generator.py- Main GUI application combining the engine with graphical interfacewave_generator_console.py- Console application using the same engine with text-based interface
wave_generator.py- Main GUI interface with custom waveform drawing and professional audiowave_generator_console.py- Console-based interface for text-based operationwave_engine.py- Shared wave generation engine with smooth transitionsprofessional_tone_generator.py- High-quality audio generator using sounddevicesimple_tone_generator.py- Basic audio generator using pygamerequirements.txt- Python dependencieskey_test.py- Keyboard input testing utility
- Install Python 3.7 or higher
- Install required dependencies:
pip install -r requirements.txt
- (Optional) For professional audio quality, install sounddevice:
pip install sounddevice
python wave_generator.pyFeatures professional audio output, real-time visualization, and custom waveform drawing.
python wave_generator_console.pyText-based interface for basic operation without GUI dependencies.
- Arrow Keys: Navigate menu options
- Left/Right: Adjust selected parameter
- Space: Toggle play/pause
- S: Toggle frequency sweep
- Q: Quit
All console controls plus:
- C: Toggle custom waveform drawing mode (when custom wave type is selected)
- R: Reset custom waveform to default sine wave
- Mouse: Draw custom waveforms when in drawing mode
- Select "Custom" as the wave type using arrow keys
- Press 'C' to enter drawing mode
- Click and drag in the waveform visualization area to draw your custom waveform
- Press 'C' again to exit drawing mode
- Press 'R' to reset the custom waveform
pygame- Audio playback and GUInumpy- Mathematical operations and array handlingkeyboard- Keyboard input handling (console version)sounddevice- Professional low-latency audio (optional, for enhanced audio quality)
- Uses
sounddevicefor low-latency, click-free audio - Professional-grade audio quality with optimal latency settings
- Real-time parameter updates without audio artifacts
- Uses
pygamemixer for basic audio functionality - Good for systems without sounddevice support
- May have slightly higher latency but fully functional
- Graphical user interface with icons and visual feedback
- Real-time waveform visualization with animation
- Custom waveform drawing with mouse input
- Enhanced frequency sweep visualization
- Professional audio backend (sounddevice) with fallback to pygame
- Smooth parameter transitions and anti-click protection
- Text-based menu interface
- Basic wave generation and playback using pygame
- Frequency sweep functionality
- Keyboard-based controls
- Lightweight with minimal dependencies
This project is open source and available under the MIT License.
Feel free to contribute by submitting pull requests or reporting issues.