-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add wavetable oscillator #176
base: master
Are you sure you want to change the base?
Conversation
Source/Utility/wavetables.h
Outdated
std::vector<WaveBuffer *> buffers; | ||
}; | ||
|
||
struct Tables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested by @antisvin in the forum, it might be a good idea to provide a templated FFT implementation instead of one hardcoded below.
ouu, very cool! Thanks for the contribution @brbrr I should have some time to give this a look next week! |
Contributed-by: Guilherme Moreno <guilhermewr9@gmail.com> Signed-off-by: Guilherme Moreno <guilhermewr9@gmail.com>
Contributed-by: Guilherme Moreno <guilhermewr9@gmail.com> Signed-off-by: Guilherme Moreno <guilhermewr9@gmail.com>
Contributed-by: Guilherme Moreno <guilhermewr9@gmail.com> Signed-off-by: Guilherme Moreno <guilhermewr9@gmail.com>
Converts the struct to a template class, allowing to provide the FFT implementation as a template parameter. Signed-off-by: Guilherme Moreno <guilhermewr9@gmail.com>
Added to .cpp to the makefile, added the .h to daisysp.h, fixed an include. Also moved the waveform enum to pass by the type rather than uint8_t. This is a change I want to make across the library to how we handle enums.
Fix CMake build
Converts Tables struct into a template class
…into add/wavetable-osc
case Waveform::WAVE_SIN: SetWaveTable(&Tables::Sine); break; | ||
case Waveform::WAVE_TRI: SetWaveTable(&Tables::Tri); break; | ||
case Waveform::WAVE_SAW: SetWaveTable(&Tables::Saw); break; | ||
case Waveform::WAVE_SQUARE: SetWaveTable(&Tables::Square); break; | ||
default: SetWaveTable(&Tables::Sine); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These now throw the error(s)
'template<class T, void (* fft_func)(int, T*, T*)> class daisysp::Tables' used without template arguments
and so on.
Sorry about working on top of you a bit, I think my repo was a bit out of sync and I re-fixed issues that had already been addressed. I'm going to squash and merge anyways, so it shouldn't be an issue. If we can get it building again with the template change, that would be great! |
Hi all! Any chance this will get merged? Having a wavetable OSC would be so awesome! |
Hi All! |
Adds a bandlimited wavetable oscillator. The implementation is quite opinionated, and it would require some amount of refactoring to make it general enough to be used in multiple use cases.
It behaves similarly to
Oscillator
class, with the caveat that one needs to runTables::Generate();
before processing the oscillator.