# PythonDancer - A port of FunscriptDancer to Python

**URL:** <https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029>\
**Category:** Software\
**Created:** [April 21, 2023, 10:55pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029 "2023-04-21T22:55:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nodude](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@Nodude](https://discuss.eroscripts.com/u/Nodude)\
**Post date:** [April 21, 2023, 10:55pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/1 "2023-04-21T22:55:46Z")

</div>

This is a port of [FunscriptDancer by ncdxncdx](https://discuss.eroscripts.com/t/funscriptdancer-generate-funscripts-from-music-beat-pitch-energy-cross-platform/73179) to Python

 ![image](https://eroscripts-discourse.eroscripts.com/original/3X/8/4/840af5dd235bec97677f1584f2d3da58385a601d.png)

It has a ready to run executeable for Windows.  
Check the latest release at: [Releases · NodudeWasTaken/PythonDancer · GitHub](https://github.com/NodudeWasTaken/PythonDancer/releases)  
You NEED ffmpeg, just put the ffmpeg.exe right next to the pythondancer exe, or put it in %PATH%.

Or checkout the VERY BROKEN web version: [pythondancer-js](https://nodudewastaken.github.io/pythondancer-js/)

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!

---

<div class="post-metadata">

**Author:** ![hentaiprodigy69](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/hentaiprodigy69/32/86761_2.png) [@hentaiprodigy69](https://discuss.eroscripts.com/u/hentaiprodigy69)\
**Post date:** [April 22, 2023, 6:27pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/2 "2023-04-22T18:27:24Z")

</div>

I just get initialization of internal failed whenever I try it with a song 🤷  
 ![image](https://eroscripts-discourse.eroscripts.com/original/3X/f/b/fbcdd42aa9c3dcd538d0f7e180e15998b45d9266.png)

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

---

<div class="post-metadata">

**Author:** ![Nodude](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@Nodude](https://discuss.eroscripts.com/u/Nodude)\
**Post date:** [April 22, 2023, 10:40pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/3 "2023-04-22T22:40:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![defucilis](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/defucilis/32/6480_2.png) [@defucilis](https://discuss.eroscripts.com/u/defucilis)\
**Post date:** [April 23, 2023, 12:22am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/4 "2023-04-23T00:22:34Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![hentaiprodigy69](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/hentaiprodigy69/32/86761_2.png) [@hentaiprodigy69](https://discuss.eroscripts.com/u/hentaiprodigy69)\
**Post date:** [April 23, 2023, 3:55am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/5 "2023-04-23T03:55:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nodude](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@Nodude](https://discuss.eroscripts.com/u/Nodude)\
**Post date:** [April 23, 2023, 8:35am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/6 "2023-04-23T08:35:00Z")

</div>

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): [https://www.virustotal.com/gui/file/522b542a78a74958bea127f8a95a22e211434ecee996466bfc68ce2d22eeccc1](https://www.virustotal.com/gui/file/522b542a78a74958bea127f8a95a22e211434ecee996466bfc68ce2d22eeccc1)  
EDIT:  
I did remove it

---

<div class="post-metadata">

**Author:** ![Nodude](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@Nodude](https://discuss.eroscripts.com/u/Nodude)\
**Post date:** [May 24, 2023, 10:09pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/8 "2023-05-24T22:09:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Juaum](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/juaum/32/153746_2.png) [@Juaum](https://discuss.eroscripts.com/u/Juaum)\
**Post date:** [May 24, 2023, 11:41pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/9 "2023-05-24T23:41:55Z")

</div>

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.”

---

<div class="post-metadata">

**Author:** ![shyboyx](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/s/dc4da7/32.png) [@shyboyx](https://discuss.eroscripts.com/u/shyboyx)\
**Post date:** [May 25, 2023, 8:45pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/11 "2023-05-25T20:45:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Razza](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@Razza](https://discuss.eroscripts.com/u/Razza)\
**Post date:** [June 29, 2023, 5:40pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/12 "2023-06-29T17:40:54Z")

</div>

Anybody found a sweet spot for the settings?

---

<div class="post-metadata">

**Author:** ![Nodude](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@Nodude](https://discuss.eroscripts.com/u/Nodude)\
**Post date:** [August 21, 2023, 12:09pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/13 "2023-08-21T12:09:04Z")

</div>

I find that 225-250 is the sweetspot

---

<div class="post-metadata">

**Author:** ![Ambi](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/ambi/32/143495_2.png) [@Ambi](https://discuss.eroscripts.com/u/Ambi)\
**Post date:** [May 1, 2024, 11:38am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/14 "2024-05-01T11:38:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nodude](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@Nodude](https://discuss.eroscripts.com/u/Nodude)\
**Post date:** [May 2, 2024, 10:32pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/15 "2024-05-02T22:32:35Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Ambi](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/ambi/32/143495_2.png) [@Ambi](https://discuss.eroscripts.com/u/Ambi)\
**Post date:** [May 3, 2024, 9:55am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/16 "2024-05-03T09:55:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joskevermeulen](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@Joskevermeulen](https://discuss.eroscripts.com/u/Joskevermeulen)\
**Post date:** [May 4, 2024, 7:18am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/17 "2024-05-04T07:18:45Z")

</div>

care to share?

---

<div class="post-metadata">

**Author:** ![Ambi](https://discuss.eroscripts.com/user_avatar/discuss.eroscripts.com/ambi/32/143495_2.png) [@Ambi](https://discuss.eroscripts.com/u/Ambi)\
**Post date:** [May 4, 2024, 9:21am UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/18 "2024-05-04T09:21:51Z")

</div>

sure

```auto
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

---

<div class="post-metadata">

**Author:** ![Emmi](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/e/e480ec/32.png) [@Emmi](https://discuss.eroscripts.com/u/Emmi)\
**Post date:** [June 9, 2024, 1:39pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/19 "2024-06-09T13:39:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![47dahc](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/4/d07c76/32.png) [@47dahc](https://discuss.eroscripts.com/u/47dahc)\
**Post date:** [June 26, 2024, 1:02pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/20 "2024-06-26T13:02:30Z")

</div>

I think it really depends on the music. I usually get the bpm of the music ([tunebat.com](http://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.

---

<div class="post-metadata">

**Author:** ![Emmi](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/e/e480ec/32.png) [@Emmi](https://discuss.eroscripts.com/u/Emmi)\
**Post date:** [June 26, 2024, 1:04pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/21 "2024-06-26T13:04:38Z")

</div>

appreciate the answer, will see if it makes sense to me 😛

---

<div class="post-metadata">

**Author:** ![kjdfhgkjsdfgkjdsfgkb](https://discuss.eroscripts.com/letter_avatar_proxy/v4/letter/k/3bc359/32.png) [@kjdfhgkjsdfgkjdsfgkb](https://discuss.eroscripts.com/u/kjdfhgkjsdfgkjdsfgkb)\
**Post date:** [February 2, 2025, 1:23pm UTC](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029/22 "2025-02-02T13:23:53Z")

</div>

Appreciate the effort in building this! I notice on higher resolution screens the text doesn’t seem to scale up and is very hard to read because of how small it is. Let me know if any other info would be useful in conjuring a solution.

[Next page](https://discuss.eroscripts.com/t/pythondancer-a-port-of-funscriptdancer-to-python/103029.md?page=2)
