Home | ER-101 | ER-102 | ER-301 | Wiki | Contact

Counter Unit


So you have it working and putting out a pulse every N pulses, and the current problem is that you can’t stop it from repeating.

Thinking within the context of a custom unit here:

You could put a linear VCA between the incoming clock and the count unit, and use a copy of the count’s own output to close the VCA - shut off the incoming clock. And then use a copy of the same signal you’re sending to the reset to re-open it?

I haven’t worked this out yet and not 100% sure it can be made to work. Just thinking out loud the direction I’d start heading. Some S&H or track and hold might be needed?


My mind is melting… melting… melting… :joy:

Yeah - I totally get what you are saying and you are right, I actually thought of this because of the kinds of things we worked through with Evil Twin, but in the context of what I am doing I am already doing similar things so I am getting confused and losing track of what’s doing what. I need to stop for a while and try again tomorrow or something I think.

Perhaps the countdown unit would make a good first candidate for writing a custom Lua unit.

The more I think of it the more I really like the idea of a countdown unit, I mean it is just a delay really, but tied to a specific number of clock pulses. It could probably be done any number of ways, but I really really would like the convenience of just having an integer to change that isn’t hidden behind a lot of gains and offsets and goodness knows what other parameters that require calculations and whatnot :smiley:


That would take all the fun out of it. :upside_down_face:


Haha there is that!

Maybe I/you/we/everyone could have some fun writing the Lua instead? :joy_cat:

What do you think @odevices - how about we have a public step by step walkthrough of how to create a custom Lua file that implements the countdown unit?


God made the integers; Brian conveniently forgot them. :wink:


Seems my response got lost in the fray above, but wouldn’t the bump scanners work for this? For outputting a trigger on the nth value, stopping the incoming clock from either advancing the counter or starting over and being able to set the number of steps (would involve math for this one, but it would only be one parameter to change instead of several). Would just take some creative routing in a CU or a chain.

Forgive me if I’m wrong, but it makes sense in my head.


Apologies, thought I replied, but lookalike I didn’t, think I inadvertently edited my post while replying because of other responses and accidentally deleted the bit that responded to your suggestion.

To be honest I don’t really get it, would love to see an example when you get chance :slight_smile:


Will report back on Thursday when my new case arrives…unless it’s figured out before then :wink:


Have you checked out my Trig8 unit? Maybe that’s close to what you’re looking for?


Just use Teletype!



That took a lot longer than I expected! :laughing:


Let’s see what I can do!


I was out of town.


Here is a preset which I think demonstrates what kel may have been looking for initially:

nice-velvet.lua (18.3 KB)

The patch is a custom unit with a sine osc followed by a VCA, with a count-triggered skewed sine envelope residing in the VCA sub-chain. The count unit is followed by a rational VCA to map the count value to the range [0.0, 1.0]. If the ‘finish’ parameter of the count unit and the ‘div’ parameter of the rational VCA are set to N, then the envelope will be triggered once for every N input triggers, because count / N equals 1.0, which is greater than the threshold of the skewed sine envelope (which is 0.95 in this patch).

In this case, the count unit and the rational VCA have to agree on the value of N, which calls for adding an integer-based control. As far as I can tell, Lua scripting is the only way to achieve this, as illustrated in the source for the rational VCA:

biasMap = encoder.getMap("int[1,32]")

@odevices, how about adding some options to the custom unit controls? Like integer vs. float, min/max value, etc? It might make working with values outside of the “nominal” [-5.0, 5.0] range much easier.


the left side on this does what you want


Thanks @scttcmpbll - yes - this would kinda work for a few specific use cases. I appreciate the pointer, but I don’t think it’s suitable, I need to be able to stop it.

Also thanks @miminashi - same deal re. the stopping criteria - it seems similar to @Joe’s solution above.

Thanks everyone :smiley:

I think I am now holding out for a custom Lua file tutorial :joy:

p.s. I will try the suggested solutions later on - so thank you again - I’ll let you know how I get on.


Huge plus one for this - been thinking the very same thing for a while now!


@odevices - this is great!

I think at this point in time a tutorial / staged game of development would be a huge step forward towards getting folk writing Lua.

I wouldn’t expect the answer, more something along the lines of exploring the anatomy of a Lua file, what needs to be done, why, how it works etc…

And I for one, am fully engaged with following along and trying to work it out as we go. A kind of community driven development process of ‘this is what is needed’ to ‘this is how to do it’.

Of course whatever you decide to do is cool, this is just an idea :slight_smile:


Okay… I gave up!

Just got the last one from Control - they have a 10% discount code for yesterday through tomorrow so basically got free shipping which took the sting out of the cash drop - credit card again!! Oh well…

Someone needs to buy my Octatrack / MonoMachine / Black EIT-1 now! Yep - they are up for sale, I am moving on… :crazy_face:

edit: sorry just realised I posted 4 times in a row, I know I know… but there’s too much for one post!


Would it be possible to start from 0 ?