MCC crashes on custom mfprojz files, need help

As the microfreak preset bank mfprojz file format is basically just a renamed zip file, i started writing a python script to sort the presets by category. quite easy, the category is the number behind the name string in the mbp files. but when compressing the stuff back into the file and trying to import it into the MCC , it crashes and closes without anything.

The windows logs contain the following:

AppName MIDI Control Center.exe

AppVersion 1.17.2.94

AppTimeStamp 65e7243c

ModuleName MIDI Control Center.exe

ModuleVersion 1.17.2.94

ModuleTimeStamp 65e7243c

ExceptionCode c0000409

FaultingOffset 0000000000c703ed

ProcessId 0x396c

ProcessCreationTime 0x1dac02105177465

AppPath C:\Program Files (x86)\Arturia\MIDI Control Center\MIDI Control Center.exe

ModulePath C:\Program Files (x86)\Arturia\MIDI Control Center\MIDI Control Center.exe

IntegratorReportId 93bb9c28-38fd-4ca0-a779-56f1c35498d6

PackageFullName

PackageRelativeAppId

I would be awesome if someone could give me a hint on how to correctly compress the files again (in python would be great)

Hello.

We do not officially support custom mfprojz so I won’t go into debugging this one (and your crash info is not enough for me to debug it anyway), but if you did respect the whole architecture of the file, I suspect that you might have not re-compressed the project the right way.

Some insight from what I remember:

  • This is a zip compression
  • The compression must use the “store” mode (ie. no compression)
  • You must not compress the root folder but everything inside it

One must use Python zipfile module with it’s ZIP_STORED mode.

Hope that may help you with your script !

2 Likes

Hello there,

Thanks for the tips,

these actually helped even tho the problem was that you have to manually add the folders themselves.

def compress_folder_to_mfprojz_file(file_path):
    # takes the original mfprojz file_path and compresses the previously extracted folder to a new mfprojz file
    folder_path = os.path.splitext(file_path)[0]
    zip_file = f"{folder_path}_SORTED.zip"
    arcname=""
    file_path_=""
    with zipfile.ZipFile(zip_file, 'w', compression=zipfile.ZIP_STORED) as zip_ref:
        for base, dirs, files in os.walk(folder_path):
            for file in files:
                file_path_ = os.path.join(base, file)
                arcname = os.path.relpath(file_path_, folder_path)
                zip_ref.write(file_path_, arcname, compress_type=zipfile.ZIP_DEFLATED)


        dir_name_src = os.path.dirname(file_path_)
        dir_name = os.path.dirname(arcname)
        root_dir_src = os.path.dirname(dir_name_src)
        root_dir = os.path.dirname(dir_name)
        zip_ref.write(f"{root_dir_src}",f"{root_dir}", compress_type=zipfile.ZIP_STORED)
        zip_ref.write(f"{dir_name_src}",f"{dir_name}", compress_type=zipfile.ZIP_STORED)
    os.rename(zip_file, f"{folder_path}_SORTED.mfprojz")
    return zip_file