Pad selectors(or "radio" selectors)

Post any examples or modules that you want to share here
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Pad selectors(or "radio" selectors)

Post by billv »

Grid 5 has been updated to v5. All major issues resolved.
Controls:
The control change worked out well Walter. It's now like i said in the last post
DRAWING
Left Mouse
If the first square you click is off, click or drag will turn all selection(s) on...
If the first square you click is on, click or drag will turn all selection(s) off...
DELETING....Mouse drag delete control fixed and is more flexible…
Left Mouse drag delete removes selections one by one as you drag over
Right Mouse drag delete is "fast deletion"
Right mouse double click still clears everything.

* The "dragging on borders turning on both sides" is fixed.(just had to tweak @gridvalue )
* VST Preset Parameter has replaced Preset String Prim so saving restrictions are gone.
* The “set” input was adjusted to preventing nil values appearing.
* Outputs are initialized after changing rows/columns
Grid_BV_RowsandColums_v5.fsm
(1.12 MiB) Downloaded 1141 times


@walter
that's about it I think..apart from "sluggish draw behaviour" with very large grids,
it seems to bug-free ATM...let me know if you need it tweaked in other ways....
Last edited by billv on Tue Dec 16, 2014 9:52 am, edited 1 time in total.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Pad selectors(or "radio" selectors)

Post by tulamide »

billv wrote:Not ignoring this....just too hard for to grasp ATM...

I created a bitmask class for you. It's straight forward. You use it like this:

Code: Select all

bm = Bitmask.new
bm.set 120
Sets the index 120 to 1 (index is zero-based)

Code: Select all

bm.unset 120
Sets index 120 to 0

Code: Select all

bm.clear
Resets the bit array to all 0's

Code: Select all

bm.get 120
Returns the current state at index 120 (either 0 or 1)

Code: Select all

statestring = bm.save
Returns a 128 byte string representing 1024 states. This can be saved via preset string.

Code: Select all

bm.load statestring
Replaces the current bitmask by the one contained in the statestring. Feed it a preset string saved earlier.

Hope it helps :)
Attachments
bitmask.fsm
(967 Bytes) Downloaded 1090 times
"There lies the dog buried" (German saying translated literally)
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Pad selectors(or "radio" selectors)

Post by billv »

Thanks tulamide. Yeh, this helps me a lot. i can see the bitmasking process clearly.
Spent a few hours trying to get a working example going, but failed due to
in-experience in dealing directly with classes. :x
It ground to a halt when i couldn't assign the string to the save/load functions... :oops:
I did a Point Class experiment a while back that was pretty detailed, so i can go back
and study that a bit and re-learn what I'm supposed to do...

I'll muck around with this for a few days....hopefully i can work it out soon...
i was planning to bring your Spline Class of a backburner and start learning it..
Should keep me busy over the festive season...thanks for the Xmas present.. :D
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: Pad selectors(or "radio" selectors)

Post by Walter Sommerfeld »

Hi billv,

If the first square you click is off, click or drag will turn all selection(s) on...
If the first square you click is on, click or drag will turn all selection(s) off...

this works perfectly now on my 10" Pad and my 23" Touchscreen Monitor :)

I have 2 thank u very very much 4 this pre XMas gift!!!

Cheers,
Walter

P.S.: Only a hint how 2 reduce that random only select maximal one or none Box/pad/button in every vertical row :?:

PPS: Ooooppss... Drag in a spiral all pads and a little bit more: Pads disappear because of excessive Processing :(
...also hi CPU while dragging (reduce trigger/redraws needed?)
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Pad selectors(or "radio" selectors)

Post by billv »

Walter Sommerfeld wrote:I have 2 thank u very very much 4 this pre XMas gift!

Your welcome..
Walter Sommerfeld wrote:how 2 reduce that random only select maximal one or none Box/pad/button in every vertical row :?:

Here's one way....
EG: say you have a grid 4x4
You could split the rand array into 4 arrays containing the grid index numbers
[0,1,2,3],{4,5,6,7],[8,9,10,11],[12,13,14,15]
Get a rand number from each array, stick it another array and send it..
Walter Sommerfeld wrote:PPS: Ooooppss... Drag in a spiral all pads and a little bit more: Pads disappear because of excessive Processing :(
...also hi CPU while dragging (reduce trigger/redraws needed?)

Yeh it dosn't like it if you keep dragging for long time....Tried it a few times
and the damn thing just turns to candy.
Looks like I've built another 'lemon'.. :roll:
Back to the drawing board I guess...
Sorry Walter
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Pad selectors(or "radio" selectors)

Post by tulamide »

billv wrote:It ground to a halt when i couldn't assign the string to the save/load functions... :oops:

It might not be you, but rather myself :oops: Without having tested, I think the following is the issue:
VST preset strings are simple C-Strings, that is, a maximum of 255 chars plus a null byte. The null byte serves as a stop marker, the string is supposed to end when the null byte appears. A null byte is simply a byte whose 8 bits are all set to 0
Now, with the string that bitmask returns you get a bunch of set or not set bits. If for example the first 8 states are all unset, you effectively have a null byte and the string is assumed to end there, resulting in an empty string.

I will test this. If it is the reason, I can work around the issue by setting 1 of each 8 bits of all array cells to 1. That would mean, VST will at least get a series of &b00000001 &b00000001 etc. and therefore won't terminate before the end of the string. It would also mean that we lose 128 bits in total, so only 896 states instead of 1024, but that's ok. I just extend the array to 148 bytes, resulting in a total of 1036 managable states - it doesn't matter much, since we're still far away from the maximum of 255 allowed bytes.
"There lies the dog buried" (German saying translated literally)
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Pad selectors(or "radio" selectors)

Post by billv »

tulamide wrote:I will test this.

Great. Bear in mind I never work directly with bits/bytes/binary, won't be easy for me.
As an example, Your "i will test this" statement, made sense..the rest of your post has
honestly gone in one in ear and out the other. :lol: I will be a hard student. Be prepared.

Grid Updated to v6
* Accurate Mouse capture code removed
* Code order adjusted
* Optional Green outs added (with changed prims)
Grid_BV_RowsandColums_v6.fsm
(1.1 MiB) Downloaded 1113 times

So in other words, Mouse drag acuracy now is defined by how big your grid is,
what size you re-size the module...and the speed you choose to drag at...

@walter..
I can't repeat the last bug...please bash this version around your room so we find some more.. ;)
Monumentov
Posts: 1
Joined: Sun Dec 14, 2014 6:10 pm
Location: Russia
Contact:

Re:

Post by Monumentov »

Текст перспективный, помещу сайт в избранное.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Pad selectors(or "radio" selectors)

Post by billv »

@ tulamide. ..
got a few hours bit masking in before night ended...did manage
to save at 2 different indexes and output result...so I
just have to work out to load at index, and then start
building a array module with it all...
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Pad selectors(or "radio" selectors)

Post by tulamide »

billv wrote:@ tulamide. ..
got a few hours bit masking in before night ended...did manage
to save at 2 different indexes and output result...so I
just have to work out to load at index, and then start
building a array module with it all...

Great! But don't rely on it yet. If you can set the indices 0, 8, 16, 24, 32, 64, etc., save them and load them back correctly, only then you should rely on it. Currently it isn't possible I'm afraid.
"There lies the dog buried" (German saying translated literally)
Post Reply