A Python GUI application for processing funscript files for electrostimulation devices. This application replaces the PowerShell-based workflow with a user-friendly interface and integrated processing pipeline.
- Intuitive GUI: Easy-to-use interface with organized parameter tabs
- Comprehensive Processing: Generates 10 different output funscripts for various stimulation parameters
- Auto-generation: Automatically creates alpha/beta files from main funscript when missing using 1D to 2D conversion
- Configurable Parameters: 30+ configurable parameters with improved ratio controls showing real-time percentages
- File Management: Automatic intermediary file management with optional cleanup
- Progress Tracking: Real-time progress updates during processing
- Configuration Persistence: Save and load parameter configurations
The application processes a single input funscript and generates:
alpha.funscript- Alpha channel dataalpha-prostate.funscript- Inverted alpha for prostate stimulationbeta.funscript- Beta channel datafrequency.funscript- Combined ramp/speed frequencypulse_frequency.funscript- Alpha-based pulse frequencypulse_rise_time.funscript- Composite timing signalpulse_width.funscript- Limited alpha-based widthvolume.funscript- Standard volume controlvolume-prostate.funscript- Enhanced volume for prostatevolume-stereostim.funscript- Mapped volume range
- Python 3.7 or later
- NumPy (automatically installed)
- Tkinter (included with Python)
- Clone or download this repository
- Install dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Select your input
.funscriptfile using the Browse button -
Optional: Configure 1D to 2D conversion:
- Choose algorithm (Circular, Top-Left-Right, or Top-Right-Left)
- Adjust speed-responsive radius controls
- Click "Convert to 2D" for alpha/beta generation only
-
Configure parameters in the tabbed interface:
- General: Basic processing parameters
- Speed: Speed calculation settings
- Frequency: Frequency mapping with improved ratio sliders showing real-time percentages
- Volume: Volume processing with percentage-based ramp generation and clear combination ratio controls
- Pulse: Pulse parameters with intuitive ratio displays
- Advanced: Optional features and inversions
-
Choose processing options:
- ☐ Normalize Volume: Apply volume normalization
- ☐ Delete Intermediary Files When Done: Clean up temporary files
-
Click "Process Files" to start processing
-
Monitor progress in the status area
Parameters are automatically saved to restim_config.json when you click "Save Config". The application will remember your settings between sessions.
Use "Reset to Defaults" to restore factory settings.
- Input file: Select any
.funscriptfile - Intermediary files: Created in
funscript-tempsubdirectory (automatically cleaned up if option selected) - Output files: Placed in the same directory as the input file
- Auxiliary files: If
alpha.funscript,beta.funscript,speed.funscript, orramp.funscriptexist alongside your input file, they will be used instead of generated - Ramp Generation: Volume ramp uses percentage-based progression with configurable rate (0-40% per hour, default 15%)
- Auto-generation: Missing
alpha.funscriptandbeta.funscriptfiles are automatically created from the main funscript using multiple 1D to 2D conversion algorithms - 1D to 2D Conversion: Dedicated section with algorithm selection and speed-responsive radius control
The application features a sophisticated 1D to 2D conversion system with multiple algorithms and speed-responsive motion control:
- Circular (0°-180°): Original semicircular motion algorithm
- Top-Left-Right (0°-270°): Oscillating arc motion counter-clockwise from top
- Top-Right-Left (0°-90°): Oscillating arc motion clockwise from top
- 0-360 (restim original): Original algorithm from diglet48's restim with stroke-relative circular motion and random direction changes
The conversion system includes dynamic radius control that responds to funscript movement speed:
- Min Distance From Center (0.1-0.9): Sets the minimum radius for slow movements
- Speed at Edge (Hz) (1-5 Hz): Defines the speed threshold where the dot reaches maximum radius
- Dynamic Scaling: Slow movements stay closer to center, fast movements reach the edge
- Algorithm Selection: Choose your preferred motion pattern using radio buttons
- Configure Parameters: Adjust interpolation density and radius control settings
- Convert to 2D: Click "Convert to 2D" to generate only alpha/beta files
- Full Processing: Use "Process Files" for complete workflow including 2D conversion
- Position Mapping: Angular position directly corresponds to funscript position values
- Speed Calculation:
current_speed = position_change / time_duration - Radius Scaling:
radius = min_distance + (1.0 - min_distance) * (speed / max_speed) - Quality Control: Configurable points per second (1-100) for interpolation density
The application features improved combination ratio controls and ramp generation:
- Interactive Sliders: Adjust ratios with real-time visual feedback (automatically rounded to 0.1 precision)
- Percentage Display: See exact mixing percentages (e.g., "Ramp 83.3% | Speed 16.7%")
- Clear Labeling: Each control shows which files are being combined
- Dual Input: Use sliders for quick adjustment or text entry for precise values
- Clean Values: All ratio values automatically round to one decimal place for clarity
- Smart Ramp Generation: Percentage-based progression with real-time value display and per-minute calculation
- Ratio 2: 50% File1 + 50% File2 (equal mix)
- Ratio 3: 66.7% File1 + 33.3% File2 (File1 dominant)
- Ratio 6: 83.3% File1 + 16.7% File2 (heavily weighted toward File1)
- Processing Pipeline: Integrated Python workflow replacing separate script calls
- Performance: Utilizes caching and optimized numpy operations
- Thread Safety: Processing runs in background thread to maintain UI responsiveness
- Error Handling: Comprehensive validation and user-friendly error messages
- "Module not found" errors: Ensure you've installed requirements with
pip install -r requirements.txt - Permission errors: Ensure write access to the input file directory
- Processing errors: Check that input file is a valid funscript JSON format
- Configuration errors: Use "Reset to Defaults" if parameter validation fails
To create a standalone Windows executable that doesn't require Python installation:
-
Install PyInstaller:
pip install pyinstaller
-
Ensure all dependencies are installed:
pip install -r requirements.txt
-
Quick Build: Run the automated build script:
python build_windows.py
-
Manual Build (alternative): Use PyInstaller directly:
pyinstaller --onefile --windowed --name RestimFunscriptProcessor main.py
The build script creates:
- Executable:
dist/windows/RestimFunscriptProcessor-v{version}.exe - Release Package:
dist/RestimFunscriptProcessor-v{version}-Windows.zip
The release package includes:
- Standalone executable (no Python required)
- Complete documentation (README.md, specifications)
- Installation guide (INSTALLATION.txt)
- Single File: All dependencies bundled into one executable
- No Console: GUI-only application (no command prompt window)
- Auto-Versioning: Version number automatically included in filename
- Documentation: Complete docs package included
- Cross-Platform: Can build on any platform (best results on Windows)
The generated ZIP file in the dist/ folder contains everything needed for distribution. Users simply:
- Extract the ZIP file
- Run
RestimFunscriptProcessor.exe - No Python installation required!
The application is structured as follows:
main.py- Entry pointprocessor.py- Core processing workflowconfig.py- Configuration managementfunscript/- Funscript file handlingprocessing/- Individual processing functionsui/- GUI componentsbuild_windows.py- Windows executable build script