Adding up key strokes (overlapping events)
-
I'm attempting to connect a DMX light to my keyboard, so every time a certain key is pressed, a Gaussian intensity curve is calculated.
Doing this once a time is easy (resetting a pulse, ADSR module, etc.) but if I press the key again, the curve resets instead of adding a new intensity curve on top of the one that was being processed.
Is there a way to process the same key stroke event to overlap (sum) the values of the repetitions?
I have been trying with the JavaScript actor, but not succeeding.
Thanks!
-
i made a simple solution that works if you have a limited number of keystrokes. this version is for 4 keystrokes within the timeframe of the envelope, but it can be scaled up by adding more components. (i didn't add a way to prevent re-triggering the envelopes while they are running, but this is also possible using the End Trigger or the Output and a Comparator feeding a Gate)
-
@zentinel said:
Is there a way to process the same key stroke event to overlap (sum) the values of the repetitions?
Not entirely sure what you are asking, but you can set the 'direction' input of the Keyboard Watcher actor to 'up' (the default is 'down').
I also have a couple User Actor for this: keyboard-watcher-up-down.iua3 and keyboard-watcher-up-down-2.0.iua3
Not sure if it'd be helpful to you at all, but there's also an Actor called Decay Generator that might be interesting for you in terms of controlling lighting intensity smoothly: https://recordit.co/qXVx2arDjL
Here's a simple file for that: decay-generator.izz
Again, not sure if this is at all helpful but here's a way to count the number of triggers that have been generated while the key is being held down, but only send the count of the triggers after the key is released: https://recordit.co/HWr9IUj80Q
Here's the Isadora file for that: actors-keyboard-watcher-up-down-2023-09-11-3.2.6.izz
-
Thanks for such quick answers!
The key point is not to dim the light every time the key is pressed, but to sum the intensity curves so it lights smoothly up and down.
Here is my solution so far:
It is not optimal, as it cannot accept more than a closed number of concurrent key presses, but I will pray for people not to smash the button at 9000bpm :)
-
@zentinel said:
The key point is not to dim the light every time the key is pressed, but to sum the intensity curves so it lights smoothly up and down.
@woland said:
Not sure if it'd be helpful to you at all, but there's also an Actor called Decay Generator that might be interesting for you in terms of controlling lighting intensity smoothly: https://recordit.co/qXVx2arDjL Here's a simple file for that: decay-generator.izz
In case you missed my edit where I added this, I wanted to draw your attention to it because it might be helpful.
-
You can also throw a Multi Blocker actor in after the Keyboard Watcher actor to limit them to X triggers a second.
-
@zentinel said:
Here is my solution so far:
Here's a slight improvement to your system (check the second Scene of this file: actors-keyboard-watcher-up-down-2023-09-11-3.2.6.izz)
*multiply not divide
-
@woland Uops, I missed the last part.
Indeed I considered de Decay Generator first, but as I would like to control the wave, I discarded it. So far is using a Gaussian bell, but I will look to make it a bit more complex, such as ADSR.
Thank you very much for the last example, it is quite enlightening!
-
What I personally do is make an 'energy' based system; basically based on the amount of triggers / or continues triggers I add energy to a pool which is then converted to a number value, which can then be sent to a DMX light for example.
The energy decays over time until it hits 0
-
@zentinel said:
ADSR
This may be relevant: https://community.troikatronix.com/topic/5888/new-user-actor-adsr-actor/15?_=1694431990138
And here's the Add-Ons Page link for @DusX 's User Actor: https://troikatronix.com/add-ons/dx-value-decay/
-
@woland said:
Here's a slight improvement to your system (check the second Scene of this file: actors-keyboard-watcher-up-down-2023-09-11-3.2.6.izz)
Whoops I attached the wrong file before. Here's the right one: actors-keyboard-watcher-up-down-v2-2023-09-11-3.2.6.izz