Author Topic: SF2 OGG  (Read 253 times)

rv

  • Posts: 199
SF2 OGG
« on: 7 Feb '18 - 11:46 »
Hello,

I am using BASS_MIDI_FontLoad  to preload samples into memory, so the low latency realtime synth is always ready to play
But it takes a lot of memory ...

Is it possible to use OGG or FLAC and win some memory, even with the BASS_MIDI_FontLoad  ?

I think the FLAC will come back to normal wav size in memory, as it is lossless, but what about OGG?

Does the samples points are still perfect?

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: SF2 OGG
« Reply #1 on: 7 Feb '18 - 17:20 »
BASS_MIDI_FontLoad will decode the samples to memory, ready for playback. So the memory usage will be the same regardless of the encoding used in the file. The same applies when samples are loaded during playback rather than being preloaded.

rv

  • Posts: 199
Re: SF2 OGG
« Reply #2 on: 7 Feb '18 - 18:28 »
The same apply with a LOSSY compression?

rv

  • Posts: 199
Re: SF2 OGG
« Reply #3 on: 7 Feb '18 - 19:13 »
I mean , if a WAV is 2 MB  a OGG LOSSY is  1MB
when loading the OGG, does it will use 1MB of memory or 2MB

Ian @ un4seen

  • Administrator
  • Posts: 21017
Re: SF2 OGG
« Reply #4 on: 8 Feb '18 - 15:29 »
The sample data is decompressed when loaded, so it would use the same amount of memory as the original sample data (2MB in your example). Note that lossy encoding doesn't change the length/duration of the sample, or at least it shouldn't do :)

rv

  • Posts: 199
Re: SF2 OGG
« Reply #5 on: 8 Feb '18 - 15:41 »
So really NO advantages to lossy compress the sounds, as it will sound les good for the same final memory usage :)

Ian, it's time to think about decompression and streaming the samples from disk, not having to load everything on memory.  Just the few X bytes per samples

I also have found a very fast dll for decompression dll
https://en.wikipedia.org/wiki/Zstandard

Memory Mapped is not good

The BASSMIDI will take another level and will be used by a lot more virtual instruments companies
Native Instruments wins ton of money and is number 1 in audio plugins field just because they have created the sample player Kontakt with Direct From Disk technology few years ago
So they can sell good quality sounds with very long samples without worrying of memory