Wavetable Synth with Lerp

Just finished this small project. Wanted to see how far I could push Vuo and audio in C.

Custom node reading a list of VuoReal values as the wavetable and writing them to the audio buffer while interpolating between them to create nicer connections - frequency is also controllable.

VuoReal List can be any length, from 2 values to 2000 (or more). Can be exciting with a ‘parametric wavetable’ style node, if we implement XY (not only X) then some very cool scanning synthesis is not that far away!

Actually made this to test inter-buffer triggering, but this is nice. Currently the frequency is worked out within the buffer loop can be changed with control signals if wanted (FM synth). (FM Wavetable Synth!)

As with custom nodes you will need to place the awm.audio.wavetable.vuonode in your nodes directory.

Please also note there are no ‘speed ups’ everything is calculated in realtime.

awm.audio_.wavetable.zip (80.1 KB)

Wavetable.app_.zip (7.6 MB)

2 Likes

Added mouse X controls pitch of note cluster.

Wavetable 2.vuo (15.5 KB)

I would love feedback on how to speed things up a bit. Currently its using 50% of one core, (on a 4ghz 8 core machine). In the awm.audio_wavetable.zip there is the .c file, so please check it out and give me feedback.

I am thinking of making a version without lerp- and possibly changing the use of VuoListGetValue_VuoReal() to only looking up table every execution (and saving the table, and accessing it via a pointer?) Currently VouListGetValue_VuoReal() is used for every sample.

I could also make the table a fixed size?

I would like to continue this node in C (not C++) as I am using this as a learning tool and it would be nice to make a “Vuo” class for synthesis.

Any ideas?

UPDATE: Just worked out that this node quantises frequencies, so as you get higher there are less frequencies selectable. Need to fix. Fixed but need to update.

I used https://mitpress.mit.edu/books/audio-programming-book to work out where I was going wrong. (Well it had more to do with the maths for sample playback speed having a typo). :-/

But if anyone is interested in getting to know c/c++ for audio it’s actually a very good book. There are some negative reviews but that is only due to the fact that there is a crash course in c in the beginning - then smash: audio code! But if you know a bit of c and use online resources it’s a good start. (At least I think so)

As promised. This new version includes the Guard Point automatically (so that point one of wavetable is also the last point (whatever that is)). Included in this is also a wavetable generator, currently it just makes a simple sine wave, (naive - so no band-limiting) but this could easily be added. I intend to test for Lerp to reduce CPU load. Attached is .c files (very messy right now)

Wavetable 2.vuo (16.1 KB)

awm.audio_.wavetable.make_.vuonode (1.7 KB)

awm.audio_.wavetable.vuonode (3.52 KB)

Wavetable 2.app_.zip (7.62 MB)

Archive.zip (2.2 KB)