styleRemover

There is something wrong with the local styles in m4l devices. They reproduce themself, I'm not sure about the coherences of this problem.

As a quick workaround I made this tool which removes local style information from patches or m4l devices.  This makes use of the cool fileout mxj by FRid and Max's filein to parse the files on the byte level.

Copy the folder in the zip into your max searchpath and open styleRemover.maxpat

styleRemover.zip
zip
styleRemover1.1.zip
zip
styleRemover1.2.zip
zip
do.while's icon

great !
its irony u had to do it before cycling . this issue is known for a while . Thank u

Wil's icon

hi 11olsen,
i dropped the folder in Document > Max 7 and still getting these errors. Is there a special place to put the java and js. files?

Screen-Shot-2015-05-19-at-12.51.24-PM.png
png
11OLSEN's icon

It seems like your fileout mxj is not receiving the correct filename. Let me come home, then i'll take a closer look.
You seem to have the files at correct location otherwise there would be error messages like ""object not found".

11OLSEN's icon

On a mac java (or at least the mxj) does not accept a path with "Macintosh:" in front. I updated the patch with a little workaround. Any more problems ?

Wil's icon

great ! the 'cleaning' process is complete. (green light - bingo) but now the newly cleaned patch will not open. i tried a replacement and a rewrite. restarted max. nothing. i don't really have a photo or more info to send. but yes i am using a mac.

11OLSEN's icon

I just tested it again on the mac, no problems here. Are you sure you're not dropping an already frozen device?
because that will produce a device you can't open anymore.

Wil's icon

first, i am working .maxpat files.

i did some more tests. put copies of a few different patches in a separate folder. each patch had hundreds of those (whatever you want to call 'em... recursive styles virus...)

i opened all my test files first to make sure they were not frozen.

the really small ones... not file size kb, but small as in 'only a few objects' worked fine. all styles are clear and it reopened.

but when i drop a patch with large number of objects it will not reopen.

so this works (sometimes). just have to make sure to backup copies before using. and frankly, these styles turned out to be such a nightmare since November, its better to avoid like the plague for now.

thanks for the work.

11OLSEN's icon

could you send me one of the big patches so i can try to reproduce the fail?

Wil's icon

ok. here is the problem. i made a copy of a smaller patch that fails after dropping. the patch is started out at 2.5 mb. then i removed ALL the objects except for a single comment. it went down to 2.4mb. i ran it through the styleRemover and the file size went down to 2kb. but now it will not open.

here is the file that will not open after removing the styles. unfortunately i cannot send the original because the upload limit is 512kb (copy compressed doesn't want to upload this large file either) but it is clear that the styles are inflating the file size tremendously.

i don't remember the starting size of the patches that worked, and i cannot find one that need the styles removed. somehow, all my smaller patches seem to be clean now!

edit: here is a dropbox link to the larger file.
https://www.dropbox.com/s/99b0u24vhzrv10x/styletest.maxpat?dl=0

styletest.removedStyles.maxpat
Max Patch
11OLSEN's icon

Thanks for your patience WIL. The files helped a lot. The problem seems to be fixed now, please redownload and try it. O.

Wil's icon

indeed. works like a champ!!! great work! thanks.

MH's icon

Seems like the url doesn't work anymore !

________
Oh sorry didn't realize that TOOLS was an active link

Screen-Shot-2015-05-28-at-13.44.32.png
png
11OLSEN's icon

I don't know what happened there with the link. Fortunately that is not the download link but a reference to my site.

phiol's icon

Thank you so very very very much for this. It would now take me 12 min per save on a patch that was new 248Mb and is now reduced to 1.4Mb .

This has been a life saver thanks so much.

I said a thousands times before
They should've stuck to Max6.1.9 interface, bring a the new features.

thanks a lot

phiol

11OLSEN's icon

I share your opinion. O.

MH's icon

Yes thanks a million times

This has been a life saver for me as well 11OLSEN !

We were totally exhausted with that saving for ever.

dhjdhjdhj's icon

@11OLSEN --- thanks for that tool --- much appreciated

Wax's icon

I have a blank file used for my Max patcher template and after I use this, it won't open the file with the styles removed. Nothing happens.

Is it because I have nothing in the file?

11OLSEN's icon

Hi WADE, the bug has been fixed by cycling74 (bug only exists in early max7 versions). there should be no need to use the tool anymore. If the file is blank anyway, why don't you create a new file which has no styles.

timothy.stulman's icon

You are a god-send.

Vincent Goudard's icon

I made a style-remover patch that does not rely on mxj, for anyone interested.
The patch is just loading the maxpat into a dict and removing the "styles" key.

Max Patch
Copy patch and select New From Clipboard in Max.


Published

Creative Commons License

Author