G4P GKnob rotation direction

When I use


dragging the mouse up turns the knob anti-clockwise and the value decreases and vice versa when I drag down. I think it would be more ‘natural’ to have ‘drag up’ -> rotate clockwise (increase value) and ‘drag down’ -> rotate anti-clockwise (decrease value).

I haven’t been able to find any options to change this behaviour. Is it possible to do so?

Thanks Phil.

1 Like

I have just checked and it is not possible.

Just out of interest I created a sketch with a GKnob and tried out the three modes, they all felt natural to me. I think it is a bit like the toggle switch, should the up position be power on or off, it depends on what your used to in your country.

Have you tried the other modes do they feel natural?

1 Like

I have been using the horizontal mode and that feels more natural as dragging right turns clockwise (increases value) etc. CTRL_ANGULAR also works as I’d expect. I use a DAW for recording audio a lot and every plug-in that has knobs behaves the way I wish that CTRL_VERTICAL did: drag up = clockwise (increase value). I suppose it’s just what I’ve been used to!

Anyway, thanks for looking.


I hope to release a new version of G4P in a couple of weeks, please put a feature request on Sourceforge and I will see what I can do. Perhaps include a reverse option :thinking:

1 Like

Thanks Peter. I have put in my request :slight_smile:

OK I have just looked at the source code and have found a better way to provide what you need rather than incorporate a reverse option.

The GKnob control has a sensitivity setting which controls how fast the knob turns for a given mouse movement. At the moment only positive values are accepted but I have modified the code to also accept negative values effectively reversing the direction for the CTRL_VERTICAL and CTRL_HORIZONTAL modes. So everyone is kept happy :wink:

I have modified and tested the code so it will appear in the next release 4.3.5 which will probably be in a couple of weeks. :grinning:

1 Like

Great Peter, many thanks. :+1: :slightly_smiling_face:

Processing 4.3.5 allows you to have negative sensitivitie effectively reversing the direction for the CTRL_VERTICAL and CTRL_HORIZONTAL modes.

It is now available for manual installation from Sourceforge. Alternatively it will be available in Processing’s Contribution Manager in about 24 hours.


This is tops! :+1:

Thanks for making this work Peter. The vertical option with -1 sensitivity feels so much more natural now. :+1:


Hi quark,

I’ve just found out that the OSX (Mac OS Sierra) version does not reverse when I use a negative sensitivity. In fact it just seems to reduce the sensitivity.

I’ve worked around it by using

switch(platform) { case WINDOWS: MixKnob.setSensitivity(-1); break; case MACOSX: MixKnob.setSensitivity(1); break; }

Just thought you might want to know about this Mac weirdness :thinking:


I have just tested the G4P_KnobConfig example that comes with the library on my iMac (OSX 10.14.6).

I added a line in setup

  kb = new GKnob(this, 60, 60, 180, 180, 0.8f);
  kb.setSensitivity(-1); // this line was added

and tried both +1 and -1 and it worked just fine. :thinking:

Maybe I have forgotten to update the G4P library on my Mac Mini! :zipper_mouth_face:

I probably have got confused by the ‘backwards’ scrolling in OSX compared to Windows, if you know what I mean :crazy_face:

I will check it out and report back.


Where’s the ‘red-faced’ emoticon!?! :pleading_face:

My mistake for not updating the G4P Library on my Mac.

Peter thanks for checking and sorry to have troubled you.