Nothing complicated about that - it is intuitive, compact, and kind to the CPU. I would be inclined to use AO-106 instead so as to use a single module and eliminate additional sample delays. But that does take more space.
Note that if your patch happens to have a constant 10V CV source available, then you can eliminate the last step by patching 10V into step 2 Y and changing the formula to “if X>C → Y/0”
Note also that of the patches given so far, yours is one of the few that gives the precise solution to your stated goal, though the difference is likely insignificant.
The Bogaudio window comparator solution outputs 10V if input is >= 1.23 and <= 4.56. The documentation is precise regarding that.
The Count Modula dual Comparator with AND gate solution outputs 10V if the input is > 1.23 and <= 4.56. @CountModula: The documentation should probably be changed to explicitly state that Under means the input is <= the threshold, whereas Over means it is > the threshold.
I much prefer your solution, as it is done in one module, so there are no extra sample delays.
Also entering the computed value is trivial given that you can enter the formulas directly into the parameter: (1.23+4.56)/2 for the mean and (4.56-1.23)/2 for the window.
But as I noted above, it is slightly different than the given requirement. To get the precise solution requires two CMP modules and an AND gate.
- CMP 1: A set to 1.23, B to 0, and signal to B
- CMP 2: A set to 0, B to 4.56, and signal to A
- AND the A<B outputs of both
I really like the flexibility that the Bogaudio CMP module offers by providing inputs and constant CV for both A and B.
To get the precise solution using Count Modula COMPARATOR requires a source of constant voltage of 4.56 patched to the input of the 2nd COMPARATOR, the signal patched to the threshold, and use the OVER output of both comparators as your AND inputs.
This is the other solution that gives the precise solution.
You can just as easily get the same result with the relatively new docB Formula One, and it is much kinder to the CPU - nearly a factor of 10 difference in this case. In general I am hard pressed to find an application where I prefer Formula over Formula One. Besides better performance, Formula One has more inputs, more controls, and especially important to me - two extra outputs.