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
- Custom Event Builder: Visual canvas-based timeline editor for precise event scheduling
- Dark Mode: Full application dark/light theme toggle
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.8 or later (Python 3.13+ recommended for latest compatibility)
- NumPy (automatically installed)
- Tkinter (included with Python on Windows/macOS, may need separate install on Linux)
- tkinterdnd2 (optional, for drag-and-drop support)
- ffpyplayer + Pillow (optional, for video playback in Custom Event Builder)
- sv-ttk (optional, for dark mode theme)
Download the latest release from the Releases page:
- Windows: Download
RestimFunscriptProcessor-vX.X.X-Windows.zip, extract, and run the.exe - No Python installation required!
For developers or users who want the latest features:
Windows:
# Double-click setup.bat or run in Command Prompt:
setup.bat
# Then run the app:
run.batmacOS / Linux:
# Make the script executable and run it:
chmod +x setup.sh
./setup.sh
# Then run the app:
./run.sh-
Clone or download this repository:
git clone https://github.com/edger477/funscript-tools.git cd funscript-tools -
Create and activate a virtual environment:
# Windows python -m venv venv venv\Scripts\activate # macOS / Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
Linux - You may need to install tkinter separately:
# Ubuntu/Debian
sudo apt install python3-tk python3-venv
# Fedora
sudo dnf install python3-tkinter
# Arch
sudo pacman -S tkmacOS - If using Homebrew Python:
brew install python-tk-
Run the application:
python main.py
-
Select your input
.funscriptfile using the Browse button, or drag and drop.funscriptfiles directly onto the window -
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
The Custom Event Builder is a visual timeline editor for scheduling and tuning events that are applied on top of processed funscripts. Open it from the main window with the Custom Event Builder button.
- Drag event blocks to reposition them on the timeline
- Drag the right edge of a block to resize its duration
- Click a block to select it and edit its parameters in the Parameters panel
- Right-click a block for a context menu (delete, duplicate, change time)
- Ctrl+scroll to zoom in/out; scroll or middle-drag to pan
- Snap to grid: configurable interval (Off / 0.5s / 1s / 5s / 10s / 30s / 1min)
- Snap to playhead: drag an event edge near the playhead and it snaps automatically (cyan indicator line shown)
- Undo/Redo: Ctrl+Z / Ctrl+Y
- Click the ruler to place the playhead at any timestamp
- Left/Right arrow: step ±1 frame
- Shift+arrow: step ±30 frames
- Ctrl+Shift+arrow: step ±30 seconds
- Spacebar: play/pause video (when a video is loaded)
Load a video file alongside your funscript to use the timeline as a scrubber:
- Click Load Video in the action bar to pick a video file, or place a video with the same base name as your funscript in the same folder for automatic loading
- Click Video to show/hide the floating video window
- The video window has a seek bar, play/pause button, and volume slider
- Bidirectional sync: moving the timeline playhead seeks the video; video playback drives the playhead in real time
- Supported formats: mp4, mkv, avi, mov, wmv, m4v
The input .funscript is displayed as a filled waveform below the event lane, making it easy to align events with specific moments in the script (e.g. peaks, pauses, direction changes). The waveform loads automatically when an events file is opened alongside a matching funscript. Use the Show waveform checkbox in the Options bar to hide it.
Click the Dark button in either the main window or the Custom Event Builder action bar to toggle between light and dark themes. The setting applies globally to all windows.
Click any event block to load it into the Parameters panel. Each event type exposes its own set of configurable parameters (durations, intensities, frequencies, etc.) with a live preview of the effect steps. Click Apply Parameters to push changes back to the timeline.
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
- tkinter errors on Linux: Install tkinter with
sudo apt install python3-tk(Ubuntu/Debian) - Drag-and-drop not working: Install tkinterdnd2 with
pip install tkinterdnd2(optional feature) - Python version errors: This app requires Python 3.8+. Python 3.13+ is recommended for best compatibility
- Video playback not working: Install ffpyplayer and Pillow with
pip install ffpyplayer Pillow - Dark mode not available: Install sv-ttk with
pip install sv-ttk
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 componentsmain_window.py- Main application windowcustom_events_builder.py- Canvas timeline editor (CanvasTimelinePanel, VideoPanel, CustomEventsBuilderDialog)theme.py- Global dark/light theme manager (sv_ttk wrapper + listener registry)curve_editor_dialog.py- Matplotlib curve editor
build_windows.py- Windows executable build scriptfunscript_processor.spec- PyInstaller spec (includes ffpyplayer, Pillow, sv_ttk)