I made a small edit, so that it can make sense of floats/negatives/empty cells in the setUpGadgets table. Before, using isdigit(), any cell with a ‘-’ or ‘.’ in it’s value would fail to be written as a float, or passed over altogether by the replicator, so only positive integers worked for range, default, etc.
In ‘…/controlPanel/repScriptSlider’ and ‘…/controlPanel/sourceGadgets/slider/datexec1’ I swapped the: if value.isdigit():
value = float(value)
value = somethingelse for: try:
value = float(value)
value = somethingelse
Also there same thing is happening next door to the buttons, and the default ‘-1’ is being written to the Attr as a str. Does default do anything for the buttons? ControlPanelWithPresets.25.toe (35.6 KB)
Yeah I found that bug a while back as well. Forgot to update the online version. I have a function that I use in a bunch of places called setToType that I put in there. It takes care of all data types.
I can’t remember for sure but I think the -1 is in the button so it when it is in exclusive mode then all buttons are off.
I’ve also found some other problems when updating the master createGadgets table that have also been fixed. When I have some time in the near future I’ll make sure the new one is working properly and post it.
came up here to this fantastic tool, thanks Keithlostracco,
I’m messing around trying to control externally the preset radio button but when going inside the object I can’t see any CHOP, just DATs and can’t figure out how to control it from for example an external MIDI device or just from a Constant CHOP,
would be super useful!
The re-call is happening here in /project1/sliderBank/presets. Recalling a preset happens when you left click on a button. This runs a script in /project1/sliderBank. Left click calls the text DAT called recallPreset, right clicking calls the text DAT called storePreset.
'This takes an arg that’s the cell over id + 1. You can call this same script like this:
I’m pretty stuck with that,
I’ve created my constant1 Chop with just one channel to control recallVal,
I’ve created my text DAT with the following script inside
everything works by entering a specific number after recallVal and ctlr+r,
but nothing happens when I hit ctrl+r to run the script with the
op TD module instead of the number,
I see two issues in this example that I think should help you resolve the issue:
The first to consider is that 0 is not a valid entry - if you look at the storage keys you’ll see that the presets all start at 1 - preset1, preset2, etc.
Looking closely at the recall script we can see that we’re joining the word “preset” with an integer in order to reconstruct the string that we’re using as a key.
The second, and probably more important thing to know / think about, is that chops are floats. So while it may look like an integer to you, under the hood it’s evaluated as a a float… so 1 becomes 1.0. Subsequently you end up with a key that’s preset1.0, which doesn’t have a match in the dictionary.
If you cast your chop channel to an integer first, it looks like things all work as expected: