Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Oscillator with Fourier Series/WaveTable #31

Open
fastaro opened this issue Nov 23, 2023 · 1 comment
Open

Custom Oscillator with Fourier Series/WaveTable #31

fastaro opened this issue Nov 23, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fastaro
Copy link

fastaro commented Nov 23, 2023

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

@nick-thompson nick-thompson added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 8, 2023
@nick-thompson
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants