PythonDancer - A port of FunscriptDancer to Python

This is a port of FunscriptDancer by ncdxncdx to Python

It has a ready to run executeable for Windows.
Check the latest release at: Releases · NodudeWasTaken/PythonDancer · GitHub

Features:

  • Audio beat scripting
  • Qt5 UI
  • Commandline interface
  • Heatmap export
  • Funscript export
  • CSV export (cli only)
  • Automap to a speed specific speed (in units/s, same as OFS)

Automap works by averaging a certain speed at a given energy magnitude.
This means it doesnt work well if there are large silent sections.

Thanks to @ncdxncdx for the original app!

17 Likes

I just get initialization of internal failed whenever I try it with a song :person_shrugging:

I even tried building it from the source in a venv, but I get to like 20% loading and then it just won’t work with mp3, ogg, m4a files.

I’m able to get the oldest release working though…

This is actually pretty cool to get the beat of a song, sweet.

Here’s a preview of it working on a song:


my audio was low and I should’ve used OBS lol next time

Thats apparently an incompatibility between numba and numpy 1.24+
Im downgrading to numpy 1.23 to hopefully fix it for systems experiencing that

1 Like

I’ve had a report of malware (wacatac trojan from windows defender) on this download, could you give it a scan to check?

I imagine it’s a false positive since this is being built from open source, but might be worth giving the relase .exe a double check just in case :slight_smile:

It’s because the .exe has code for the downloader to download ffmpeg, yeah.
You can also build it yourself, just a bit of a hassle of you don’t program ofc. I had to play with Windows Defender a bit.

Im not inclined to remove the ffmpeg downloader as i would take a serious usability hit.
But getting detected by windows defender is a serious fault, so i will be considering alternative strategies.
For now you can have a scan of the latest build (numpy downgrade): VirusTotal
EDIT:
I did remove it

FFMpeg was missing
Please install ffmpeg using your package manager!
Suggestions:
Official Website: Download FFmpeg
Ubuntu/Debian: sudo apt install ffmpeg
Arch/Manjaro: sudo pacman -S ffmpeg
Homebrew: brew install ffmpeg
dancer\ui.py:41: UserWarning: Tight layout not applied. The bottom and top margins cannot be made large enough to accommodate all axes decorations.
self.canvas.draw()

how to fix it :frowning:

If you’re on windows, download ffmpeg and place ffmpeg.exe alongside pythondancer.exe
Or use winget or chocolatey.
If you’re on linux or macos, use the appropriate package manager.

1 Like

hi, i just downloaded the build.zip from the latest release and run the exe but this appears
“dancer\ui.py:41: UserWarning: Tight layout not applied. The bottom and top margins cannot be made large enough to accommodate all axes decorations.”

thank you very much i solved it :slight_smile:

This is a very useful tool, thank you. @Nodude

Anybody found a sweet spot for the settings?

I find that 225-250 is the sweetspot

sorry to bump,

but is it possible to generate more than one at a time? Setting up the settings and then just batch processing like 10 at once

The UI doesn’t support this, but with a bit of linux parallel magic you can use it via CLI, see the git description.
Like:
parallel --jobs 4 python -m dancer.cli -c -a --auto_speed 265 {} ::: ./videos/*.mp4

1 Like

thanks for the input. I dont use linux, but gpt made me a small script that uses the command line. It iterates through every mp4 file in the directory and puts the resulting funscripts into the output folder,

thanks again

care to share?

sure

import os

# Get the list of files in the current directory
files_in_directory = os.listdir()

# Filter out only the .mp4 files
mp4_files = [file for file in files_in_directory if file.endswith(".mp4")]

# Iterate over each .mp4 file
for mp4_file in mp4_files:
    # Output directory
    output_dir = "output"
    # Create the output directory if it doesn't exist
    os.makedirs(output_dir, exist_ok=True)
    
    # Command to execute
    command = (
        f'PythonDancer.exe --cli --automap --out_path "{output_dir}/{mp4_file}.funscript" "{mp4_file}"'
    )
    
    # Execute the command
    os.system(command)

be sure to delete the .mp4 from the funscript file. I use renamer for that.

Be sure to have the pythondancer.exe and the script in the same directory as your videos

2 Likes

Is there anywhere I can read about what the settings mean? Can’t really see a difference in the “out of range” options in the preview. Just trying to figure the best settings for this.

Best regards!

I think it really depends on the music. I usually get the bpm of the music (tunebat.com) and set my target speed to that in milliseconds (60/bpm=target speed). Not sure if that is what target speed is supposed to do but it seems to work. I set 50 for target pitch. This looks to put the center of the strokes at 50 (or whatever pitch is set) I also uncheck PLP estimation. This seems to match tempo better. Once it does it’s calculations, I’ll adjust the energy slider to get everything within the 0-100 range with no clipping. I leave out of range option on crop. Again, all this depends on music and I’m creating with estim in mind. I will use ScriptPlayer to load up the music and resulting script to see what it looks like and make adjustment when needed. Until someone actually writes a wiki explaining everything, this is what I go with from trial and error. I might be way off the mark though, but it works for me.

1 Like