In this section you work out the parameter portion of the programmatic interface between your audio unit and its view. End users will vary these parameters to control your audio unit in real time.
First, specify which sound attributes you’d like the user to be able to control. For this project, use the following:
Tremolo frequency—the number of tremolo cycles per second.
Tremolo depth—the mix between the input signal and the signal with tremolo applied. At a depth of 0%, there is no tremolo effect. At a depth of 100%, the effect ranges from full amplitude to silence.
Tremolo waveform—the shape of the tremolo effect, such as sine wave or square wave.
Second, specify for each parameter:
User interface name as it appears in the audio unit view
Programmatic name, also called the parameter ID, used in the GetParameterInfo method in the audio unit implementation file
Unit of measurement, such as gain, decibels, or hertz
Minimum value
Maximum value
Default value
The following tables specify the parameter design. You'll use most of these values directly in your code. Specifying a "Description" is for your benefit while developing and extending the audio unit. You can reuse the description later in online help or a user guide.
Parameter attribute | Value |
|---|---|
User interface name | Frequency |
Description | The frequency of the tremolo effect. When this parameter is set to 2 Hz, there are two cycles of the tremolo effect per second. This parameter’s value is continuous, so the user can set any value within the available range. The user adjusts tremolo frequency with a slider. |
Programmatic name |
|
Unit of measurement | Hz |
Minimum value | 0.5 |
Maximum value | 10.0 |
Default value | 2.0 |
Parameter attribute | Value |
|---|---|
User interface name | Depth |
Description | The depth, or intensity, of the tremolo effect. When set to 0%, there is no tremolo effect. When set to 100%, the tremolo effect ranges over each cycle from silence to unity gain. This parameter’s value is continuous, so the user can set any value within the available range. The user adjusts tremolo depth with a slider. |
Programmatic name |
|
Unit of measurement | Percent |
Minimum value | 0.0 |
Maximum value | 100.0 |
Default value | 50.0 |
Parameter attribute | Value |
|---|---|
User interface name | Waveform |
Description | The waveform that the tremolo effect follows. This parameter can take on a set of discrete values. The user picks a tremolo waveform from a menu. |
Programmatic name |
|
Unit of measurement | Indexed |
one value | Sine |
another value | Square |
Default value | Sine |
It's easy to add, delete, and refine parameters later. For example, if you were creating an audio level adjustment parameter, you might start with a linear scale and later change to a logarithmic scale. For the tremolo unit you're building, you might later decide to add additional tremolo waveforms.
Last updated: 2007-10-31