6.4.3. RNBO Tutorial #2 – Simple Gain with UI

../../../_images/beg2.png

Fig. 6.75 Simple gain patch with UI in Max

The above patch is an expansion upon the patch from Beginner Tutorial #1, providing the user with manual control over gain. This tutorial will explore not only how to control gain within the main Max patcher, but also how to do so after exporting to Emote.

Download the maxpat file here: Simple Gain with UI.

6.4.3.1. Param Object

The param object is the primary means by which the end user is given control over certain parameters of a patch. Without param objects, the only way to alter the parameters of an effect is directly within the RNBO subpatcher.

Param objects are instantiated within the RNBO subpatcher, and effectively act as variables which can have values sent to them from outside the RNBO subpatcher.

../../../_images/gain.png

Fig. 6.76 Param object used to control gain

Param objects require a name and initial value (@value) as arguments, although many other attributes are available. In the example above, the @min and @max attributes are also used, setting the minimum and maximum possible values the object can send.

6.4.3.2. Controlling Parameters within the Max Patcher

Once a param object is instantiated within RNBO, there are a couple ways to control the parameter in Max.

Attributes Menu

  • Right click any signal inlet on the rnbo~ object to view its attributes. All instantiated parameters should be included in this list as attributes.

  • Click on any available parameter to open its corresponding attrui object.

  • Control over a given parameter is accessible directly within its attrui object. The way in which attrui displays data can be changed in the Inspector, in the “Display Mode” field.

Message Box

  • Values can also be sent to a given parameter in RNBO using a message box with the same name as the parameter. An example of this is shown below:

  • A message with the argument “gain $1” is connected to the first signal inlet of the rnbo~ object, allowing values to be sent to the gain parameter.

  • “$1” effectively acts as a placeholder, containing whatever value is most recently sent to the message by the number box above.

  • The value of the number box is controlled by a slider. Setting up parameter control in this way takes slightly more effort than doing so via the attributes menu but allows for greater customization over exactly how the user controls parameters.

../../../_images/tester.png

Fig. 6.77 Example of how to control parameters within Max using messages

../../../_images/emote_gainknob.png

Fig. 6.78 UI shown in Emote, one knob to control gain

Upon exporting to Emote, a single knob labeled “gain” will be presented to the user. A knob is automatically generated for every param object instantiated within RNBO and can only access values between the min and max values specified within the object. These values are displayed to the user above the knob. Recall that the values accepted by RNBO’s gain~ object are NOT equal to gain in dB. A value of 128 is roughly equal to unity gain.