Venom v2.6 released

Thankfully my plugin is not crashing anything (at least to my knowledge). I just experienced some NaN outputs that could only be fixed by relaunching the patch. I thought I knew what module within which patch was generating NaN, but now I am not sure - I cannot reproduce the behaviour.

1 Like

it seems to me it happens when you patch pwm to chaos. these settings consistently kill the module for me

1 Like

Chaos is a switch that changes the feedback path of the shift register right? I can imagine that flipping this switch at audio rates (pwm can go really high) might cause glitches and freaking out the shift register at bestā€¦

1 Like

Congrats on this release! Also thanks for introducing me to the world of benjolins :robot:

1 Like

Thanks! I got excited because that is something I had never tested, so I thought maybe I would get lucky and be able to reproduce the problem. But I just tested on Windows and ARM Mac (both x64 and ARM versions), and could not trigger any problem. All manner of weird sounds, but no freeze. So maybe the problem is specific to the Intel Mac, which I donā€™t have access to :frowning:

I will take a look at the code involving the Chaos switch, see if I can spot anything suspicious.

1 Like

We like all manner of weird sounds :slight_smile:

There is a good chance I have fixed the problem, but hard to be sure. I too was able to sporadically get loss of output. Looking at the code I noticed that I was supposed to be limiting the minimum frequency to ~0.03 Hz. I did the computation, but forgot to set the variable - Ugh! More importantly I think, I was not constraining the upper frequency. In some development code I clamp the frequency to ~0.03 Hz - ~12.5 kHz, and so far it is behaving better.

This fix will be in the next release, but I have no idea when that will be.

1 Like

I tried using your S&H, but I think it consumes a bit too much CPU. I am not sure why it is using so much to just hold a fixed output voltage.

Also, Iā€™m a bit perplexed by the oversampling option, Iā€™m not sure what it does in the context of a sample and hold besides make my computer go whirr when I turn it on! Iā€™m only at 96khz btw.

Edit: AH ha, I see your stepped sines YT video. Okay, this is meant to turn S&H into audio waves. Actually it was working absolutely terrible as a S&H and I thought I was going bonkers. I tried to use it like a normal S&H, and with oversampling it was causing all sorts of strange stuff to happen in my patch!

1 Like

Yeah, of all my modules, this module has the most disappointing CPU usage. I had a grandiose vision of an Ć¼ber flexible module, and the many interacting options complicated the code, making it hard to optimize for simple use cases.

Considering all that it is doing, performance really is not too bad, especially if oversampling is disabled. But for the simplest use cases, it is a CPU pig.

Definitely do not engage oversampling unless it is needed, and always use the minimal oversampling that gives satisfactory results.

I may create a simple S&H without any ASR to provide the option for oversampled S&H with much better performance. The performance without oversampling should then be much more in line with other S&H modules.

2 Likes

I have to say that when I heard the S&H sines demo I was quite impressed by the sound. Itā€™s very cool!!! Great sound. But also, not what I had in mind when I grabbed for a S&H module.

Using the oversampling for any v/oct input leads to some quite strange sounds, and I thought it was a problem with my transients or something at first. It modulates pitch at a very high frequency at the start of the note due to the anti-aliasing and those ā€˜hornsā€™ or whatchamacallems that get added on the sharp transients. It would be nice to have a CV/audio switch that engaged the oversampling for audio but was flat DC-coupled for CV.

With the oversampling turned off it should behave just like the normal VCV one I guess, but instead itā€™s taking 12x more CPU by comparison. Is it doing everything in poly all the time? Or some other funny glitch like that?

Engaging 32x oversampling made it take 75% CPU, so the CPU cost doesnā€™t scale linearly with oversampling which makes me think there might be a bug.

Oversampling is off by default, and is only enabled by a switch. I donā€™t understand what more you want. If you are working with ā€œCVā€, then simply donā€™t engage oversampling.

I will look into this later today.

It is much more than a simple S&H because it is also an analog shift register, and it has full polyphony support. Triggers and sampled values are propagated down, which leads to a lot more processing. Even if polyphony is not being used, there is significantly more code in place to handle the polyphony when present, which does add some extra overhead. This overhead is compounded by the shift register functionality.

Oversampling is off by default, and is only enabled by a switch. I donā€™t understand what more you want. If you are working with ā€œCVā€, then simply donā€™t engage oversampling.

What I meant to say is that I had no clue this module was intended to be used for processing square-ish waves into audio. So thatā€™s a really great feature thatā€™s not at all apparent from the design. What I meant by CV/audio switch is to somehow indicate that the oversampling is to make it into a waveshaper instead of CV processor.

It is much more than a simple S&H because it is also an analog shift register, and it has full polyphony support.

Yes, I was comparing to the VCV ASR module, which is sadly not poly.

I noticed that when I patch one output or all the outputs the cost doesnā€™t change at all. This means the module is processing all channels of the ASR (maybe even in poly?) all the time? And if only mono inputs are patched, does it still have to process everything in full poly?

I think you could shave potentially a lot of compute if you use if(outputs[OUT1 + i].isConnected) to decide which/how many outputs of the ASR are needed to process. If Out2 is the deepest output, then ā€˜returnā€™ out of your loop at that point and output 0V to all the other outs.

Have you read the documentation?


It may help to patch up from the bottom.


Yes, I thought the same. But I have spent considerable time looking for optimizations, and I have failed to find anything major. Bruce @Squinky has also looked through the code, and could not find anything significant. I feel propagation should happen, even if nothing is patched below, just in case a lower output is later patched.

I am sure the already complex code could be made even more complex to reduce CPU usage maybe by up to 30%. That level of optimization does not interest me. But I think cutting CPU usage in half or better would be extremely difficult without completely re-architecting the implementation. I am thinking the easiest thing would be to write four completely different implementations, one for no poly or oversampling, one for only poly, one for only oversampling, and one for both. The module could then switch implementation depending on chosen options. But I am loathe to do that - I prefer to share code as much as possible.

For me the way forward is to create a new simple S&H module with oversampling options. I am pretty confident that will perform well with oversampling off.

Okay, I confess I did NOT read the documentation. It looked like a simple utility and I had some preconceptions about what the inputs/outputs should do. I just patched it up like it was the same as the VCV ASR, since it looks the sameā€¦ but itā€™s actually a totally different beast indeed! I expect anyone that didnā€™t read the manual might do similar.

I feel propagation should happen, even if nothing is patched below, just in case a lower output is later patched.

Fair enough, I guess that makes sense. I didnā€™t think to patch from the bottom, so thatā€™s my bad! It feels more intuitive to patch from the top.

I agree the code looks very complex, so maybe itā€™s not possible to squeeze more out of it. I spent a lot of time trying to buy gains in my own modules only to get like 0.1% improvementā€¦ and yes at the cost of even more complex code. So I feel you! I didnā€™t mean to ruffle your feathers :slight_smile: Honestly, Iā€™m super impressed by your modules.

If I were to suggest something. Make a stand alone oscillator out of this idea!!! Build in the LFO that triggers the S&H, and then have only 2 outputs for stereo. You could switch between internal waveforms or an external input. With only 2 channels you could oversample it higher without eating up the whole CPU. The demo sounds super sweet, that sound could just be built-in to a module.

1 Like

Thanks! No feathers ruffled here - certainly not at a personal level. If anything I get frustrated with general human behavior - I wish more people read documentation. But getting upset over something like that is counter productive. And if people like you were not asking questions then that would probably mean people were not interested in my modules!

Oooh - Good idea!

I am already hard at work on my first dedicated VCO module - it is a beast! It only employs classic VCO concepts (plus polyphony), but attempts to bring everything under one roof in a way that I have not been able to find elsewhere.

After that I also want to produce a 4 operator FM VCO, something similar to Dexter, but without wavetables, and fewer options, and hopefully much better performance. But your idea may jump the line.

9 Likes