Go Back   Winamp & Shoutcast Forums > Visualizations > MilkDrop > MilkDrop Presets

Reply
Thread Tools Search this Thread Display Modes
Old 15th February 2021, 08:19   #41
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 919
Quote:
Try the exe on a freshly installed windows, you'll see, it will be working fine, you must have a font problem
I don't have a fresh installation handy, but the scaling issue is (was !) the same on my office PC which is controlled by our IT department so it is VERY unlikely it has any issues with fonts or similar.

Quote:
Click again on the options button to leave!
Boff ! I'm stupid... That is rather non-standard but your call !

Quote:
Crash
The crash is absolutely reliable, tried on two machines with different Lazarus versions. Also when running the compiled exe standalone.
Problem:
This only becomes visible with range cheks ON but debugger disabled. When I enable the debugger, it crashes really hard. The task manager even insists that killing Lazarus is not a valid option. I have to restart.

So the only way to get closer to that is by injecting Showmessages at different places. I think the problem is in LabelGoClick here

code:
if not directoryexists(ChoixRepertoire2) then CreateDir(ChoixRepertoire2);
showmessage (inttostr(Length(ChoixRepertoire2)));
if ChoixRepertoire2[Length(ChoixRepertoire2)] <> '\' then ChoixRepertoire2 := ChoixRepertoire2 + '\';


Showmessage tells me that the length (choixrepertoire2) is zero. BTW I had not selected an input folder, just clicked go.

I can't see a mistake here, but...

code:
showmessage (inttostr(ptrint(ChoixRepertoire2)));

also prints zero. Looks like the string is not allocated. Check how Lazarus handles ansistrings, maybe they need to be created first...

Aha !
code:
showmessage (ChoixRepertoire2[0]);


causes a compilation error : "Element zero of an ansi/wide - or longstring cannot be accessed."

Last edited by Nitorami; 15th February 2021 at 09:30.
Nitorami is offline   Reply With Quote
Old 16th February 2021, 22:48   #42
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
showmessage (inttostr(Length(ChoixRepertoire2))); >> show '43'
showmessage (inttostr(ptrint(ChoixRepertoire2))); >> show '23533416'

Very strange that you have 0.
I don't have a crash using MilkDrop2077 too. I really don't see why it's crashing.

btw I'm using lazarus-2.0.10-fpc-3.2.0-win32.exe
what version are you using?
the lazarus-2.0.10-fpc-3.2.0-win64.exe version wouldn't compile the version I did with the xm player (Illegal COFF Magic error on libufmod.o), so I'm using the win32.exe one.
serge000 is offline   Reply With Quote
Old 16th February 2021, 23:09   #43
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
it works on the online sandbox too : https://app.any.run/tasks/edd26891-4...-3969d3938f19/
serge000 is offline   Reply With Quote
Old 16th February 2021, 23:33   #44
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
I've updated the code to v2.0.1 to check if the output folder is valid just after clicking on go:
if not directoryexists(ChoixRepertoire2) then begin showmessage('Please select a valid OUTPUT folder first'); exit; end;
serge000 is offline   Reply With Quote
Old 17th February 2021, 07:47   #45
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 919
That solves that problem, but I still get range check errors further down. It does not seem to be 100% reliable, and the position of the error seems to jump, I cannot locate it.

I am using Lazarus x86-64 here.

Saying that the program runs somewhere, e.g. in a sandbox, does not mean a lot. You may have uninitialised variables which happen to be zero in your environment, and therefore it works, by chance.

I have now recompiled with the "trash variables" option on, to initialise your variables with garbage values. It crashes violently on pressing GO. I could not kill Lazarus, but just before I was about restarting the PC, a message popped up. See attached.

Strings are starting at 1, not zero !!!! I guess you have this mistake in more than just one place.
Attached Thumbnails
Click image for larger version

Name:	Unbenannt.PNG
Views:	13
Size:	11.6 KB
ID:	54721  
Nitorami is offline   Reply With Quote
Old 17th February 2021, 16:47   #46
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
ok your error come from MILKFLOAT3 (the procedure to randomize colors).
can you un-check the 1st checkbox 'randomize colors' and try again to see if it works?

I've updated the code to v2.0.2:
I removed s : string from public variables (to maybe avoid your error, it crashed on the string 's')
I've put a try except end; when clicking on GO, so if one preset crash, the error will be skipped and the rest should carry on (when running the exe alone without lazarus).

Also try my exe compiled to with lazarus 32bits to see if you still have errors!
serge000 is offline   Reply With Quote
Old 17th February 2021, 17:31   #47
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 919
Just a quick test with a fresh github download

Your exe seems to work but I don't trust it, that may be random.

Recompiled with Lazarus x68_64 V2.0.0
- All checks OFF: No crash but presets generation reliably ceases after a random number of presets, in general less than 10.
- Range checks ON: Same. At least no range check error anymore.
- trash variables ON: Hard crash on GO. You most definitely still have uninitialised variables somewhere.
- unticked "randomize colors": Seems to run through.
Nitorami is offline   Reply With Quote
Old 18th February 2021, 21:15   #48
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 919
I messed with your code a bit more.

The missing indentation makes it bad to read. For heaven's sake, use indentation. If you are too lazy to do it, simply run a code formatter over the source.

Putting everything into huge try-except blocks is also a bad idea because this swallows all exceptions including those generated by FPC's range check. Always test a program thoroughly with range checks ON, before putting everything into try/except blocks. Range check is REALLY REALLY useful to detect progamming errors.

I guess you also call Milkfloat3 from inside a try/except or try/finally block, and therefore you were never warned of the range violations within it. After having crashed my machine a few times, I found two further instances of
code:
for j := 0 to something do if s[j]...
within Milkfloat3 on manual inspection. I changed these to start at 1, and now THAT crash is gone.

But there is more... In procedure MILKDROP, line 1281, you access s[1] without knowing if s has at least length 1. To gloss over any problems, you put it all within a large try-except block. But you probably call MILKDROP from inside yet another try-except block -> Crash!

And you are using GOTOs... these may be considered evil or not, there have been endless discussions on the subject - but GOTO together with try/except is really a very bad idea.
Nitorami is offline   Reply With Quote
Old 19th February 2021, 06:28   #49
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
Quote:
The missing indentation makes it bad to read. For heaven's sake, use indentation. If you are too lazy to do it, simply run a code formatter over the source.
oh yea sorry my code is probably horrible to read, I'm not a professional coder at all (I cook french food for a living lol), I'm self-learning coding on the fly
I've tried the CTRL+D to format the code but I don't like it, code looks even bigger, I prefer my big blocks of code so I've putted the string function in STRING.INC and all the interface stuff in INTERFACE.INC. Now Unit1 looks easier and a little cleaner I think.

I've changed the for j := 0 to something do if s[j]... to 1!
I don't think s[1] could have been empty if you look just a few lines before, but just in case I added a check,
I also removed the try-except,
and I removed the GOTO!

v2.0.3 is up!
serge000 is offline   Reply With Quote
Old 19th February 2021, 19:42   #50
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
I think 99.5%+ of the presets generated are now bug free btw!

I've created a zip (https://mega.nz/folder/VFFGUJYB#pPNXxLPIstNE6WzqCWCAJg) with 100.000 presets mashed from CreamOfTheCrop_20200216 with the warp+comp shader from my 200 presets included with MilkDrop2077 with ~30% of values changed up to - or + 20%. I took 28 minutes to create all the presets Results are pretty fun.

I've checked the first 500, 0 errors but 2 are making winamp crashing hard and WACUP freeze and close (#204 and #281).
https://mega.nz/file/UF0yzBBA#30B1Jl...cPvq2MCV48Lulw

I'd like to know what makes milkdrop to crash if someone have an idea
serge000 is offline   Reply With Quote
Old 20th February 2021, 19:55   #51
serge000
Junior Member
 
Join Date: Oct 2018
Posts: 33
v2.0.4

I added a F10 hotkey to force closing winamp/wacup in case milkdrop crash.
It work really well even if milkdrop is completely unresponsive and you can't call the taskmanager because you're in fullscreen mode, just press the key F10 and winamp will be closed.
the formStyle is changed to fsNormal so you can keep MilkDrop2077 easily open when using milkdrop.
serge000 is offline   Reply With Quote
Old 21st February 2021, 19:20   #52
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 919
Hi Serge
Quote:
I don't think s[1] could have been empty if you look just a few lines before, but just in case I added a check,
Yes it could, I added "if length(s)=0 then halt;" and the program halted.

On the crash of #204 and #281: These contain fragments of my mandelbox code in the per frame and preset init sections. In the original code, the preset on startup first calculates a free position in the mandelbox space by try and error. If you make minor changes to it, the code may simply not find such a free position, and keep searching forever.
The mashup option was really devised at earlier milkdrop versions, which allowed only very limited and linear programming by the user: 32 variables, hardly any dependencies, no loops, no conditional jumps. But later, a proper programming language (ns-eel) was added, which extended the coding possibilities quite dramatically by providing loops, a global memory space, conditional jumps etc. And it also introduced the possibility of endless loops, and made mashing more risky. The reason why most of your mashups are stable is that these amendmends came rather late, where milkdops had already passed its zenith, and only a few individuals still made presets and used the new features.

The F10 option is brillant, and it really works
Nitorami is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > MilkDrop > MilkDrop Presets

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump