Previous topicNext topic

Creating A Global To Send To The "Hold"

Questions, comments, feedback, etc.
Post Reply
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Creating A Global To Send To The "Hold"

Post by LexD »

Hi, I'm a new user having tons of fun with Magic.

I'm using several "InputSelectors" (all with a different number of inputs) and I'd like to send them a global "Hold" so they all switch at the same hold times. Is this possible to do? If so, how? Thanks in advance.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

You can use MIDI or OSC to control one or more parameters.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

If you're not using MIDI or OSC, the answer would be no?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

Correct.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Thanks. Feature request? :)
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Creating A Global To Send To The "Hold"

Post by Sadler »

Perhaps I have misinterpreted you question (as I am wont to do on occasion) but does this help?
linked_input_selectors.magic
(2.07 KiB) Downloaded 321 times
If not, perhaps describe further what your trying to achieve.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Sadler wrote:Perhaps I have misinterpreted you question (as I am wont to do on occasion) but does this help?
linked_input_selectors.magic
If not, perhaps describe further what your trying to achieve.

Sorry, I missed your reply. I'm trying to send a global value to the "Hold" parameter of multiple InputSelector modules across multiple scenes. That way they will all switch inputs at the same intervals. I would like to do this with MIDI, and without MIDI.

I attempted this as a global variable without luck.

When using MIDI, it appears MIDI does not get sent to a scene unless it is the active scene in the playlist? Am I mistaken?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

What exactly are you trying to do? I'm not sure why you would want to use a Hold modifier with the InputSelector, but maybe I'm not understanding.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Eric wrote:What exactly are you trying to do? I'm not sure why you would want to use a Hold modifier with the InputSelector, but maybe I'm not understanding.
I'm new to this so I could be doing this wrong, but...
Screen Shot 2020-05-06 at 3.20.47 PM.png
Screen Shot 2020-05-06 at 3.20.47 PM.png (109.23 KiB) Viewed 10047 times
I have multiple InputSelectors throughout different scenes. I'm using the "Hold" expression to as a timer to randomly trigger effects. I would like all of these InputSelectors to work in sequence. So I'm attempting to sync them all using either a global or a MIDI control.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

To randomly trigger something, use the modifier called Random Trigger ;).

Hold is overkill and not really meant for what you're doing. Hold is meant to preserve an incoming value from a source, not a value you generate with a modifier.

A better way to do things based on a timer is to use a Ramp or Increase modifier. With a parameter value of 1.0, these modifiers take exactly 1 second to reach the value 1.0. With a parameter value of 0.1, they take exactly 10 seconds to reach 1.0. And so on.

To synchronize multiple modules, definitely use the Ramp or Increase in a Global parameter and have all the modules link to that Global. You never want to have separate timers in separate modules. Even if they have the same settings, they can get desynchronized, even if only by milliseconds.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

I will try that. Thanks!
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Eric wrote:To randomly trigger something, use the modifier called Random Trigger ;).

Hold is overkill and not really meant for what you're doing. Hold is meant to preserve an incoming value from a source, not a value you generate with a modifier.

A better way to do things based on a timer is to use a Ramp or Increase modifier. With a parameter value of 1.0, these modifiers take exactly 1 second to reach the value 1.0. With a parameter value of 0.1, they take exactly 10 seconds to reach 1.0. And so on.

To synchronize multiple modules, definitely use the Ramp or Increase in a Global parameter and have all the modules link to that Global. You never want to have separate timers in separate modules. Even if they have the same settings, they can get desynchronized, even if only by milliseconds.
I'm still not getting it to work and I haven't gotten to the global yet.

I've got an InputSelector with 3 inputs.

I want it to randomly pick an input every 3 seconds. What is the proper way to script that? And then, how do I give it a global to replace that 3 seconds with a global value?
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Eric wrote:To randomly trigger something, use the modifier called Random Trigger ;).

Hold is overkill and not really meant for what you're doing. Hold is meant to preserve an incoming value from a source, not a value you generate with a modifier.

A better way to do things based on a timer is to use a Ramp or Increase modifier. With a parameter value of 1.0, these modifiers take exactly 1 second to reach the value 1.0. With a parameter value of 0.1, they take exactly 10 seconds to reach 1.0. And so on.

To synchronize multiple modules, definitely use the Ramp or Increase in a Global parameter and have all the modules link to that Global. You never want to have separate timers in separate modules. Even if they have the same settings, they can get desynchronized, even if only by milliseconds.
With a bit of trial and error, I came up with this. By increasing the Ramp value, it speeds up, and vice versa. Am I on the right track?
Screen Shot 2020-05-06 at 8.15.23 PM.png
Screen Shot 2020-05-06 at 8.15.23 PM.png (118.78 KiB) Viewed 10030 times
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

Yup!
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Eric wrote:Yup!
Great. Thanks!
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

I want it to randomly pick an input every 3 seconds. What is the proper way to script that? And then, how do I give it a global to replace that 3 seconds with a global value?
Sorry, I didn't see that earlier post.

To create a timer of x seconds, you use a Ramp with parameter 1/x. So, for 3 seconds, you would use .333.

To use this timer to control all modules, you simply create a Global with a Ramp modifier, then link to that Global in all your modules.

To make it easy for yourself to change the timer in the future, have a separate Global that is the timer duration, and link to it from your timer. You can then have the Ramp parameter be 0, and it will accept the 1/x as the parameter from the Expression module.

Put it all together, it looks like this:
Capture.PNG
Capture.PNG (15.48 KiB) Viewed 10012 times
I'm feeling generous this morning ;), so to give you some futher help, you would proceed like this:
Capture2.PNG
Capture2.PNG (18.12 KiB) Viewed 10012 times
With the Scale value being the number of inputs to your InputSelector.

Now to go back and use a MIDI command instead of a Ramp timer, do this:
Capture3.PNG
Capture3.PNG (29.46 KiB) Viewed 10012 times
The key thing being that I didn't change the modules -- only the globals. So you can see if you have 20 modules that link to the same global, it makes your life 20 times easier.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Thanks so much. I know your time is valuable. Going to play around with this tonight!
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

I was able to successfully get this to work... up until the MIDI. The moment I select MIDI to control the global it immediately freezes every time. Any ideas? Happens no matter what I try to do every time I select MIDI.
Screen Shot 2020-05-13 at 2.25.39 PM.png
Screen Shot 2020-05-13 at 2.25.39 PM.png (181.78 KiB) Viewed 9793 times
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

Use MIDI for the Timer, not the TimerDuration. See my last screenshot above.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Now I'm confused. :) If I am changing the value of the TimerDuration to set how many seconds everything holds for, don't I want to map that to a MIDI device to change that value via MIDI controller?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

Yes, you can do that too. I thought you wanted to use the MIDI command as a trigger to go to the next random value.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

Ok. That makes sense. :)

The app keeps freezing when trying to assign MIDI with the global variables that I've setup. Trying to isolate exactly what's happening and come up with something duplicatable to post on the bug forum.
LexD
Posts: 20
Joined: Tue Apr 07, 2020 10:18 pm

Re: Creating A Global To Send To The "Hold"

Post by LexD »

I found out that if I enter "0" in the TimerDuration Global, it freezes the application. This is what was happening with MIDI as well as it was producing a "0" value. I've duplicated this on two separate computers. When I delete / bypass the 1/x Expression in the Timer Global, it does not freeze.


Should I report this as a bug in some particular place or is this post adequate?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Creating A Global To Send To The "Hold"

Post by Magic »

Yes, it’s a bug I suppose, but the problem is that you’re dividing by 0 (= infinity).

An easy solution is to enforce a minimum duration, let’s say 1 second, which you can achieve using Offset 1 before the Expression, or a Threshold, or other methods.
Post Reply