Open teepox opened 2 years ago
MultiFunPlayer will never directly handle video or audio, only scripts. I would be willing to add audio output, so scripts/motion providers could control volume/pitch/balance. Not sure how many users would have a use for that tho tbh.
I made a tool to dynamically generate estim audio. The audio is generated based on (currently) 2-axis input, it accepts tcode commands over websockets so it integrates well with MFP. Saved me a lot of time by not having to implement video synchronization myself.
https://github.com/diglet48/restim
If the project gets a bit more users perhaps we can add a device preset in MFP, but no other changes to MFP are necessary.
Nice! I guess it should work with any player that can send TCode via a websocket?
I would probably still add some version of estim support to MFP, just need to find a good resource on what the actual audio output should be and what are expected configurable parameters.
Yes, tcode via websocket. I'm very happy this MFP supports this, I already used it in numerous projects. There are plans to add buttplug support eventually.
I found that the usual phase/amplitude control for e-stim audio, such as cfs6t08p's funscript converter maps poorly to the actual sensations for multi-electrode configs due to variations in hardware, skin resistance and electrode placement. There is an implementation in scriptplayer, but I'm not sure if it sees much use due to these problems.
I invented a new coordinate system for scripters, and a calibration system for users, that solves this problem. This allows the creation of funscipts that utilize the full degrees of freedom estim offers, without knowledge of the users hardware setup. If you want to add estim support to MFP, I think this approach is much better and I hope it will become the standard, but at the moment there are only a few users.
Afaik most estim files are created by copy-pasting short segments in audacity. The resulting audio file is then synchronized in scriptplayer, by manually starting the video and estim track at the same time, or by packaging the estim audio in a surround sound channel in the video.
Since most estim files are distributed as mp3, a quick solution for MFP would be to simply load an mp3 from disk and output it to the user-specified sound device.
MultiFunPlayer will never directly handle video or audio, only scripts.
Why? Especially if you will consider adding audio output, why not have a source that just takes already existing mp3 and doesn't do anything with scripts. Half of my library are videos without scripts, and I was sent here from milovana when I saw that it syncs with HereSphere... so I wanted to try diglet's restim (will probably still try it) but I have to keep also using ScriptPlayer for syncing with videos that have dedicated mp3 estim. Actually I wanted to pull code to see if I could contribute something but need to know why you are categorically against it.
I just don't want to have a full video/audio player to support when almost everything can be done via mpv. There is also no easy place to fit that in that I can think of. Generating audio could be easily done in an output target which runs in its own thread while decoding+playing+synchronizing audio/video internally is a different beast.
Tbh I dont even know how estim mp3 are used. Are they synced to the movement in the video? Do you have to output them to separate audio output? Maybe this could be done via MFP plugin? Which opens and synchronizes a second mpv window just for the estim mp3.
Oh, ok let me explain. Many people use estim instead of strokers. diglet's restim does on-the-fly conversion of funscript into estim signals that provide similar sensations, but it is much more advanced since it allows tuning how the processing is done on the fly. All that is great for "standard" videos that are often POV, with funscript, but we also have many creators that create videos that have its own estim (mp3 files that accompany videos, intended to be played to a different output device, not speakers but the audio card that is connected to estim box), sometimes they also create funscript too, but estim they produce is often not a simple "conversion" from funscript, and can contain things like ramp-up, or strong tremolo that is intended to be a challenging section (edging or almost painful), or to cause effects that are hard to accomplish with funscript, sometimes also producing a dual-channel (so no triphase type of signal that we generate from funscript but something intended for different experience).
The ScriptPlayer, although it can also play video in itself, does similar job as MFP in that it can use either local player, or sync to HereSphere, MPC etc, and in that case it is only playing either .funscript, or a .mp3/.wav file (or both). You can define outputs, there is "estim output" (sound card) to which mp3 file with same name as video is automatically played in sync with video (whatever is your player of choice). So I mainly use it to sync mp3 files that contain estim signals for videos that I play in HereSphere.
Now, many of these mp3 files are converts from funscript, some of them I even did in my fork of existing funscript->mp3 converter (https://edger477.github.io/funstim/funstim.html), but I saw what diglet did with realtime conversion and I want to try that. ScriptPlayer has rudimentary ability to convert funscripts to audio device output in realtime, but I do not use it since the output is choppy. I have a feeling I will like the diglet's plug in and probably we can make a plugin in same way that would play mp3 in sync (same what restim does now funscript->audio card, it would just be mp3->audio card, so simpler because we don't need to do signal generation, we just take input buffer and pass to output). That plugin would completely fill the space that is now filled by ScriptPlayer since MFP+restim will be handling funscript -> estim audio (feature that now does not even work properly in ScriptPlayer), and then I guess we actually need to create a plugin that would do mp3->estim audio.
So, if I were to try to make a MFP plugin for syncplay of mp3 files to configurable audio device myself (mp3 would be loaded by name or convention based on currently played video from whatever is the main player, and synced to same timestamp), what existing plugin should I review to get started faster?
By plugins I mean actual C# plugins. You put your plugin .cs file into the Plugins
directory and it gets compiled at runtime. Here is the "api": https://github.com/Yoooi0/MultiFunPlayer/blob/master/Source/MultiFunPlayer/Plugin/PluginBase.cs
You extend either AsyncPluginBase
or SyncPluginBase
and you can listen/generate all the internal MFP events. You could listen to a few media messages and implement a simple mp3 player with something like NAudio.
So, if I were to try to make a MFP plugin for syncplay of mp3 files to configurable audio device myself (mp3 would be loaded by name or convention based on currently played video from whatever is the main player, and synced to same timestamp), what existing plugin should I review to get started faster?
To have this native in MFP basically everything below the tab with the play/pause button (script heatmap and below) would have to be abstracted into a separate "container". So from here: https://github.com/Yoooi0/MultiFunPlayer/blob/362d0e3629e1846f8a4ba0b26af2d939f26f3717/Source/MultiFunPlayer/RootViewModel.cs#L15-L17 and here: https://github.com/Yoooi0/MultiFunPlayer/blob/362d0e3629e1846f8a4ba0b26af2d939f26f3717/Source/MultiFunPlayer/RootView.xaml#L87-L88 The script stuff receives media messages, loads corresponding funscripts, and then sends data via one of the outputs. Estim then would be implemented the same way, it would recieve media messages, load corresponding mp3 files, and then output to selected audio output.
Basically all that would have to be put into some sort of tab control, first tab would be for "scripts" second tab would be for "estim". "Estim" would probably also require a custom seek bar with audio waveform preview. Same sort of tab control like for video players, where you can also enable/disable them so you dont have unnecessary threads running.
I would like to echo diglet's and edger477's comments and requests for an audio input / output for estim mp3 files. Diglet has done a great job in addressing one of estim's basic challenges: "How to make a one-size-fits-all estim signal feel good / comfortable / pleasurable ("painful in a good way), given the differences between a user's estim box, electrodes and placement, and body chemistry (https://github.com/diglet48/restim , refer to the github restim wiki for a more detailed explanation). The restim individual calibration sequence has made a world of difference in improving the sensations and enjoyment of synchronized cock hero and estim videos. It would be great if multifunplayer users could play some of the classic estim made-from-scratch mp3 files by digitalparkinglot, numberonefan, lolo2, and others along with their accompanying videos. FYI - I have enjoyed MFP as an "orchestra conductor" for my video estim pleasure. There is a brief MFP installation and setup guide in the restim wiki aimed at helping the casual user install and use MFP. Thanks for your efforts in developing and improving MFP. Who knows, maybe one day I'll get a non audio device to play! K
Added basic PoC audio output, let me know if/how usable it is with estim: https://github.com/Yoooi0/MultiFunPlayer/actions/runs/4772771530
Support for E-Stim could be implemented using a separate audio file (MP3/WAV) for input, and selectable audio device for output. In this model MultiFunPlayer would act as an audio player, and sync play/pause for both input video and E-Stim audio. Audio from the video file and audio for E-Stim would be routed to separate audio devices for playback.
A more basic model would be to use an external audio player for the E-Stim audio. For a more advanced implementation, MultiFunPlayer could generate an audio signal from a funscript. Something similar has already been implemented in ScriptPlayer v1.1.1.