surge-synthesizer / surge

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

Lua for wavetables #4539

Open baconpaul opened 3 years ago

baconpaul commented 3 years ago

So if you give me

s (power of two samples) n (number of tables) f(n) -> float[s] (function to generate table n)

I can easily make a wavetable

and that sounds like a pretty easy thing to do with our lua evaluator

slightly different ui and storage strategy that formula modulator but most of what we have will carry over (which is why i named the gui classes LuaBlah not FormulaBlah).

mkruselj commented 3 years ago

For inspiration in what sort of functionality to add:

Hive Wavetables.zip

SpotlightKid commented 2 years ago

The Waldorf Microwave (I/II) also had an interesting way of generating Wavetables on the fly. You had to write a Wavtable program in a assembly-like language and then convert that into a Sysex-File, which you then sent to the synth.

I wrote a Python re-implementation of that converter ages ago. The actual calculation of the wavetable program happens in the hardware, though:

https://github.com/SpotlightKid/upaw2/blob/master/upaw.description

baconpaul commented 1 year ago

Gonna bounce this out of 1.2 again and deactivate it in the nightly

nuoun commented 2 months ago

So the wavetable script editor has been re-enabled in the Nightly builds for a while and I've been slowly working on it, so far #7674, #7680, #7687, #7755, #7764 and #7767 have been merged which refactor the code, make UI changes, add window tearout, implement the prelude for WTSE and some more and things are slowly coming together. I had a much longer writeup ready which I could still post if there is interest in some of the concepts and ideas and possible side projects for the future but I'll try to keep this short and limit this post to priority here which is to try and figure out what is needed to get this component ready for release.

So I will add a (likely incomplete) list of issues that still need work in the next post, but a lot of this is to just test and periodically ask if stuff makes sense or what needs improving and I would of course much appreciate feedback on this. Paul brought up two things on a previous PR which I'll mention here:

  1. Window tear out, this currently works different for the WTSE, in formula the editor switches to the next LFO when a different LFO that has formula active gets selected and the WTSE does not do this even when another WT oscillator gets selected. I don't think this is a big issue, maybe a QoL thing at best and I'm not sure how this is handled in the GUI code right now. Other than that, the torn out window just stays open when the VCO gets changed and I think that is in line with how other torn out windows behave.

  2. Accessibility, this needs both improvements and testing, the main issue I see now is that the graph's current frame numberfield is probably not helpful since accessibility should be disable on that entire component anyway so it should also skip over that UI element. Then it needs more testing but it probably makes sense to do that after we decide if this layout is final and/or if there is more to add.

So TL;DR, this project is being worked on and feel free to discuss, suggest, critique, help test, get involved, etc. (But really Shortcircuit could use more help so if you're looking for a project please focus on that!)

nuoun commented 2 months ago

Outstanding issues (WIP):

Code

UI

WTSE Prelude

Accessibility

Documentation

Tutorial and examples

Bugfixes