Need help with counters
  • So I'm trying to make a go-to counter that has all of these features:

    Min step - Minimum or starting step for sequence
    Max step - Maximum or ending step for sequence
    Max step (x) - Maximum number of steps
    Direction - Fades between backwards, biased random direction, and forwards
    Random - Adds random jumps into the sequence

    The way min/max step sequencers work right now is a little flawed, in the way I've designed them, in that the min step can be more than the max step, and things get screwy. I managed to create a workaround for this, but it doesn't work well when changing the minimum value while the sequence is going, especially for down counters.

    Can you take a look at this patch that I have an suggest a solution? I'm just stuck here and have been thinking about this all day but can't figure out what I'm missing. (see attached patch - descriptions inside)
  • @stschoen @robertsyrett - I feel like one of you had a counter that did most or all of these things, but I can't find it?
  • It might be worth revisiting and refining into the uModular format.
  • Since you want a counter that goes up or down, why does the starting step have to be smaller than the ending step? What should happen if you are at the Min step and the direction is backwards or at the Max and the direction is forwards? What happens when the maximum number of steps is reached?
  • @stschoen - When the sequencer goes forwards, the Min step is start and the Max step is end; when backwards, Max step is start, Min step is end. Perhaps the answer lies in using one up counter, but using a switch to reference the knobs in a different way with different Mux node arrangements? Like when it goes "down," the counter is still counting up, but the down is using a different Mux node with the knobs wired backwards. This would be CPU efficient, but would lack the back and forth fight of directionality.
  • Since the direction is chosen at random if the knob is not at 1 or 0 you don't know in advance which way the counter is going to step. if the counter is at min, and the random direction chosen is backward should it go to max or remain at min? Should it always start at min or some random value between min and max? What is the maximum number of steps used for?
  • "if the counter is at min, and the random direction chosen is backward should it go to max or remain at min?"

    It should go to max.

    "Should it always start at min or some random value between min and max?"

    Start at min.

    "What is the maximum number of steps used for?"

    The number to count up to, so if you have a 4 step sequencer, it would count to 3 from 0, then restart at 0 and keep counting.
  • Here is a slimmed down version of my old complex counter. This was adapted from the library ^v Counter in the Module Library with a general overhaul to reduce the number of expressions and a few major tweaks. I made the reset trigger dominant with a timer node and I retooled the reset into a jump trigger with a crossfade node. I also added an input for a jump value, which can be a reset.

    Creating a min value and random jump can be achieved by controlling the inputs for the maxi and jump values with switches or whatever is appropriate for the context.

    I would love for @stschoen to take a look at this for cpu optimization. :)
    RHS Jump Counter 2018.audulus
    Screen Shot 2018-02-28 at 4.24.03 PM.png
    747 x 510 - 57K
  • This should be close. Counter takes a start and end value. Start can be higher or lower than end. Direction and random are 0-1 inputs. Counter wraps around from end to start or start to end. Step increments the counter.
  • I amended my copy with the reset dominant jump feature. This should be fun to build a sequencer with. Thanks again!

    Edit I made a double Tiltatron Sequencer just for grins.
    multicounter with jump.audulus
    Multicounter Test.audulus
    Screen Shot 2018-03-01 at 1.37.45 AM.png
    685 x 706 - 147K
  • Funny, I realized last night that I had omitted a reset. Here's one that uses a resettable S&H. when you reset the counter it goes back to the start value. Love the double tiltatron sequencer. I added a couple of LFOs modulating the phase and shape on the tiltatrons and you can get some interesting evolving patterns. If you want to add a reset just replace the S&H node with the resettable one in this counter.
    multicounter V2.audulus
    Multicounter Test with LFOs.audulus
    Screen Shot 2018-03-01 at 8.38.18 AM.png
    2482 x 2304 - 693K
  • If there is nothing plugged into the jump function, it defaults to jumping to the start value thereby doubling as a reset. But it's pretty useful to have a dedicated reset :)
  • The resettable S&H grew out of our quest for a reliable reset. I should really use it as the default but sometimes I forget it's there.