Simple Script to turn continuous wheel on midi controller to Mouse Scroll Wheel

I watched a few of the youtube tutorials and read through similar related posts in the forum here but no success… I’m on Windows 10. How do I use a midi controller to control the mouse wheel? For incoming, when I select “Control Change” and then check “Set variable to value: pp” and then set “Outgoing” to "Mouse wheel (Wheel 1 (vertical)) to Wheel Delta: pp, it somewhat works. Each movement scrolls the mouse upward.

Can you please tell me what I need to adjust to make it scroll in both directions with positive and negative knob turns?

Thank you.

Hi, and welcome to the forum.

It will depend on the type of controller you have. If it is a relative encoder it is much easier as it will put send 01, 02, 03 etc for right movements and 127, 126 125 etc for left movements and you just have to do a little match to change the mouse in the direction you want.

Some relative encoders send 63, 62 61 etc for left and 65, 66. 67 etc for right. Again just some simple rules to dhange it to mouse wheel diretion.

However, if your controller is absolute (0 for far left and up to 127 for far right) . In this case you need to track the last known position to get the delta position in a global variable for movement. Then you can still use rules to do the math, but every encoder will need a different global variable.

So off the top of my head, type one rule relative rule above
Incoming CC 1 MIDI CH 1 set value to qq
if qq>64 then rr=128-qq
uf qq>64 then rr=rr*-1
if qq<64 then rr=qq
Outgoing: Mouse wheel move rr

Second type relative
Same incoming
rr=qq-64
Same outgoing

For fixed
// Compare with last
rr=qq-ga
// store new value in global variable
ga=qq
Same outgoing

I’m doing all of this math off the top of my head so I think I’m doing it right.

The point is you want positive mouse wheel movements in one direction and negative in the other.

The only issue with fixed values is if you hit the end stops (0 and 128), then you run out of room and have to have a way to recenter the knob. Usually you push and hold a button and set a global variable. (say gb). Then you have a rule like this

if gb!=1 then skip next rule
exit rules, skip outgoing action

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you for much Steve - really appreciate you taking the time. The above script generally works (the other didn’t seem to quite work correctly). With the above one, when I get to the edge of a software knob’s range and turn around, or even when I just change direction partway, it takes the knob some time before it starts going back in the other direction (if I change directions somewhere in the middle of the knob’s range, it actually keeps going in the previous direction for a second before switching to the proper direction). Any ideas on how to remedy that? I appreciate it.

Yes, this translator is from the controller to the software. The software probably has a “takeup” feature in which nothing happens until it crosses to the last hardware takeup point. This is to avoid, big jumps in case the hardware controller (which cannot be controlled by the software) and the software get out of sync.

I would really need to see your MIDI IN and MIDI Out log window to determine for sure what is going on. You would need to annotate it in what you are doing as specific point within the log.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz