Mouse Wheel Scroll and MIDI CC Value 0 and 127

With regard to another topic, I have a knob that can scroll the mouse wheel up and down. However, when the knob reaches a CC value of 0 or 127, the scrolling stops, even though there is more to scroll. I tested using the file included in that previous link. When my knob reaches a value of 0 or 127, it keeps sending that value if I keep turning in the same direction.

Hi, you can do this with additional rules as long as your knob keeps sending data

Incoming CC x on MIDI Channel y any value set to qq

Rules

// Compare with last known value  stored in global variable ga

if qq<ga then rr=-1

if qq>ga then rr=1

if qq==0 then rr=-1

if qq==127 then rr=1

// save to compare with last time

ga=qq

Outgoing:  mouse wheel value rr

 

Of course you can change the amount from -1 and +1 to larger if you want to move mouse wheel more for each knob turn.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Thank you, Steve, for your help. You brought up an important point, “as long as your knob keeps sending data.” Unfortunately, the controller stops sending MIDI control messages after it reaches 0 and 127. What’s another way to solve this? Is there a way to have BMT Pro send a message to the controller to reset the CC value of that knob to 64 so it can still go up and down?

 

There are a few ways to solve this.

One is to have a translator suppress MIDI output while you recenter your knob (like by pushing a button). Then releasing the button continues the messages.

 

 

The other is to make your pot look like a virtual encoder. We set up a timer to send positive movement MIDI messages when right of center by maybe 20 degrees and negative messages when left of center by the same amount. When in the center, we stop the timer so MIDI messages (and your scroll wheel) stops.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Thanks for your quick response, Steve. I am still learning BMT and don’t know enough to code the suggested concepts. Would you mind sharing the code for each of those cases?

Hi Thomas,

You can find this information in the below YouTube Tutorial. There should be a link to the project file I used to create the tutorial in the YouTube description.

 

https://youtu.be/VCvxPZawJyE

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Steve, that video was very helpful. Thank you! Would you mind sharing which of the previous two cases you cited the video demonstrated? It seems to show the first case with a translator suppressing MIDI output to recenter the knob.

Yes, that is it. That is the most simple case.

Thank you for confirming the video was for the first case. If Outgoing is Timer instead of Mouse / Mouse Wheel, would another translator be added to control the mouse wheel?

In your case you really don’t need a timer. Just set the Mourino value as positive or negative

Awesome! I’m going to play with this first solution to try to get it to work. I would also like to explore the second solution as well since it doesn’t require the extra button. I searched for “virtual encoder” and quite a few links popped up. What would you recommend for a video or a previous topic as a starting point?

OK if I find my example of when I did it before. I will post it here. Personally I'm not a fan of virtual encoders, they just don't feel right to me.

 

I couldn't find my initial example so re-created it here.

The first translator compares the incoming value of a pot to a high and low threshold and starts a continuous timer if outside of the threshold (center point +-20) and sets the timer speed at 500 ms. The value ga is either -1 (for down) or +1 (for up). The outgoing action does not fire if it is within the threshold (timer does not start).

The second translator just kills the timer if it is within threshold

The third translator is the timer that handle the mouse action takes the value of ga and multiplies by 10 for either +10 or -10 scroll wheel movement.

The output does not have to be a mouse wheel. It could actual send increment and decrement encoder values instead if you want to use it as a virtual CC encoder for output.

You will never run out of space because it will keep going as long it is left or right of the defined thresholds.

 

Enjoy!

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz


Attachments:
1583452871816_Virtual-Encoder-Mouse-Wheel-Example-2020-03-05.bmtp

Thanks, Steve! I’m excited to try this option out too. I’ll report back.

I tried this solution and have mixed feelings about it. The solution solved the issue of scrolling stopping when reaching CC value of 0 or 127. However, it has two side effects. First, it doesn’t feel responsive. For example, the knob has to be turned to some degree before the scrolling reacts. It would be more intuitive if the knob was turned a tiny bit, scrolling would respond with a little scroll. Second, when the knob is turned beyond + or - rr value of 20 and let go, scrolling would keep going in that direction on its own. When used in a program like Davinci Resolve to adjust the lift, gamma, gain and offset in the color wheel by fractions of hundredths, it was very challenging to get it to stop at a certain point. I found myself having to look at the Machine Studio pannel’s LCD to get to near the CC value of 64 for it to stop. By then the decimal unit for the said settings were way out of wack. :confused:

I had a chance to work with the file from that link. The file is slightly different than what was in the video. My log window shows MIDI OUT behaving like the video. When the button is pressed, the MIDI OUT from the knob doesn’t show up. I have a few questions.
When you said, ”In your case, you really don’t need a timer. Just set the Mourino value as positive or negative.” Where should I make that change? I’m guessing in translator #1 ”Fader 1 Movement?” Would I change the Outgoing part from Timer to Mouse / Mouse Wheel?

Hi, these things can be adjusted

After the comment "// offset" you will find this:

rr=20

Change the above to 5 and it will be plus or minus 5 of center instead of plus or minus 20

The initial speed of the timer can be adjusted where you see this:

// Timer Initial Speed in ms
uu=250

The below adjusts the point in which the timer speeds up:

//high point for speed up
rr=40

The below defines how the timer adjustment for speed up

// Double initial speed = timer 1/2 time
if qq>tt then uu=uu/2

These are all in the rules of the translator titled Start Timer.

The other method of making limitless encoders is documented in a different post. I helped another user with this recently.

https://www.bome.com/support/kb/absolute-relative-convert-keystoke-apply

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Hi Steve! Thank you again for helping me solve this challenge. I was able to solve it going a different route.

I found out that the knob (encoder) I was working with could be set to three different modes: Absolute, Relative, and Relative (Offset) from Maschine Studio Controler Editor software. I\'m sure you already know the benefits and drawbacks of each of those modes. However, I\'m going to type out my learning to help someone else looking at this in the future.

The encoder knob is endless. That means they can be turned left or right endlessly. There is no physical hard stop. The knob was set to mode Absolute by default. In my case, it was sending out MIDI CC value of 0 to 127. In this mode, even though the knob can keep turning when it bottomed out at 0 or topped out at 127, it no longer sent messages. The color wheels (Lift, Gamma, Gain, and Offset) in Davinci Resolve had much finner intervals which exceeded the short range of 0-127.

After trying different solutions (including the two you shared), I ended up testing the mode Relative. In Relative mode, the values sent are either 1 or 127. Those values can be used to increment (+1) or decrement (-1). I added two simple translators to emulate the mouse wheel up and down movements. For mouse wheel up translator, Incoming had: control change on ch. 1 with CC#22 and value of 1. Outgoing was set to Mouse / Mouse Wheel / Mouse Wheel 1 / Wheel Delta = 10. For the mouse wheel down translator, Incoming had: control change on ch. 1 with CC#22 and value of 127. Outgoing was set to Mouse / Mouse Wheel / Mouse Wheel 1 / Wheel Delta = -10. This gave control of a color wheel at intervals of 1/100th. It acted just like the mouse wheel.

This knob is also touch-sensitive. When I touch it, it would send out a MIDI message. This allowed me to use that touch message to move the mouse to the corresponding area on the screen which allowed the mouse wheel to work for that particular wheel.

The next step is to combine both translators into one and use the variable pp to track the incoming CC value (1 or 127) and dynamically change the variable rr for mouse wheel delta. I am taking this approach to see if I can get the mouse wheel to accelerate or decelerate based on how fast the knob is turned.

I am hoping you can help me figure out the remaining challenge with this approach. Because of the fine-grain control for the color wheel (-1.00 to 1.00), it takes many turns of the little knob (at +/- 0.01 increments) to reach either end. What would you recommend?

Also, perhaps I\'m doing something incorrectly. When I tested values from 1 to 1000 or -1 to -10000 for Wheel Delta, the speed of the \"movement\" remained the same for the Color Wheel. However, when tested by scrolling a Chrome browser window, it scrolled faster with larger numbers.

My guess is that your mouse is set for it’s own acceleration so maybe if you just set the increment/decrement at 1 it will work for you OK. If not then you will need to use a timer to calculate the amount that the mouse wheel moved since the last timer trip and apply an acceleration factor to your mouse move parameter. It would be much easier, however if you can adjust the host mouse acceleration setting to make that work for you. Introducing timers, may create some delays and less responsiveness of your knob. You may also want to consider a “fine tuning” button and have the mouse scroll at higher scroll increments when the button is not pushed and when you push the button, change the parameter back down to 1.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Thank you, Steve. It looks as though Davinci Resolve doesn’t allow the speed of the mouse wheel to impact that particular area to control the setting. However, click and drag plus the acceleration of the mouse movements left or right does. I appreciate your consistent customer support for all of us users. You rock!