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.

oksamurai
Community Manager
Community Manager
January 26, 2022

I'm not fully sure how the physical midi board is sending them, but I've tried sending all midi on (just velocity changing) midi switchiong on and off at the rate of the refresh, and even just "when I press the A key it sends a brief signal" all of which will move the sliders still but not the hand.

Oh gosh, I've seen so much of OkSamurai's work on youtube, shockingly the one good video I could find on using midi dials with CA sliders was from them, it'd be on honor to get their help on this.


We'd love to take a closer look. Can you please do the following:

  • File > Copy Media Files To Project Folder (gathers up all the artwork and extra files)
  • File > Reveal Project in Finder/Explorer
  • Zip up the chproj and media & data folders
  • Upload to Google Drive, Dropbox, Creative Cloud, or whatever as a shared link
  • Share the link here or DM me if you want to keep it private
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.