Start timer of another script (MidiProcessor)
-
Hello to all,
does anyone know how to start the timer of another script? So
Synth.startTimer
only for another script...Thanks a lot
Oli -
@Oli-Ullmann Under what circumstance do you want it to start?
-
@d-healey
When I hover over a component, the timer should stop. As soon as I leave the component again with my mouse, the timer should start again.Everything works in the same script. I have solved this with a broadcaster.
But I want to outsource the realtime functionality to another script so that the UI stuff doesn't run in the realtime script.
One possible solution would be to set a variable and use it in the timer callback of script 2 itself:
if(script1.variable == 1) { Do something } else { Do nothing }
But I also don't know how to access variables from another script. Do you know that?
-
@Oli-Ullmann said in Start timer of another script (MidiProcessor):
the realtime functionality
If it's triggered by hovering with the mouse then it's not realtime. Realtime events are things like the MIDI callbacks. What is happening within the timer?
@Oli-Ullmann said in Start timer of another script (MidiProcessor):
But I also don't know how to access variables from another script. Do you know that?
You can't. But you can access UI components in other script processors, same as accessing any attribute in the built in modules.
-
@d-healey
I am currently creating an EQ that is modulatable. I'll post the snippet later today. Then you'll see what I'm doing there... :-)All right, I had also considered realizing the data communication via a UI element, but would have found it nicer to simply use a variable. But then I'll solve it this way.
Thanks to you, David! :-)
-
@Oli-Ullmann said in Start timer of another script (MidiProcessor):
I'll post the snippet later today. Then you'll see what I'm doing there
Sounds interesting, look forward to seeing it :D
-
@d-healey
I'm sure you'll have one or two ideas for improving the code! -
-