Another soundfont2 -> xrni converter

Hi everyone,

it seems like it’s a bit compulsory here to create one’s own converter from soundfont2 (maybe because we all hope for the native support which would extend our sample library).

I wanted to use one of the existing converter, unfortunately they all seemed to require a .net platform, which I’m not very keen to install under linux.

So, I started my own project, in python aiming to create usable xnri out of existing soundfont2. I ended up creating a python library to parse sf2 files and another to read and write renoise instrument, so that using python with sf2 or xrni for other purposes (xrni optimiser, …) would be easier to develop.

As of now, for those who’d like to try, you can install (or update) the development versions (until it’s polished enough to be pushed to pypi) through :

pip install --upgrade git+https://gitlab.com/zeograd/sf2utils.git git+https://gitlab.com/zeograd/rnsutils.git

It should work with python2.7 and python3.4+ at least (probably lower python3 too, and might work in python2.6 but I didn’t test nor aim to support those). I tried to keep the dependencies to a minimum but still ended up with lxml (which might require python development header on your machine if lxml isn’t already present and pip can’t install a binary version and has to compile it).

You’ll end up with 2 scripts:

  • sf2parse (from the sf2utils package) which, as you could guess, will parse a sf2 file and print info about it (it’s more a debug tool than anything else and overlaps with sf2dump utility from gigtools package)

  • sf2toxnri which will convert a sf2 into a bunch of xnri files (you’ll probably want to specify -o to have them created elsewhere than the current directory).

I consider the code alpha quality at this time (I versionned it 0.5) and I’m still actively working on it, until I can get decent orchestral xrni out of their sf2 counterpart. However, I think that the converter shouldn’t crash nor produce invalid renoise file at this stage (until you mess with the template .xnri file the structure of which I don’t check for now). If that happens, please report an issue on https://gitlab.com/zeograd/rnsutils with the incriminated files.

If you have xnri which doesn’t sound as expected (detuned, missing effects or wrong volume envelope typically), please don’t report it yet, I still have open points regarding those (notably a tuning offset on moderatly complex sf2 which appeared a few moments ago).

On the other hand, if you have successes, I’d like to hear about them to make sure that my platforms (debian 8, python 2.7, 3.4, 3.5) and files aren’t the only ones for which the converter works.

Thanks in advance,

Olivier

– edit –

I uploaded my tools on PyPi and now you can grab the latest stable version with just:

pip install rnsutils