Soundfont files

Hello …

I did read somewhere that the new version of Renoise was to support Sounfont .sf2 files … so, I tried to load a soundfont … loads it, but not well … it seems it loads all the samples together into one sample …

In the file dialog, the extension .sf2 was not in the list … so I did set ., and tried to load that soundfont … giving the aforesaid result …

Now I don’t know whether that new about supporting .sf2 files was accurate or not … ???

Thanks …

SF2 is becoming quite obsolete these days.

We chose to support the SFZ open file format instead, which is more modern, more fully featured, and so on.

https://forum.renoise.com/t/yup-can-we-expect-3-1-this-year/44247

:wink:

In what way is SFZ better than Sf2?

The best orchestral libraries i have are SF2.

Well, so I have decided to make a converter from sf2 to xrni with C++ … I hope it will be done in 15 days or so …

Does someone know the units inside the .xrni’s Intrument.xml for the and tags ?? In Renoise they are ms (miliseconds), but the numbers inside those tags do not correspond to miliseconds …

I guess they are calculated with some exp or log function, but I cannot wonder which …

By now the program I am making does these tasks:

  • It converts sf2 with single or multiple instruments into one or multiples .xrni files

  • Sets the samples loops ok

  • It expands the samples all over the keyboard if needed, filling empty ranges with the nearest sample

  • Only for mono/16 bits soundfonts

  • I’ve tried small and big soundfonts up to 120 MB or so, and works ok … it failed with a 600 MB soundfont … I guess a memory problem …

  • Volume envelope AHDSR, working in that …

  • Other modulator envelopes: I don’t understand the soundfont documentation well, and I don’t know how to implement them inside Renoise … so maybe in a next version

Basically what it does is to seek for the instruments (not presets) inside a sf2 file, and converts them into .xrni … keeping the original samples, sample-ranges, expanding them if needed, and sets a volume AHDSR…

I will publish it when finished …

I guess they are calculated with some exp or log function, but I cannot wonder which …

Yes, the values in the XML are normalized values (0-1) and are either ms or beats depending on the tempo sync settings. They are exponentially scaled too.

If you want ms, make sure tempo sync is disabled. Then you can use the following conversion:

SCALE_FACTOR = 3.0

double NormalizedToMs(double NormalizedValue, double MsRangeMin, double MsRangeMax)
{
 return MsRangeMin + ::pow(NormalizedValue, SCALE_FACTOR) * (MsRangeMax - MsRangeMin);
}

double MsToNormalized(double MsValue, double MsRangeMin, double MsRangeMax)
{
 return ::pow((MsValue - MsRangeMin) / (MsRangeMax - MsRangeMin), 1.0 / SCALE_FACTOR);
}

Good morning,

So, at the end I’ve just released a small console-program to convert Soundfonts (.sf2) to XRNI.

This is the BETA version:

http://aammff.org/soundfont2xrni

I hope you find it useful.

All comments about this BETA version are welcome toreruido@gmail.com

Greetings …

*** Thanks for the info about about how to calculate those values … I will implement that in the next version … thanks a lot !!!

1 Like