# How to build a self gating randomizer?

Member Posts: 92 Helper

I need to build a self gating randomizer?

Here is an example of what I need.

The randomizer is being driven by an iterator

The randomizer outputs a 2, then it waits for 2 steps from the iterator before it outputs it's next value.

I need to do some kind of compare between the iterator and itself + the random value so I can filter out 2 iterator steps and trigger a new random of the third.

How could I make a randomizer that waits a certain number of iteration steps before it triggers a new value?

• Member Posts: 1,328 Expert
edited January 2022

I need to build a self gating randomizer?

Michael, in MRC I use Sharl with a NOT logic from a seq clock.

How could I make a randomizer that waits a certain number of iteration steps before it triggers a new value?

Driven by the same procedere as above. Send the event to the randomizer.

• Member Posts: 92 Helper

I looked into your midi instrument, but I didn't fully understand what the not module was doing, could you explain this to me?

maybe a chain of iterators

• Member Posts: 752 Guru

Simple way to solve your example would be to have a countdown counter, and use the random value to set the counter... so if the random value is 3, then the counter is set to 3, and counts down 1 per tick. When it hits zero, it triggers the random generator again for another value

• Member Posts: 1,328 Expert

Michael, Sharl is driving by a seq clock with random 2 directions.

Sharl (Change after response logic zero = Charlz, renamed by Catman Dude to Sharl) gives out an event if logic zero is passed.

You can send like me this event to a random trigger or use it direct.

• Member Posts: 92 Helper

I tried this exact approach but it had some massive issues, maybe I need to revisit this method.

• Member Posts: 752 Guru
• Member Posts: 92 Helper
edited January 2022

It's turning out like this...

Here is the structure.

Here are the output values.

Top row is the iteration count, second row is the random output numbers, third row is the countdown numbers.

If it were counting down properly then the bottom row should be outputting 2-1-0, 2-1-0, 3-2-1-0, 1-0.

The second row should have output a 2 at the start, a new number in the third space if it had reached zero properly and so on, but it only output the 4 in space 6

The duplicate 1's in the second and third place are an error, and the 2 to 3 in 4th and 5th place are an error, the 3 to 0 in spaces 5 & 6 and the double 3's in spaces 7 & 8 as well as the three 1's in a row and the 2 coming after a 1 are all errors.

Any ideas on this?

Thanks.

• Member Posts: 752 Guru

Don't like those orange wires

• Member Posts: 752 Guru

Something like this?

The plus 1 and the init to 1 are because this simple version only checks for ==0, so if it gets negative, it goes forever (until a 32bit in wrap anyway)... would be easy to do a more complex version where it only counts down when positive.

• Member Posts: 92 Helper

This is doing the trick, I always overlook the read and write modules unless I'm doing wavetable data memory types of stuff, can't see the forrest through the trees sometimes.

Thanks a ton.