Skip to main content
aronm15237262
Known Participant
January 25, 2022
Question

Midi Slider troubles?

  • January 25, 2022
  • 4 replies
  • 1009 views

I have a character I've been making for a while now that uses game controllers as well as a keyboard and mouse. This is achieved through a lot of custom code, virtual midi devices, and a whole lot of patience and artwork. I'm trying now to make a drawing tablet rig.

As you can see in the video, I have a few sliders that are attached to my hand, they move it on the X and Y axis. I was able to write some code so that I have two virtual midi sliders, one attatched to the X position of my mouse, the other the Y. When I drag the sliders manually, they work fine. When I move my mouse around with the code running, the sliders move, but for some reason, the artwork doesn't.

You see my hand sort of lift off the tablet twice, that's a separate bit I added, if my cursor stays still long enough it will show a graphic with me holding the pen off to the side. That's achieved through midi notes as well so you can see it is still controlling the puppet somehow.

I did the initial setup using a midi keyboard, clicked on the control in the control tab and moved the slider, then wrote the code to fit it, but I find it odd that I can make the sliders move but not the graphic? I tried this so many different ways, even in a new file with one of the test puppets just connected to an opacity slider. I can make the slider move but it doesn't change what happens on screen.

I'm really beating my head against a wall on this one if anyone has any suggestions, I'd be eternally grateful!

This topic has been closed for replies.

4 replies

Adobe Employee
January 26, 2022

That's a really cool rig. I confirmed MIDI as working on both platforms in the latest beta and the latest shipping version. That said, software always finds a way to do weird stuff. Which version of CH are you using? Can you try the latest beta to see if anything is different there?

Thanks,

Dan

aronm15237262
Known Participant
January 27, 2022

I'm currently using the latest (22.1.1) but I hadn't even thought of the beta. I gave it a try but sadly, same problem

alank99101739
Brainiac
January 25, 2022

Very cool. I noticed near the start and end of MIDI events the hand jumped between positions. Something made the hand move... what caused the jump? That could be important in tracking down the problem as clearly MIDI events are arriving. The top of the screen was chopped off so I was not sure when you were in rigging vs stream vs record modes.

 

Things I would look out for

  • Is there another behavior active at the same time. If two behaviors are trying to control the same handle at the same time, only one wins. Maybe disable all the other behaviors first? E.g. if a dragger is on it and has remembered a position, I wonder if that is overriding Transform position values... maybe!
  • What rate of MIDI events are you sending through? Just wondering if you do it too fast whether CH gets overwhelmed (spends all its time receiving events, no time to update the screen). If you put a delay say between sending events in your code (like 1 second) you could rule out this problem.

 

aronm15237262
Known Participant
January 25, 2022

Forgot to add, I had set it up on my physical midi keyboard and when I use the physical board's slider, it works as intended. The hand moves around just fine like it's suppossed to, so for some reason my virtual midi is only moving the sliders, but not the hand attatched to them?

alank99101739
Brainiac
January 25, 2022

Oops, did not read the whole thread first! I would check the rate you send MIDI events then as first investigation. If MIDI keyboard is working, that would be my first guess. It would be easy to write code in a tight loop that is flooding CH with MIDI events and it cannot keep up.

aronm15237262
Known Participant
January 25, 2022

Hey there Alan! Was hoping you would see this, you actually helped me come up with all of this through your research into CA and Midi! (and in a few posts I've made in the past on the subject, haha)

So for the sake of testing I'm only using the crab puppet right now, all default settings, just a transform on the puppet has it's opacity linked to my midi slider and it's giving the same results. The slider will move, but no change in the puppet, unless I use the slider on the physical midi keyboard.

I did for the sake of testing bring it all the way down to 2 seconds per midi send, but no luck. I will say, CA has suprised me on how well it takes midi notes. With my controller rigs I regularly have to do things like hold a joystick to the right and press a button to jump at the same time and it never shows a problem. My keyboard/mouse rig at some points gets I think up to 5-6 signals being sent at once, some in short blips, others as constant holding notes. CA has handled it flawlessly, I'm super impressed by it. I don't think I've yet run into a max amount of Midi notes it could handle at one time.

TheOriginalGC
Community Expert
January 25, 2022

It almost looks like it's lost focus somewhere. 

 

Is this the only view where this input is used? Would I be correct in assuming this is being used for some sort of streaming video? The level of work that went into this so far as awe inspiring, but is it really necessary? There may be some ways to "cheat" the y-axis to create the same level of "realism" without needing the fine detail of the slider. Maybe using the mouse wheel?

aronm15237262
Known Participant
January 25, 2022

The input is probably used at least for the keyboard/mouse rig, but there's a lot of duplicate inputs in here and that's never caused an issue yet, plus I tried it on it's own with the basic crab puppet and an opacity slider with the same result.

Yeah, this is for my youtube channel and twitch. I originally made a working version that broke the screen up into a grid system, so if my mouse passed into a part of the screen it would play a new note, triggering a replay of the X and Y position. I was able to get my screen up to a 10x5 grid before the replay triggers became too awkward for it, but considering how small my movements can be when I'm drawing, it often meant my pen wasn't moving on the rig since it was staying within one square.

This honestly was the easiest method if this last part were working. X(

TheOriginalGC
Community Expert
January 25, 2022

Perhaps if you're doing fine details, maybe you could set up a cycle animation to twitch the barrel of the pen while drawing and have it static when not drawing. I'm just brainstorming here.