Know Your Nodes pt 5 & 5.5 - Splines & Streamlining a Large Patch



Nice! How did you end up installing sox? I need to update my instructions, and while I have my preferred way, I want to make it as friendly as I can.


There is a website called Mac where you can use Homebrew to install them. Here it is for sox. You only have to install Homebrew once and after that it’s easy peasy. I installed fftw3 the same way too.


How long should your wav files be as my test file was way too long (solid green line rather than dots)?


Like it filled up the whole spline node? I would have liked to see that.

edit: try 600 samples, that’s the adventure kid library’s resolution.


They’re serious about just a single cycle. The more complicated your wave, the more points in your spline.


Even at 600 samples or 17 ms at 44.1 sample rate, there are way too many points on the spline.


Yeah, I don’t do a ton to prevent craziness… the software was built around the Adventure Kid’s stuff, which is pretty much invariant. Probably if you get over 1000 or so, the software should ask if you’re sure, or just not do it. It just gets too big.

In theory I could have it downsample, since that’s a reasonably straightforward operation.


For another data point, the WaveEdit software appears to spit out 256 samples, which is probably more than enough.


Down sampling is the way to go as even at an 8k sample rate that’s a lot of points.


That looks about right, actually. Alternatively, you can place a spline over your wavetable and trace it.



I used samples from it and there were still too many for me. I think the easiest solution is to get a very noisy sample and grab a very small portion and then down sample that if needed.


Do any of you have a sense for how many samples make a good wavetable? Balancing performance with quality, it likely depends on your hardware, but there’s no sense in having an oscillator be so demanding.


Seems like around 600 is pretty common, but I think we can get away with less on Audulus, the linear interpolation mitigates stair-stepping at low frequencies.


I’ll see if I can add some code to optionally downsample. sox will do it for me, so I can probably just lean on that.

In theory I could try to detect if a WAV file is more than one cycle. It would be easier on the user… just record a clip from your synth or whatever and throw the software at it, but there could be dragons down that road.


I’ve been having fun with the tracing method, and then playing with the phasor shape.


Here I just grabbed a few seconds of a very noisy 44.1k sampled audio wave with lots of noise. It worked great. On iOS, I used the TwistedWave app to grab the sample. This work flow works great for me and the resulting splines have a good balance between detail and being easy on CPU.


Awesome! You should consider making a screen capture tutorial! Also, I love twisted wave, so simple yet so powerful.


I’m not as industrious as you so tracing seems way too analog and labor intensive. I encourage you to try the few millisecond noisy sample approach.


I’ll follow your lead and do a video, it’s been a very educational process for me and fairly easy to do now that it’s setup.


So it looks like you two are just using the spline node? I could easily make a version of this that skips the anti-aliasing and management cruft and just spits out a spline node. Would that be useful?