Optimization for .vital files

when all 3 oscilators have same wavetable, vital preset file have this wavetable saved 3 times. my solution is saving all used in preset wavetables somewhere in a file, and in oscilator data save only index, leading to this wavetable. to determine if its same wavetable you can just use simple hash function. so if there will be preset like
[osc0: wavetable0, osc1: wavetable1, osc2: wavetable2] in preset file data will be saved as wavetables:[wavetable0, wavetable1, wavetable2] and oscs:[0, 1, 2].
if there will be preset like
[osc0: wavetable0, osc1: wavetable1, osc2: wavetable0] data will be saved as wavetables:[wavetable0, wavetable1] and oscs:[0, 1, 0].
i know vital files are small, but optimization is always better, if you have saved like 1000 presets it really make difference.

second thing is audio in sampler is saved even when sampler is disabled, i think this should be changed too.

2 Likes

Changing the vital file structure would take a lot of work and time–and also break most lf my personal vital preset projects. It would also mean vital would need to support an entirely new file type; currently, all changes have been additive rather than subtractive and replacing a huge section lf the file structure would make vital more complex and increase dev time.

I would agree that the default sample takes a lot of space when unused. You can just make your own default preset with a smaller sample and set it as the default.

1 Like

i dont think changing file structure its hard, i mean its just json, im sure its parsed by other library, not vital implementation. i think it can be done by adding like max. 10 lines of code (not sure because i havent seen source code). also vital versions are backward compatible, so it can be made in the way that it wont broke old presets.

Maybe also have an option to save it “optimized”, throwing out all settings and wavetable that are not actively used by the patch? That could also save some file size.

2 Likes

yes, i think its great idea, or checkbox showing when you want to save preset, with question „do you want to save it as optimized”.

2 Likes