Make a drum sequence more sparse
Hi,
I have a Matrixctrl object I am using to program beats into a drum sequencer. I want to make the beats sparser in a randomized way. If I want to randomly change the value of a coordinate, whose value is 1, and make that coordinate have a 0 value what objects should I look at? I know how to pick a random coordinate and make it's value 0, but what I want to do is only pick from the possible filled in coordinates as a choice.
The only way I can think to do this is to take all the rows (or columns) and look at their data. If a row has a 1, then I should add it to a group with all the other rows with a 1. Then I should find out where the 1's are in the rows, randomly pick one and replace it with a 0. Then I should input all the row information back into the sequencer.
It seems like way too many steps. Can anyone think of an easier route before I go crazy with this idea?
thanks, Nick
gate should be the way...
Ok I started putting something together. It seems like way too much for what I'm trying to do, which is randomly remove a filled in cell. If someone could look at it I would be grateful. I have it so if you fill in a matrixctrl it can (sort of) tell you which rows have filled in cells. This feature is not 100%, but sort of works. Now I need some suggestions as to how to separate the 0s and 1s, and what's a good way to remove a 1 randomly.
Thank you, Nick
I'd recommend looking at live.grid in matrix mode instead, since it offers more functionality for this type of application.
If the size of your matrix is fixed, you can represent cells as row + (rowcount * column)
Store non-zero cell values into a coll (maybe itable; forget what the max number of entries is)
Either way, from there it's just a matter of randomly choosing a key and then zeroing it out.
Peter,
Thanks for informing me about live.grid. I had no idea that object existed. It seems really useful for what i'm doing. I might not be able to figure out what I'm trying to do, but i think I might figure out a bunch of way more interesting things with that object.
Nick