Hello all!
Quick one really, how can I trigger a bang each time a value of an array has been manually changed? More points if you can separately bang per index of an array.
Cheers!
Josh
How can I trigger a message when Any array value is changed
Hello all!
Quick one really, how can I trigger a bang each time a value of an array has been manually changed? More points if you can separately bang per index of an array.
Cheers!
Josh
This is what I've come up with but it's very convoluted and I don't really want a metro ticking away in the back to save CPU consumption (hence why I wanted to only trigger when something has been changed).
@Roomy This hack could be called elegant or ugly depending on ones point of view........op.zip
[once] + the delay are necessary as [r pd] receives pings when an array is being read..... as well as when being written...... which causes a message overflow without them.
You could use a spigot instead of [once]
Null points for separate bangs though.
David.
@Roomy Hmm. There is obviously a difference between windows and osx for how Pd deals with window management. That's a shame.
Here is another solution....... that also ducks the audio as the graph is redrawn and mutes any zipper noise........
op.zip
Set the duck so there is no noise but no audible dropout either.
For old versions of Pd (such as extended) [array size] will need to be changed to [arraysize].....
@Jona and I worked on a Pd plugin a while ago. It is in that zip.
It will give a message every time the mouse button is pressed or released. It will also give the position of the mouse in the window and the os window name.
That means you can filter the info and could even use it to get separate bangs per index once you have received the windowname..
The plugin must be in a path that Pd will find as it loads.
It expects an object [receive mouse_receive] and will throw errors to the terminal if it does not exist.
You can change the bindings in the plugin to get more mouse information, or less (eg just "mouseup").
The plugin can simply be moved to a folder that does not have the path set to stop it loading.
David.
If you mean by clicking or dragging on a "Put" menu array-- I believe Ico added this awhile back for pd-l2ork 1.0, and it's available in Purr Data as well:
If you have an garray named "array1", you may set a [receive array1_changed]
and it will output a bang when the array is changed with the mouse.
[r pd] receives pings
That's an interesting hack. Garray display is so inefficient that it will typically send so many bytes to the GUI that "ping" is sent to ensure the GUI is still alive.
However, GUI_BYTESPERPING is set to 1024 by default and I think small arrays will squeak underneath that limit and not trigger the ping message.
Oops! Looks like something went wrong!