surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.1k stars 395 forks source link

.wts files #4627

Open baconpaul opened 3 years ago

baconpaul commented 3 years ago

so I had a neat idea today

Right now wavetables are .wt or .wav files which contain all the data. In XT I've introduced the LUA wavetable generator (#4578)(and may introduce more languages too). So lets introduce a new format, the '.wts' file

A '.wts' file is a surge wavetable, completely. But it contains no data. Rather it looks like this

--surgewts language=LUA ntables=10 resolution=1024
function generate(x,n)
   -- blah blah my function here
end

It is just a text file with a special header. That header starts with --surgewts, //surgewts, ;;surgewts or #surgewts and then has kv pairs

Surge would show this file in the menu and patch browser just like any other file. You could drop it on and it's just like dropping on a wt or a wave. When you load it in the wavetable oscillator, it runs the generator to populate the data. If you want to share the data to a non-surge synth you can use the existant export function

But this means: We can write a swath of formulaic wavetables in the factory library and have them be 2kb each rather than 2mb.

CurlyMC commented 3 years ago

Hello @baconpaul, would this LUA programming language be able to read Wavosaur looppoints, embedded in de wav header and populate this into a .wts file format, that would be freaky awesome ??

I would be interested to hear your opinion about using or expanding this wts format also for including data for looping a wav audio file ( parameters for sample-start, sample-end, loop-direction and filepath to the wav file ). This way the wts file could be kept small and data could be pointing at wav files in a special wts? directory, so its possible to play partially looped wav files, just like Surge's ability to play one shots or wavtables. ( Idea I did post in the past : Loop support in imported wav files #2777, sorry I repeat, it was just an idea when reading here about your post about wts files )

A user exploring the XT beta's almost every day :-) Recently amazed by the all new wave shapers and expanded fx section. Thank you Surge Synth Team !! Kind Reagrds, Luc.

mkruselj commented 3 years ago

.wts file format is about generating the wavetable algorithmically using math formulas, not using WAV files.

CurlyMC commented 3 years ago

ok thanx @mkruselj for your fast reaction, I do understand. My plot was evil, but just did give it a try :-)