Problem with % Modulo object in sequencer (patch)
Dear community,
I have been trying hard to build a feature to my sequencer but I'm stuck with a problem. I try to be very clear what I'm after so I don't waste too much of your time.
I trying to build a "interval-gate" to my sequencer. I figured out that utter randomness doesn't sound always very musical so I'm trying an approach of turning steps on and of in intervalls.
Gate is supposed to open and close depending how many times the sequencer patter has played restricting or passing a bang thru. There are two numbers that are determining when the gate should be open.
I give an example: a 1/2 value would (supposedly if I got it working) mean that the gate is open on the first loop of the pattern, then second is closed and the third is open again. 1/4 would mean open the first time, closed 3-4 and then loop as usual. 2/2 would mean that gate closed on the first run but open on the second. 10/16 would mean first nine loops gate closed, 10th would be open and 11-16th would be closed again.
If figured that a possible solution could be found from "% modulo" object but I can't for the life of me figure out just how.
My code is attached below. I thank you for any possible help.
P.
let me know if this helps:
Hello and thank you very much for your reply.
I investigated your patch but alas it did not lead into solving the problem.
The solution I'm looking on my original patch is of DYNAMIC nature.
The principle how my patch should work:
1) load step information to "buffer"
2) look at the interval-gate value of the particular step
4) compare the step inteval-gate values and compare them to the global pattern loop count to see if the window gate should be open or closed
5) open or close the gate accordingly and bang
6) load next step ...
I think the modulo % object is the key ... I tried to make it calculate the relative position of playback dynamically but had problems coming out as 0 all the time ?!?
Any help dearly appreciated,
Peter