MilkDrop3
MilkDrop3 copied to clipboard
Feature request: Spout texture sharing support
For versatility It would be awesome to have spout texture sharing support, then Milkdrop3 render could be used in OBS via Spout as background for streaming or in VJ softwares All the information for devs: https://github.com/leadedge/Spout2
Hey it's on my to-do list! I'm working on adding some other functionalities at the moment, but one day I will!
I also asked for the Spout integration + I am still doing it, but because of too many errors, I can't do it. If you are done, please DM me on Twitter or Discord the code that you integrated with Spout.
5 months ago, I released the issue about Spout integration on my BeatDrop improvement. Btw, it's still in my to do list.
https://github.com/OfficialIncubo/BeatDrop-Music-Visualizer/issues/3
There is a work around for the spout/syphon usage in OBS. Just take the time to pre-record the programs and then stream those video's when desired.
Yes, Spout/Syphon support would ease usage, OBS does have a Spout plugin, it's been updated to work since OBS rewrite in V28. Use it often to record NestDrop Midnight video's for a Discord community. MilkDrop v3 is "visible" to OBS. Just a matter of resizing MD3's window to either the target resolution, or a derivative of that rez. (I.E. target size = 1280 x 720. MD3 window size = 960 X 540)
Yes you can see the MilkDrop3 window in OBS, add 'Window Capture' in the Sources, then select the MilkDrop 3.exe, and make it fit to your screen's capture size.
hey .. id suggest to check out implimentation done by nest drop.. they had optimised it a lot more then what beatdrop could do. im pretty sure ive mentioned this at vj union software going back years... very familiar with the subject. but i feel we had moved on from this issue...
Just updated Nestdrop Midnight late last week. At the moment, I've close to 200K presets to curate. While there may be faster programs for viewing presets, Beatdrop is what's on hand. Can't be certain, but I chimed in with the work around of the spout inclusion. Have to say, Nestdrop Spout 2 feature pulls my fat outta fire more times than not. The video's mentioned above are 35 - 50 minutes long. This box of rocks I have doesn't have a GPU, so I'm limited to what DirectX can do on the motherboard.
200k presets? you must have ~150k duplicate. There are less than 70k unique presets total, and thousands of them are almost identical. You can clean your collection with a program like Czkawka to remove identical files, then try to remove almost identical files.
NestDrop is cool, next year I'm planing to code something similar, just much better and faster ;)
Much my reasoning on Beatdrop to curate is that earlier this year I stumble upon https://github.com/milkdrop2077/milkdrop2077 . I've been loading 10 or so presets into source folders and running 500 or so mashups based on them. Thanks Milkdrop2077 ! Couple weeks ago fell into a 60 preset collection that uses images for textures. While it may not a big deal to many, with just shy of 2 years under my Milkdrop experience, it's a game changer. Yes, Nestdrop Midnight has the sprite system. The hard transitions using sprites has me digging for more elegant solutions.
Hello all..
I was referred to this issue and was prompted to test Spout for DirectX 9 which I haven't done for quite some time. As a result I have been successful in updating my old fork of BeatDrop. All went well with the latest code and it's also updated for Visual Studio 2022.
The changes could be used in MilkDrop3, but there's a bit more involved because Spout texture sharing requires DirectX9EX instead of just DirectX9 that the original Milkdrop was based on. All the code is commented throughout though if you want to have a look.
I will look at your Spout version of BeatDrop! Can you please make this to support for Visual Studio 2019?
Btw. What is DIRECTX9EX? I think it's an evolved version of DirectX 9.
Hey leadedge! thank you so much for all the information!
No problems.
@OfficialIncubo - You can change to Visual Studio 2019. Open BeatDrop.sln and :
Project > Properties > General > Platform Toolset > Visual Studio 1019 (v142)
With re-build, you will get re-definition warnings due to using Windows Kits\10 together with Microsoft DirectX SDK (June 2010). These will not occur with build only. If you want to remove them :
Project > Properties > Include Directories Include (WindowsSDK_IncludePath) before (DXSDK_DIR)Include
DirectX9EX is an enhanced version of DirectX 9 and required for shared textures. Look at DXcontext.cpp and also search for "DX9EX" in MilkDrop2PcmVisualizer.cpp. There is a function "bool CheckForDirectX9c()" that looks for the correct version on your system.
These links might be useful
https://www.microsoft.com/en-us/download/details.aspx?id=8109
http://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe
Some cons that I found on the latest BeatDrop for Spout release are:
- Preset editing and Preset list navigation didn't work at all.
- Some presets may contain errors because of ns-eel modifications that you did.
Plus I didn't try how the Spout works on BeatDrop and using with more instances. I have Spout on my laptop, so I'll try if I have time. I only tried with the old version and it works perfectly!
The modifications are only for reference for use of the SpoutDX class instead of the OpenGL SpoutLIbrary. I don't support the program itself any more. The SpoutLIbrary version will still work fine as long as you stay with the same library files.
Hey @leadedge quick question : how to recompile your first version of beatdrop with the SpoutLibrary.dll ?
I have this error : plugin.obj : error LNK2019: unresolved external symbol _GetSpout@0 referenced in function "public: virtual void __thiscall CPlugin::MyPreInitialize(void)" (?MyPreInitialize@CPlugin@@UAEXXZ) .\Debug\BeatDrop.exe : fatal error LNK1120: 1 unresolved externals
I am missing some OpenGL library or something? I'm using VS2019 + glut lib
The linker isn't finding SpoutLibrary.
I have made a "SpoutLibrary" branch with the original code for reference.
You need a "spoutLibrary" folder as in the repo.
Project > Propertines > Linker > General add ..\spoutlibrary
Project > Properties > Linker > Input SpoutLibrary.lib
These might also be needed opengl32.lib glu32.lib
Copy SpoutLibrary.dll to your release folder.
These Seven Succurro Presets are sooo epic, but I have a problem about "Succurro - TV Static 1" preset:
- error in shape 0 init code
- error in shape 3 init code
- error in shape 3 per-frame code
- Could not load texture: z.j
One thing is: I need the "zombies_03.jpg" image texture file in order to work.
Really sorry but I can't help with the presets. I understand that some are brilliant.
Some time back there was collaborative work with the developer of NestDrop and the preset might have been added then. Maybe you will find the missing file in the NestDrop presets.
Hey, @leadedge, I managed to compile the SpoutDX9 version of BeatDrop and I have some cons for you:
- Navigation keys not working, function keys working
- Some presets may be broken
- Ctrl+Z not working.
- The window starts at 720x720, but it's stretched. When I resize it, the visualization stays normal.
The old version (1.0.0.2) works than intended and I don't prefer the SpoutDX9 version of it until it's fixed, but where do I menage to compile the 1.0.0.2 version of BeatDrop?
Hi @OfficialIncubo I found the bug preventing some keys like Ctrl-Z from working. I can't help with the presets. Many of these were added during collaborative work and left in the repository. Some might be useful for you. Starting window size is 1280x720. There was an intention for the output resolution to be independent of the window size but I don't think that was ever implemented. I updated the Master branch with the key correction and also updated the SpoutLibrary branch to Visual Studio 2022 and new library files. It works OK as far as I can tell. That's the branch you need if you want to compile the original version.
Now the preset functionality and navigation keys now worked! But... if I reenable the Spout output, it doesn't appear on the reciever. Plus I implemented a new beat detection algorithm btw.
https://github.com/leadedge/BeatDrop/assets/74858188/d5d51382-92cd-450f-9514-7abf60f10e7a
I changed the SpoutWidth and SpoutHeight to 720. When I open BeatDrop, it doesn't send to Spout. It doesn't support below 1920x1080 resolution.
Ok at least the keys work. I will have a look at disable/enable.
I will also look at a 720x720 window. I assume you prefer a square format. 1920x1080 is the initial sending size, independent of the window size and these initial dimensions can be changed before compiling the project. As I mentioned before, this was not completed and re-sizing the window changes the sender resolution to the window size. If the window is not re-sized, the initial resolution remains.
Also I should mention that the main reason for the change to the DirectX9 version is the increased speed and reduction of CPU load. It uses a GPU texture surface instead of pixels from the backbuffer.
...these initial dimensions can be changed before compiling the project.
I tried to change the initial dimensions to 720×720, but I started BeatDrop and it doesn't initialize the Spout output to the Sender.
Also I should mention that the main reason for the change to the DirectX9 version is the increased speed and reduction of CPU load. It uses a GPU texture surface instead of pixels from the backbuffer.
Even the missing keys and some preset functionalities are fixed, I give up from menaging to compile the OpenGL Version of BeatDrop (1.0.0.2). So I'm still using the SpoutDX9 of this.
Oh! And if I resize the window if I want, the Spout Reciever info only sends the old resolution info. I want it to respond to the actual resolution.
Hey, @leadedge! If I enable the SpoutOutput once, it starts to send it.
Log:
[notice] CPlugin::RenderFrame - size change from 0x0 to 1920x1080
[notice] CPlugin::OpenSender(1920, 1080)
[notice] spoutDX9::SetDX9device (0xF4D8540)
[notice] spoutDX9::OpenDirectX9 - hWnd = 0x0000000
[notice] spoutDX9::CreateSharedDX9Texture 1920x1080 - format 22 - handle 0x00008C2
[notice] spoutSenderNames::CreateSender
[notice] [BeatDrop] 1920x1080, share handle = 0x00008C2, format = 22
[notice] spoutFrameCount::CreateAccessMutex - texture access mutex [BeatDrop_SpoutAccessMutex] created
[notice] Handle [0x00007FC]
[notice] SpoutFrameCount::EnableFrameCount - frame count semaphore [BeatDrop_Count_Semaphore] exists
[notice] Handle for access [0x0000734]
Then I turned off and I reenabled it. Nothing happened. It won't let me to show this visualizer to sender again.
Plus after the first resize to the smaller window, it shows:
[notice] spoutDX9::CreateSharedDX9Texture 1920x1080 - format 22 - handle 0x00013C2
...which the sender info is still in 1920×1080. I want to update the resize info to the actual window resolution. Not the old one.
I will have a look at disable/enable.
Oh. I see. If you are done, then remind me. Then, please see the window resolution bug.
I have been though the whole project to complete the sender size implementation. The aim was to set a fixed sender resolution that does not change when the user re-sizes the window. The resolution can then be much larger than the monitor can display, such as 4096x4096 for large scale projection.
I made a change to SendDX9surface in the SpoutDX9 class to enable this. The same change allows an option for the sender size to be the same as the window. Code comments in milkdropfs.cpp RenderFrame/SendDX9surface describe how to do this.
I also found an error in nseel2/nseel-compiler.c where an intrinsic re-definition was removed without retaining the default definition. This might fix the preset errors.
I hope this allows you to achieve what you want to do. Unfortunately I don't have any more time to spend on this right now.
Ok. The Spout Output now works after reenabling than intended.
The aim was to set a fixed sender resolution that does not change when the user re-sizes the window.
Ok. This is the one unimplemented thing (I know?), but the Spout output needs to be reenabled after resizing the BeatDrop window.
Unfortunately I don't have any more time to spend on this right now.
Ok. Feel free to take a time. The Spout Integration is now finished today, but it remains a BETA feature.
The fixed sender resolution is implemented now. As far as I can see it's working OK. The Spout output remains enabled after re-sizing the window. If it has been disabled with Ctrl-Z it remains disabled.
I know. But one more: When I resize the window, it doesn't sync with the Spout Sender Resolution Info compared to the old one. Can you please spot what's the issue of it? As you mentioned to say this to me:
Unfortunately I don't have any more time to spend on this right now.
You can take a break. I don't want to disturb you at all ;)