Knobs can be manipulated by looking at the angle of a touch in relationship to the knob, or by looking at the vertical offset of the touch in relationship to the knob. The differing behaviors are mainly to accommodate user preferences, but in same cases the vertical offset method may be impractical, such as when a knob is positioned near the top or the bottom of the interface. Knobs can also be center focused… this is useful for pan knobs.
Additional JSON Attributes
- radius: used instead of width and height
- centerZero : useful for pan knobs, when true the knob will draw half arcs to the left and the right of the center position. The default value is false.
- usesRotation : The default way to manipulate a Knob widget is to rotate your finger around it. If instead you would like to drag your finger vertically set this value to false. Again, the default is true.
Simple JSON
{ "name":"myKnob", "type":"Knob", "x":0, "y":0, "width":.25, "height":.25, }
This creates a Knob with a default range of 0 to 1 that is not centered. It outputs to “/myKnob” or MIDI channel 1 control change 0 depending on the type of destination chosen. It uses the angle of the touch in relationship to the knob to determine its value.
Extra JSON
{ "name":"myKnob", "type":"Knob", "x":0, "y":0, "width":.25, "height":.25, "usesRotation" : false, "centerZero" : true, "min" : -1, "max" : 1, "address" : "/pan1", }
This is a center zeroed knob with a range of -1 to +1. It does not use rotation to determine value, instead it uses the vertical position of the touch in relation to the knob. It outputs to the OSC address “/pan1” or MIDI channel 1 control change 0 depending on the destination chosen.