# Modulator link editing edge cases

*Captain's Log: Stardate 77795.9*

When I said that I had worked through all the edge cases in my last log entry, that was... untrue. ðŸ˜„

I *thought* I had worked through them all, but later while I was testing things manually I realized that while I did provide working behaviors for all cases, some of them really weren't want you want. In particular, the way an exponential parameter should behave is quite different between additive and multiplicative modulators. For a multiplicative modulator, the neutral value should be 1 (which is the multiplicative identity), and it should always be positive, so that it can be used to modulate pitch in the spring/mass system. For an additive modulator, the neutral value should be zero (which is the additive identity), and the curve should be rotationally symmetric with an exponential shape.

Anyway, today I rigorously wrote out all the combinations of the three boolean parameters for modulator links: invert, exponential, multiply, and worked out what all of them should do, and then made them do that. So things work really well now.

Aside from that, I had forgotten about the fact that for some parameters, the modulation happens on the CPU. This includes things that don't need per-sample changes, like mallet hardness -- it latches when the mallet is struck. So CPU-modulated parameters didn't work with the new options. I've fixed this, and also added an exhaustive test that runs the CPU and GPU modulation implementations with all possible permutations of the configuration in parallel and verifies that they do the same thing. Should have done that before!

Finally, I went through today and tried the new modulator editor with every single modulatable parameter. I found a couple small bugs, but mostly things were good. Modulators are vastly more usable now.