CHOW Tape Model by Jatin Chowdhury

VST, AU, AAX, CLAP, etc. Plugin Virtual Effects Discussion
RELATED
PRODUCTS

Post

I did read your article about the optimization. I wanted to share some of my findings and random thoughts. Maybe some of them can be useful and help squeezing more cycles:

-Just by looking at CMakeLists.txt it seems that you build with vanilla compile flags. Maybe you are passing them through the command line or some are on Juce's defaults (if you use them). If not, "ffast-math" might give a speedup if you can enable it. (notice that XSIMD is broken with ffast-math on clang as of now). Patch fixing XSIMD for ffast-math.
https://github.com/xtensor-stack/xsimd/pull/550

-You may want to enable link time optimization for release builds. Especially if you build your releases with Clang; more chances for the binaries to be smaller and better optimized.

-Notice that some of XSIMD's vector math functions might be slower than 2x scalar calls on double. On Ubuntu 20 Linux with clang12 vanilla glibc e.g. tanh is slower than two scalars on my machine. Maybe it is not the case for plain float.

-If you can restrict the compiler to be clang 11 or better on all platforms, you can use vector types (SIMD) directly without wrappers. Clang especially is extremely good with vectorization. You can then e.g. use the ternary operator on SIMD types and convert to the intrinsic type for using a 3rd party math library. Unfortunately on GCC vector types have problems with function overloading. Some contortions have to be done on Clang too (attribute values can not be detected by template parameters).

-If tanh is on the audio path for saturation purposes, this fast aproximation from Aleksey Vaneev still has an horizontal asymptote at -1/1 and is precise enough:
viewtopic.php?f=33&t=388650&start=45

Hope it helps.

Post

rafa1981 wrote: Wed Sep 08, 2021 5:16 pm I did read your article about the optimization. I wanted to share some of my findings and random thoughts. Maybe some of them can be useful and help squeezing more cycles:
Thanks for reading and for sharing your suggestions!
rafa1981 wrote: Wed Sep 08, 2021 5:16 pm -Just by looking at CMakeLists.txt it seems that you build with vanilla compile flags. Maybe you are passing them through the command line or some are on Juce's defaults (if you use them). If not, "ffast-math" might give a speedup if you can enable it. (notice that XSIMD is broken with ffast-math on clang as of now). Patch fixing XSIMD for ffast-math.
https://github.com/xtensor-stack/xsimd/pull/550
Currently I'm using the "juce_recommended_config_flags" along with a custom set of warning flags also based on JUCE's recommendations. I had tried turning on -ffast-math, but wasn't able to measure a noticeable speed improvement (at least on my machines). On top of that that I have some checks for NaN and INF floating point numbers, to reset the processor just in case the tape simulation goes unstable, and my understanding is that -ffast-math disables NaNs and INFs altogether. So I ended up sticking with -O3, but no -ffast-math.
rafa1981 wrote: Wed Sep 08, 2021 5:16 pm -You may want to enable link time optimization for release builds. Especially if you build your releases with Clang; more chances for the binaries to be smaller and better optimized.
I'm currently using the "juce_recommended_lto_flags". Are there any additional settings that could improve this behaviour?
rafa1981 wrote: Wed Sep 08, 2021 5:16 pm -Notice that some of XSIMD's vector math functions might be slower than 2x scalar calls on double. On Ubuntu 20 Linux with clang12 vanilla glibc e.g. tanh is slower than two scalars on my machine. Maybe it is not the case for plain float.
I had tested this as well... I found that on my Mac (Clang compiler) doing two tanh's was a tiny bit faster than the XSIMD implementation, but on my Windows laptop (MSVC compiler, plus a little older processor) it was noticeably slower. I ended up sticking with the XSIMD implementation just to reduce code repetition.
rafa1981 wrote: Wed Sep 08, 2021 5:16 pm -If you can restrict the compiler to be clang 11 or better on all platforms, you can use vector types (SIMD) directly without wrappers. Clang especially is extremely good with vectorization. You can then e.g. use the ternary operator on SIMD types and convert to the intrinsic type for using a 3rd party math library. Unfortunately on GCC vector types have problems with function overloading. Some contortions have to be done on Clang too (attribute values can not be detected by template parameters).
At the moment I'm trying to maintain compatibility with Clang, GCC, and MSVC. I have been considering dropping MSVC, since I've gotten Clang to work on my Windows machine now. Unfortunately, I don't think I'll be able to disable GCC support, since I've had some folks trying to compile for embedded devices, and they're typically using GCC-based compilers.
rafa1981 wrote: Wed Sep 08, 2021 5:16 pm -If tanh is on the audio path for saturation purposes, this fast aproximation from Aleksey Vaneev still has an horizontal asymptote at -1/1 and is precise enough:
viewtopic.php?f=33&t=388650&start=45
I've tried a few tanh approximations in the past, and ran into issues with numerical precision, since the algorithm uses the tanh function to compute the Langevin function, along with its first and second derivatives, which are then used in a kind of round-about way to solve a differential equation. So even very small errors in the tanh function, can cause instabilities or alter the overall sound. My understanding is that the XSIMD tanh is identical (or at least super close) to the std::tanh I was using before, and I haven't been able to hear or measure a noticeable difference. That said, I don't think I've tried that particular approximation, so I'll give it a go...

Anyway, I don't plan on tweaking the optimisations any more for this upcoming release, but I will definitely keep experimenting and trying to squeeze out more of those cycles for future versions :).

Thanks!
- Jatin

Post

Hink wrote: Wed Sep 08, 2021 5:55 am thats really cool of you bungle :)
Trying to balance the karma accounts lol
Duh

Post

WRT tanh, I was meaning the tanh calls on the audio path for waveshaping purposes of course, not for coefficient calculations.

You are using Juce's defaults as I suspected. I never even looked at them because in my case I limit JUCE to wrapping VST3 and do graphics, so I try to not lock me in, should I decide to drop it. "juce_recommended_lto_flags" seems good. In my case I enable thin-lto instead of full lto, nuances.

The GCC thing with the vector types is unfortunate. It has exactly the same interface/front end as clang, but vectors of all sizes count as the same type on C++. Functions can't be overloaded. They will fix this sooner or later I guess.

So there was no low hanging fruit unfortunately.
Last edited by rafa1981 on Thu Sep 09, 2021 4:48 am, edited 1 time in total.

Post

Here's something that I tested today with fresh ears:
24 dB filters make the track louder, so I tried to loudness match the best I could with 12 dB (the 12 dB needed to be boosted 0.08 dB).
Tbh I don't wanna pester you anymore about this, just try it yourself and let me know which one sounds better to you, I feel like I'm getting into a rabbit hole for no reason.

Post

Chow kick plugin is seriously awesome
Eyeball exchanging
Soul calibrating ..frequencies

Post

heavymetalmixer wrote: Wed Sep 08, 2021 8:42 pm Here's something that I tested today with fresh ears:
24 dB filters make the track louder, so I tried to loudness match the best I could with 12 dB (the 12 dB needed to be boosted 0.08 dB).
Tbh I don't wanna pester you anymore about this, just try it yourself and let me know which one sounds better to you, I feel like I'm getting into a rabbit hole for no reason.
Hmm, yeah I tried doing some A/B-ing as well. After spending way too long with it, I think whatever difference I'm hearing might be more in my own head than in the actual signal. Anyway, I decided to go back to the 24 dB/Oct filter, just to kee it the same as it was before.

Post

gentleclockdivider wrote: Wed Sep 08, 2021 9:18 pm Chow kick plugin is seriously awesome
Thanks! Glad you're liking it :).

Post

Sorry to bother but is it possible to get the latest Chow Tape version without installer?
Thanks.

Post

zeep wrote: Sun Sep 12, 2021 8:48 am Sorry to bother but is it possible to get the latest Chow Tape version without installer?
Thanks.
Sure, I can share those. Which platform(s) do you need them for? Also just curious why you prefer the raw builds without the installer?

Post

I would love to see further development of your separate Hysteresis plugin. It sounds great but the CPU is off the charts and it does crash occasionally. Any chance of optimizing that??

Post

chowdsp wrote: Sun Sep 12, 2021 9:53 pm
zeep wrote: Sun Sep 12, 2021 8:48 am Sorry to bother but is it possible to get the latest Chow Tape version without installer?
Thanks.
Sure, I can share those. Which platform(s) do you need them for? Also just curious why you prefer the raw builds without the installer?
Thanks for replying. i use Windows.
Throughout the years I've come to prefer to manually place dll's and not use an installer. Mainly to keep an eye on what goes where in my system. Some installers, and i don't mean yours, just bloat stuff everywhere and that has gotten me to a point where i just choose to place dll's (and appdata) myself.
This way i know where everything is, the Programs uninstall list stays clean etc.

Anyway, thanks again for Chow Tape!

Post

zeep wrote: Mon Sep 13, 2021 9:09 am Thanks for replying. i use Windows.
Throughout the years I've come to prefer to manually place dll's and not use an installer. Mainly to keep an eye on what goes where in my system. Some installers, and i don't mean yours, just bloat stuff everywhere and that has gotten me to a point where i just choose to place dll's (and appdata) myself.
This way i know where everything is, the Programs uninstall list stays clean etc.

Anyway, thanks again for Chow Tape!
Makes sense! I've added the Windows binaries to the GitHub release so you can download them from there. That said, one of the beauties of open-source software is that you can see exactly what the installer is doing from looking at the code. Specifically the "Files" section starting on line 24 shows which files are being placed where, along with various flags and other information. I'm certainly not an expert with Inno Setup (the language/tool used to build the Windows installer), but I can do my best to explain if anyone has questions about it.

Post

Tchad Froom wrote: Mon Sep 13, 2021 2:55 am I would love to see further development of your separate Hysteresis plugin. It sounds great but the CPU is off the charts and it does crash occasionally. Any chance of optimizing that??
I have had that in the back of my mind, but just haven't had the time to come back to it yet. There's a ton of improvements I would like to make, mostly from stuff that I learned from working on ChowTape. That said, what's currently in the hysteresis plugin is not too far from the "Tape" section of ChowTape. The main difference is just that the hysteresis equation is parameterized differently to specifically fit the case of tape magnetisation hysteresis, rather than a more general hysteresis "waveshaper". So the knob positions will be much different, but I would say that 90% of the sounds you can get with the hysteresis plugin are also possible with ChowTape :).

Post

chowdsp wrote: Mon Sep 13, 2021 4:45 pm Makes sense! I've added the Windows binaries to the GitHub release so you can download them from there. That said, one of the beauties of open-source software is that you can see exactly what the installer is doing from looking at the code. Specifically the "Files" section starting on line 24 shows which files are being placed where, along with various flags and other information. I'm certainly not an expert with Inno Setup (the language/tool used to build the Windows installer), but I can do my best to explain if anyone has questions about it.
Hi, thanks for adding the downloads and for the explanation of the install procedure. It hadn't occurred to me to look at the install script, indeed the beauty of open source. :)

Post Reply

Return to “Effects”