Spread the love

This module will give you the option to count up, or down, count to a set number and stop, or a pendulum mode (count up from 1-16, then count down from 16 to 1 and so on). The number of steps in the sequence can also be set via a drop down list. At the heart of this structure is the ED DSP Counter. This module takes a train of input pulses and counts them, outputting the appropriate integer.

ED DSP Counter.

Counts the number of Boolean input impulses between 0 (included) and a specified value (positive, negative or zero to block counting) specified by the Integer at Max Plug (included).
Input (Boolean): Input pulses to be counted.
Reset: At any time a Boolean “True” sent to the Reset pin can reset the counter to zero allowing it to restart.
Mode (List): The count can proceed in several ways depending on the Mode setting:
1) Unlimited: positive if Max is >0, negative if Max <0, no count if Max = 0
2) Stop: the counter is stopped once the Max value is reached
3) Wrap: the counter is reset to zero after the Max value is reached
4)Ping-pong: (Pendulum) The count proceeds from zero to Max then back to zero, indefinitely.
Max (Integer): Sets the maximum count.
Output (Integer): Outputs the number of pulses counted as an integer.

ED DSP Integer counter module

By using this counter we have an effective way of making a step counter which can be fed by the BPM Clock4 oscillator. This allows us to have a count running from 0 through to 16 (or whatever maximum is set), in a variety of modes.

Controlling the count direction.

Going up… Going down.
The first point of note is that the vales in the Fixed Values (Int) module are a little counter intuitive, until you consider the way the DSP counter counts. They are listed below with the actual number of the steps on the Left (Name) and the corresponding integer value on the right (Value). Step 2 has the count value of 1? That’s right. It’s because we are counting from 0, but referring to 0 as step 1. The value is always one less than the step number.

Counter values

These values are output to the Switch (Many>1) so we can select the number of steps we want in our count.
The Max count on the DSP counter is self explanatory, but we do need to look at how the ED Subtract module is connected (Below).
Input 1 must be fed from the switched Integer values, and Input 2 must be fed by the DSP Counter, otherwise the up/down count values just won’t match up properly. The Switch (Many>1) allows us to switch between counting up 1->16 and down 16->1. So (ignore the blue line and plugs) out Integer count is fed to the IO Module to go to our next structure/module.