Disclaimer: I'm aware (now that I looked more in-depth in the automatic tree farm thread, see Stormweaver's post here:
http://sargunster.com/btwforum/viewtopi ... e5ed#p5773) that you can do this similarly using a clock, a BD-counter and a RS-NOR latch. Regardless, this way might be more compact for certain values of n. I also wanted to throw the concept out there to see if anyone thinks of something cool to do with it, or comes up with a nice generalisation or simplification.
I wanted a circuit that given an initial pulse outputs n pulses, for some value of n.
For 1 <= n <= 8, this circuit does that:
The input is behind the BD, the output is anywhere along the redstone line closest to the camera. The redstone torch is just for testing that it works by counting how many times it turns off. You have to fill the BD with n different conductive block types and one non-conductive block or entity. The number of repeaters can be changed in the obvious way. In this picture, a pulse generated by a button can be handled, with for example just 2 repeaters you have to use a shorter input pulse.
For larger values of n things become a little trickier. If you put two of the first circuit in parallell and stack one with n conductive blocks and the other with m conductive blocks (plus a non-conductive in each) the output will be lcm(n,m) - 1. Here, lcm(a,b) means the least common multiple of a and b. For example, lcm(3,5) = 15. Check
https://secure.wikimedia.org/wikipedia/ ... n_multiple if you are unfamiliar with the concept, it's pretty straightforward.
If you ignore everything to the right of and including the BD on the right in the following picture, this illustrates the circuit:
Unfortunately, this only gives you n in {9, 11, 13, 14, 15, 17, 19, 20, ...} where I didn't check higher numbers. The point is that 10, 12, 16 and 18 are not included. Of course my application needed precisely n=10. Hence the right-most part in the picture, this is simply a BD-counter loaded with 1 conductive block and k-1 non-conductive stacks.
This means that you can divide the output from the first part of the circuit by k, so for example using n = 3, m = 7 and k = 2 will give you (lcm(3,7) - 1) / 2 = 20 / 2 = 10.
Unfortunately (again!), this still does not work for 12, 16 and 18 as multiplying by 2 and adding one yields 25, 33 and 37 which are bad numbers in this case. Note that lcm(5,5) = 5 and not 25.
I haven't really tried to prove which numbers that are permissible, but using some tables it's pretty easy to check for larger numbers too.
What you can do for 12, 16, 18, etc. is the following:
The idea is that you have one slow n-pulser driving a fast m-pulser so that each pulse from the n-pulser yields m pulses from the m-pulser resulting in n*m pulses in total. I didn't fiddle around with it enough to match up the delays on them, but I think it is possible to get the output pulses evenly timed here too.
Of course, you could also use the last design for 10 output pulses instead of the parallell design. However, I still like the parallell one more for some reason, even though it takes one more BD.