Open fastaro opened 11 months ago
Hey @fastaro I'm sorry for the delay here! I love that idea and I think it should be pretty easy to add. I'll mark it for inclusion as a new feature. I think this is a good opportunity for a first-time contributor too, so I'll add some details on how I envision implementing it and you or anyone else can feel free to pick it up if you get to it before I do!
Generally I think this implementation could look a lot like the existing el.table
, so we'd add a new node type in a new file that looks much like Table.h, and instead of taking a property path
that looks up a wavetable in the shared resouce map, it should take a property (maybe "coefficients") that provides the real/imag coefficients from which to compute a lookup table. Then can allocate a buffer, build the appropriate lookup table (following the algorithm defined in that spec here: https://webaudio.github.io/web-audio-api/#waveform-generation), and pass the lookup table to the realtime thread to be read from via the incoming phasor. Should be a fun one!
It'd be awesome if there was a feature to allow custom oscillators similar to the web audio api
https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createoscillator