Previous topicNext topic

[bug] InputSelector resets to 0 randomly

Questions, comments, feedback, etc.
Post Reply
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

[bug] InputSelector resets to 0 randomly

Post by pinmode »

Using a configuration like this, the InputSelector resets to 0 randomly. I've used MIDI-Ox to confirm that it's not a stray MIDI signal coming through. For that reason I'm pretty sure it's Magic. This happens seemingly randomly, but it's something like once every 20-30 minutes. This isn't specific to 2.0.
Capture.PNG
Capture.PNG (179.79 KiB) Viewed 8321 times
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

Hmm, I'm not sure why that would be happening. After it resets to 0, does it continue sequentially (1, 2, 3...)?
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

Yep, it behaves normally other than the occasional jump back to 0. It's a little hard to capture in a video because of the infrequency, or I'd post a video of it.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

Ok thanks. I really have no idea what could be causing this though. I'll have to think about it...
j4s0n
Posts: 9
Joined: Wed Sep 03, 2014 6:06 am

Re: [bug] InputSelector resets to 0 randomly

Post by j4s0n »

It has to be your MIDI controller. I have an old nanoKontrol that has a "noisy" fader that kinda jumps around when at a certain value.
[edit] just read the original post again and saw the part about MIDIOX... if I understand, this is like a button that you are pressing to cycle thru 35 different shaders or whatever... maybe after cycling so many times the number that [wrap] is wrapping is overflowing it variable type...
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

maybe after cycling so many times the number that [wrap] is wrapping is overflowing it variable type...
At first I thought about that, but it's a 64-bit number, so it would have to get to 2^64 = 18,446,744,073,709,551,615 (eighteen quadrillion) before it gets back to 0. Unlikely to happen in our lifetimes :)
j4s0n
Posts: 9
Joined: Wed Sep 03, 2014 6:06 am

Re: [bug] InputSelector resets to 0 randomly

Post by j4s0n »

Ok... I notice you have assigned MIDI CC#0 to this parameter. That CC is normally used for bank select MSB and is affected by or affects program change commands. Try remapping your controller to use a different CC# and see if it happens. Also, are you using program change via midi to do something else like change scenes or something? check this out... http://tweakheadz.com/midi-controllers/
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

It does this when my MIDI controller is off, not sending signals. I confirmed nothing is coming through the MIDI channel with MIDI-Ox, so I'm pretty sure it's something in Magic.

Also, I just noticed that with two different InputSelectors listening on CC #3 and CC #4, they both reset to 0 at the same time. This was with the MIDI controllers off, not sending signals.

Additionally - there is nothing about my MIDI signals that should reset the input value to 0. The InputSelector is doing modulo wrapping, so it should never jump back to 0. Only wrap.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

The InputSelector is doing modulo wrapping, so it should never jump back to 0. Only wrap.
That is correct. But I've looked closely at the InputSelector, the Trigger modifier, and the Wrap modifier, and I don't think any of them could be causing the problem. Without looking directly at your computer, it's very difficult for me to say what's going on, but I'll continue to think about it.
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

Thanks for the responses!

I'll post some video of it happening with the Midi-Ox logging. Maybe I can try a similar thing with a Volume input and see if it happens with that. If not then we'll know it's specific to MIDI.
skarabee
Posts: 131
Joined: Fri Aug 28, 2015 3:11 am

Re: [bug] InputSelector resets to 0 randomly

Post by skarabee »

I've used the input selector for shaders mapped to a midi controller and didn't have this issue. (I used scale and step for modifiers)
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

I just realized I might have an idea what's going on. Could it be this? viewtopic.php?f=2&t=852&p=3762#p3762

If you have two InputSelectors in a row, changing the input on the second one will reset the first one's modifiers. This is not a bug, but it's the way things are designed.

You can get around it by using a Global Parameter in the first one so that its modifiers won't be reset:
GlobalForInputSelector.png
GlobalForInputSelector.png (41.15 KiB) Viewed 8371 times
Eventually I'll also add a new parameter to the InputSelector which will allow for the same thing.
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

I have a video showing something similar happening. It is related to chained InputSelectors, but I'm not sure I understand it yet. Will post a video later today! I'm in a rush at the moment.
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

Ok, here it is. Watch the InputSelector on the right side when the value hits 4.0. I think my particular fix is to set Scale to 3.99, but I still don't completely understand why this happens.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

This behavior is expected. Your Sine Oscillator momentarily hits 4.0, but you don't have an InputSelector input # for that value. Thus, a blank input is displayed for one frame or so. Adding a Scale with 3.99 is a valid solution.
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

I still don't get it. A blank input is displayed on that InputSelector, so the other InputSelectors reset to 0? Why?
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

Switching to a different input on the InputSelector means that the input's modules are reset. And when the modules are reset, their modifiers are reset. It's the same behavior as when you change scenes.

So, in your case, the Trigger goes back to 0 on all modules that are connected to the InputSelector, including any other InputSelectors. It's really the Trigger that's causing the problem in your case.

The fact that input #4 is blank doesn't really matter. What matters is that you are switching to input #4 and then back to #3, so input #3 is reset. Know what I mean?

As I mentioned in the other post (viewtopic.php?f=2&t=852&p=3762#p3762), the key improvement here would be to add a new InputSelector toggle parameter that would allow the inputs to *not* be reset when they change.
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: [bug] InputSelector resets to 0 randomly

Post by pinmode »

Waiiiit -- this doesn't happen when that right InputSelector changes from #3 to #2 or from #2 to #1... so what's the difference?
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: [bug] InputSelector resets to 0 randomly

Post by Magic »

I can't really tell because your project is so complicated :), but the InputSelector would normally always reset its inputs no matter what.

The only exception is if those inputs were connected somewhere else and were being used continuously, regardless of which input was selected.
Post Reply