AudioIn
Description
AudioIn
represents an audio input.
Usage
erbui
module Example {
control in_right AudioIn { // 1.
position 19.2mm, 111mm // 2.
style knurled // 3.
label "IN L" // 4.
normalling in_left // 5.
pin AudioInPinRight // 6.
}
}
Creates an audio input control with name
in_left
,Sets the control position on the front panel,
Sets the optional style of the control,
Sets the optional label for the control, using its default theme positioning,
Sets the optional normalling control for the control,
Sets the optional physical board pin to use. If not set, the system will choose it automatically.
Nuts and washers photos are from the Thonk shop.
c++
AudioIn
is a type that abstracts a physical audio input block.
struct Example
{
ExampleUi ui;
void process () {
Buffer buffer = ui.in_left; // 1.
for (auto && sample : buffer) {
...
}
}
}
Retrieves the buffer of samples (in the
-1.f
to1.f
range) floating-point value.
erbui
Control Reference
control
definition
control <name> AudioIn { ... }
Where <name>
is the name of the control.
More details can be found in control
documentation.
position
property
position <x>, <y>
Sets the position of the control, where the axis origin is the top-left corner.
The x
axis is oriented from left to right, and the y
axis is oriented from top to bottom.
The position component values are expressed with their unit, either mm
or hp
.
Example:
position 2hp, 15mm
More details can be found in position
documentation.
style
optional property
style <keywords>
Where <keywords>
is one of:
knurled
(this is the default if not specified),hex
.
More details can be found in style
documentation.
label
optional property
label "<text>"
Where <text>
is the text displayed.
More details can be found in label
documentation.
c++
Member Functions Synopsys
Name |
Synopsys |
---|---|
|
Returns the whole audio buffer |
|
Returns the audio buffer size |
|
Returns the sample at index in the audio buffer |
c++
Member Functions
operator Buffer
operator Buffer () const;
Returns the whole audio buffer. It is represented as an std::array
of float
values.
size
size_t size () const;
Returns the size of the audio buffer. This is the same value as erb_BUFFER_SIZE
.
operator []
const float & operator [] (size_t index);
Returns the sample at index
in the audio buffer.
Since it is a reference, syntaxes like the following can be used:
MyDsp dsp;
dsp.process_input (&ui.in_left [0], ui.in_left.size ());