Converting Presets from 2.21 beta to 2.2 (Procedure Inside)
-
- KVRAF
- Topic Starter
- 2675 posts since 14 Jul, 2005 from Australia
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.
becomes
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!
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.
becomes
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!
- KVRAF
- 2121 posts since 10 Apr, 2002 from Saint Germain en Laye, France
- KVRAF
- 8182 posts since 22 Sep, 2008 from Windsor. UK
-
- KVRAF
- Topic Starter
- 2675 posts since 14 Jul, 2005 from Australia
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:
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
e.g.
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
OSX or Linux
1. Open Terminal
e.g.
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
Hope this helps everyone out!
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()
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>"
Code: Select all
cd "C:\Production\Sylenth Presets"
4. Run the script in the Command Prompt window
Code: Select all
C:\Python27\python.exe sylenth1-fxp-fix.py
1. Open Terminal
Code: Select all
cd "<full path where your presets are>"
Code: Select all
cd "/Users/me/Presets"
3. Run the script your terminal
Code: Select all
python ./sylenth1-fxp-fix.py
- KVRist
- 73 posts since 14 Nov, 2012
I was really hoping you would go with a Perl 1-liner.
Big ups tho!
Big ups tho!
-
- KVRAF
- Topic Starter
- 2675 posts since 14 Jul, 2005 from Australia
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 presetsbalx wrote:I was really hoping you would go with a Perl 1-liner.
Big ups tho!
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)))"
Code: Select all
python -c "with open('bank.fxb', 'r+b') as f: f.seek(164); f.write(chr(int('9A', 16)))"
-
- KVRAF
- Topic Starter
- 2675 posts since 14 Jul, 2005 from Australia
This should do it in Perl if you prefer
FXP preset:
FXP bank:
Naturally, in these one-liners, you'll need to replace the filename in the command and please be sure to backup the files beforehand!
FXP preset:
Code: Select all
perl -e 'open my $fh, "+<", "preset.fxp"; seek($fh, 64, 0); syswrite($fh, chr(hex("9A"))); close $fh'
Code: Select all
perl -e 'open my $fh, "+<", "bank.fxb"; seek($fh, 164, 0); syswrite($fh, chr(hex("9A"))); close $fh'
- Banned
- 771 posts since 22 Jan, 2011 from Ableton Suite 9 and Reaper
really nice one - thanks!
-
- KVRer
- 14 posts since 11 Apr, 2005 from Prague
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
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
-
- KVRer
- 1 posts since 22 Oct, 2018
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 ?
Is the a way to convert to 2.211 ?
-
- KVRian
- 1303 posts since 25 Sep, 2006