Converting Presets from 2.21 beta to 2.2 (Procedure Inside)

Official support for: lennardigital.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hey there guys,

I recently produced a preset for a fellow producer in Sylenth using 2.21 beta and he couldn't open it as he is on Mac with Sylenth 2.2. So I decided to go hunting in the Hex to determine how the presets can be converted since I had seen talk about it here before.

The procedure is pretty simple. I used the freeware HxD editor on windows to do this (available at http://mh-nexus.de/en/hxd/) but any good hex editor should do the trick.

Step 1: Open the FXP preset in your hex editor
Step 2: Update the first value on line 5 from A3 to 9A

i.e.

Image

becomes

Image

Step 3: Save the file

And that's it :) This might be possible to script in Perl or Python so that you can easily batch convert presets on any Unix system (such as OSX).

Hope this helps someone else out! :)

Post

nice tip, thanks you !
Image

Post

I use 98, not 9A

It makes the soundbanks work in 2.2 and 2.21

Post

Hmm, well I actually dug up my 2.2 installer and produced some presets with 2.2 and all of them used a 9A value, but whatever works :)

I've produced a Python script that can be used on Windows, Linux and OSX which will repair all FXP and FXB presets in your chosen directory (non-recursive).

Disclaimer: I cannot be held responsible if this script blows up your computer or kills your cat. Ensure that you have full backups of your working directory before running this script.

So here's the code:

Code: Select all

#!/usr/bin/env python
import glob
import logging
import os
import shutil

# Define the hex code you wish to replace the byte with
VERSION_HEX = '9A'


def main():

    FXP_FILE = 1
    FXB_FILE = 2

    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)-15s %(levelname)-7s %(message)s',
                        datefmt='%Y-%m-%d %H:%M:%S')
    version_byte = int(VERSION_HEX, 16)

    fxp_files = glob.glob('*.fxp')
    fxb_files = glob.glob('*.fxb')

    preset_files = []
    for fxp_file in fxp_files:
        preset_files.append((fxp_file, FXP_FILE))
    for fxb_file in fxb_files:
        preset_files.append((fxb_file, FXB_FILE))

    for preset_file, type in preset_files:
        with open(preset_file, 'r+b') as f:

            # Seek to the byte where the version is stored
            if type == FXP_FILE:
                f.seek(64)
            else:
                f.seek(164)

            # Check if the preset was created on Sylenth1 2.21
            if hex(ord(f.read(1))) == '0xa3':
                # Attempt to backup the file
                if os.path.exists(preset_file + '.bak'):
                    logging.error(('%s: Backup file for already exists and '
                                   'must be removed before processing, '
                                   'skipping') % preset_file)
                    continue
                shutil.copyfile(preset_file, preset_file + '.bak')

                # Write the selected version byte
                logging.info('%s: Processing Sylenth1 2.21 preset(s)' %
                             preset_file)
                if type == FXP_FILE:
                    f.seek(64)
                else:
                    f.seek(164)
                f.write(chr(version_byte))

            else:
                logging.warning(('%s: This file is not in Sylenth 2.21 '
                                 'format, skipping') % preset_file)


if __name__ == '__main__':
    main()
To use it, follow the steps below.

Windows

1. Install Python 2.7.x (not 3.x.x) from http://www.python.org/download/
2. Open Command Prompt and type

Code: Select all

cd "<full path where your presets are>"
e.g.

Code: Select all

cd "C:\Production\Sylenth Presets"
3. Create a file sylenth1-fxp-fix.py in the preset directory and Copy / Paste the code into the file (ensuring that spaces are correctly preserved)

4. Run the script in the Command Prompt window

Code: Select all

C:\Python27\python.exe sylenth1-fxp-fix.py
OSX or Linux

1. Open Terminal

Code: Select all

cd "<full path where your presets are>"
e.g.

Code: Select all

cd "/Users/me/Presets"
2. Create a file sylenth1-fxp-fix.py in the preset directory and Copy / Paste the code into the file (ensuring that spaces are correctly preserved)

3. Run the script your terminal

Code: Select all

python ./sylenth1-fxp-fix.py
Hope this helps everyone out! 8)

Post

I was really hoping you would go with a Perl 1-liner.

Big ups tho!

Post

balx wrote:I was really hoping you would go with a Perl 1-liner.

Big ups tho!
Haha sorry mate, been coding Python almost full-time for the last year and thought I would go a little more detailed for those who have a folder full of presets :)

Edit: Just for you, a one liner but in Python :)

FXP preset:

Code: Select all

python -c "with open('preset.fxp', 'r+b') as f: f.seek(64); f.write(chr(int('9A', 16)))"
FXB bank:

Code: Select all

python -c "with open('bank.fxb', 'r+b') as f: f.seek(164); f.write(chr(int('9A', 16)))"

Post

This should do it in Perl if you prefer :)

FXP preset:

Code: Select all

perl -e 'open my $fh, "+<", "preset.fxp"; seek($fh, 64, 0); syswrite($fh, chr(hex("9A"))); close $fh'
FXP bank:

Code: Select all

perl -e 'open my $fh, "+<", "bank.fxb"; seek($fh, 164, 0); syswrite($fh, chr(hex("9A"))); close $fh'
Naturally, in these one-liners, you'll need to replace the filename in the command and please be sure to backup the files beforehand! 8)

Post

really nice one - thanks!

Post

Guys, any idea how do retune all presets? I'm trying to compare them but it seems the fine tune is three parameters?

cmp -l gat440.fxp gat1.fxp
409 0 24
410 0 70
411 0 1
$ cmp -l gat440.fxp gat2.fxp
409 0 24
410 0 70
411 0 1 # offset is 1
457 0 331
458 0 217
459 0 375
460 77 76
$ cmp -l gat440.fxp gat3.fxp
409 0 50
410 0 160
411 0 2 #offset is 2
457 0 47
458 0 160
459 0 2 #offset is 2

Post

This does not work for newer fxp. I think I've got at least a bunch of 3.0 .fxp files
Is the a way to convert to 2.211 ?

Post

Why on earth would you need to convert v3.0 presets to v2.x?

Sylenth1 v2.x is outdated and no longer supported. It has been fully replaced by Sylenth1 v3.x, which is fully compatible with any older preset files. The update is free of charge.
Image

Post Reply

Return to “LennarDigital”