Hey everyone! I’m currently studying computer science and I’m enrolled in a numeric analysis class, and my peers and I got plenty of freedom to do a final assignment involving one of the numeric methods taught in the lectures.
I started studying JUCE’s tutorials and figuring out the basics of DSP, and I eventually found out that interpolation is used in removing the artifacting that you get when move sliders over non-continuous intervals to alter parameters, so I thought I could use it in my project. As it stands, I spent the better part of this month desperately attempting to code my own interpolation function for a simple sine generator - and failed miserably. The results are always something in the lines of incredibly garbled audio, infinitely growing frequency values and whatnot.
I have a sine wave generator, where the user controls the frequency of each wave and the volume in db, cobbled together from a tutorial that didn’t illustrate how to smoothly interpolate values between slider changes. I added an interpolate button that toggles my attempts at smoothing out the value transitions.
It’s from the basic Audio Application template, standard MainComponent.cpp and MainComponent.cpp files.
I have four possible options here:
(1) Fix my crappy interpolation attempt - I can’t for the life of me figure out what exactly to use as input for the function.
(2) Understand the SmoothedValue or the LinearSmoothedValue JUCE class - I lifted the former from the kvraudio forums (https://www.kvraudio.com/forum/viewtopic.php?p=6548432) in hopes of finding something that worked so that I could create my own solution based on it, but I couldn’t find out how to get it to work. Same goes for the LinearSmoothedValue. Couldn’t get it to work.
(3) Attempt spline interpolating, but I’m really more clueless about that than I already am with simple interpolation.
(4) Give up and cry really hard in a corner somewhere.
I added plenty of commentary in my code to possibly guide to the root of my problems. Right now I am currently very desperate and I have pretty much given up hope of ever removing the artifacting, and I would greatly appreciate any help given. (the main issues are around line 156.)
Codeshare for non-download option:
MainComponent.cpp (12.1 KB)
Main.cpp (3.9 KB)