VISR API

Architecture

API reference

Class Component

class visrComponent

Base class for processing components. Components may contain ports to exchange data (either audio signal or parameter) with other components or with the exterior. A component may have a parent, that is, a composite component it is contained in. If the parent is null it is a top-level component. Components also have a name, which must be unique within a containing composite component.

Subclassed by visr::AtomicComponent, visr::CompositeComponent

Public Functions

visr::ComponentComponent(SignalFlowContext const &context, char const *componentName, CompositeComponent *parent)

Constructor, constructs a component.

Parameters
  • context: Configuration object containing basic execution parameters (such as sampling frequency and period (block length))
  • componentName: The name of the component. If this component is contained in a higher-level parent component, the name must be unique within that parent component
  • parent: Pointer to the containing composite component, if there is one. Otherwise, that is, if the present component is at the top level, pass nullptr.

visr::ComponentComponent(SignalFlowContext const &context, std::string const &componentName, CompositeComponent *parent)

Constructor. Convenvience function, accepts a standard string instead of a C chararacter pointer.

Parameters
  • context: Configuration object containing basic execution parameters (such as sampling frequency and period (block length))
  • componentName: The name of the component. If this component is contained in a higher-level parent component, the name must be unique within that parent component.
  • parent: Pointer to the containing composite component, if there is one. Otherwise, that is, if the present component is at the top level, pass nullptr.

visr::ComponentComponent(Component const&)

Deleted copy constructor to avoid copy construction of this and derived classes.

visr::ComponentComponent(Component&&)

Deleted move constructor to avoid moving of this and derived classes.

Component &visr::Componentoperator=(Component const&)

Deleted assignment operator to prohibit (copy) assignment of this and derived classes.

Component &visr::Componentoperator=(Component&&)

Deleted assignment operator to prohibit move assignment of this and derived classes.

visr::Component~Component()

Destructor (virtual)

std::string const &visr::Componentname() const

Return the ‘local’, non-hierarchical name.

std::string visr::ComponentfullName() const

Return the full, hierarchical name of the component.

void visr::Componentstatus(StatusMessage::Kind status, char const *message)

Signal informational messages or the error conditions. Depending on the value of the status parameter, this might result in a message conveyed to the user or abortion of the audio processing.

Parameters
  • status: The class of the status message
  • message: An informational message string.

template <typename ... MessageArgs>
void visr::Componentstatus(StatusMessage::Kind status, MessageArgs... args)

Signal informational messages or the error conditions where the message string is constructed from an arbitrary sequence of arguments. Depending on the value of the status parameter, this might result in a message conveyed to the user or abortion of the audio processing.

Template Parameters
  • MessageArgs: List of argument types to be printed. Normally they are automatically determined by the compiler, so there is no need to specify them.
Parameters
  • status: The class of the status message
  • args: Comma-seprated list of parameters with unspecified types. The main requirement is that all types support an “<<” operator.

bool visr::ComponentisComposite() const

Query whether this component is atomic (i.e., a piece of code implementing a rendering functionality) or a composite consisting of an interconnection of atomic (or further composite) components.

AudioPortBase &visr::ComponentaudioPort(char const *portName)
AudioPortBase const &visr::ComponentaudioPort(char const *portName) const
AudioPortBase &visr::ComponentaudioPort(std::string const &portName)
AudioPortBase const &visr::ComponentaudioPort(std::string const &portName) const
ParameterPortBase &visr::ComponentparameterPort(char const *portName)
ParameterPortBase const &visr::ComponentparameterPort(char const *portName) const
ParameterPortBase &visr::ComponentparameterPort(std::string const &portName)
ParameterPortBase const &visr::ComponentparameterPort(std::string const &portName) const
SamplingFrequencyType visr::ComponentsamplingFrequency() const

Return the sampling frequency of the containing signal flow.

std::size_t visr::Componentperiod() const

Return the period of the containing signal processing graph, i.e., the number of samples processed in each invocation of the process function of the derived audio components. This methods can be called at any point of the lifetime of the derived component, i.e., for instance in the constructor.

bool visr::ComponentisTopLevel() const

Query whether the component is at the top level of a signal flow.

Note
Not needed for user API

impl::ComponentImplementation &visr::Componentimplementation()

Provide a pointer to an external implementation object. The type of this implementation object is opaque, i.e., not visible from the public VISR API.

Note
This method is not supposed to be called in user code. It is public because it is is used by the VISR runtime system.

impl::ComponentImplementation const &visr::Componentimplementation() const

Provide a pointer to an external implementation object, constant version. The type of this implementation object is opaque, i.e., not visible from the public VISR API.

Note
This method is not supposed to be called in user code. It is public because it is is used by the VISR runtime system.

Public Static Functions

std::string const &visr::ComponentnameSeparator()

Separator used to form hierarchical names.

Protected Functions

visr::ComponentComponent(impl::ComponentImplementation *impl)

Constructor that receives the internal implementation object. This overload has to be called by the other constructors (including those of subclasses) to make sure that the implementation object is instantiated. The motivation for this constructor is to provide different implementation objects for different subclasses.

Class AtomicComponent

class visrAtomicComponent : public visr::Component

Base class for atomic components. These components are at the lowest level in the hierarchy and implement runtime functionality as C++ code. Abstract base class, derived classes must override the virtual method process().

Subclassed by visr::apps::audio_network_streamer::AudioNetworkEncoder, visr::impl::test::TestAtom, visr::python::visr::AtomicComponentWrapper, visr::rcl::Add, visr::rcl::BiquadIirFilter, visr::rcl::CAPGainCalculator, visr::rcl::ChannelObjectRoutingCalculator, visr::rcl::CrossfadingFirFilterMatrix, visr::rcl::DelayMatrix, visr::rcl::DelayVector, visr::rcl::DiffusionGainCalculator, visr::rcl::FirFilterMatrix, visr::rcl::GainMatrix, visr::rcl::GainVector, visr::rcl::HoaAllRadGainCalculator, visr::rcl::InterpolatingFirFilterMatrix, visr::rcl::ListenerCompensation, visr::rcl::NullSource, visr::rcl::ObjectGainEqCalculator, visr::rcl::PanningCalculator, visr::rcl::PositionDecoder, visr::rcl::ScalarOscDecoder, visr::rcl::SceneDecoder, visr::rcl::SceneEncoder, visr::rcl::SignalRouting, visr::rcl::SparseGainMatrix, visr::rcl::TimeFrequencyInverseTransform, visr::rcl::TimeFrequencyTransform, visr::rcl::UdpReceiver, visr::rcl::UdpSender, visr::reverbobject::LateReverbFilterCalculator, visr::reverbobject::ReverbParameterCalculator, visr::rrl::SignalRoutingInternal< SampleType >

Public Functions

visr::AtomicComponentAtomicComponent(SignalFlowContext const &context, char const *name, CompositeComponent *parent = nullptr)

Constructor.

Parameters
  • context: a signal flow context structure containing general parameters, e.g., sampling rate and block size of computation.
  • name: Null-terminated character string containing the name. Name must be unique within the containing composite component (if there is one).
  • parent: A composite component to contain this atom, If it is a null pointer (the default), then this component is at the top level.

visr::AtomicComponentAtomicComponent(AtomicComponent const&)

Deleted copy constructor to avoid copying.

visr::AtomicComponentAtomicComponent(AtomicComponent&&)

Deleted move constructor to avoid move construction.

visr::AtomicComponent~AtomicComponent()

Destructor (virtual). Atomic components are destined to be instantiated and managed polymorphically, thus requiring virtual destructors.

virtual void visr::AtomicComponentprocess() = 0

Pure virtual process() function. The overriding methods of base classes are called in regular intervals, each processing a fixed number (context.period()) number of samples.

Class CompositeComponent

class visrCompositeComponent : public visr::Component

Base class for processing components that are composed of other components (atomic and composite). In this way, processing components can be structured hierarchically. Composite components store the contained sub-components, external audio and parameter ports, and conenctions between the ports.

Subclassed by visr::apps::audio_network_streamer::SignalFlow, visr::apps::feedthrough::Feedthrough, visr::apps::scene_decoder::SignalFlow, visr::audiointerfaces::test::Feedthrough, visr::mex::feedthrough::SignalFlow, visr::python::visr::CompositeComponentWrapper, visr::pythoncomponents::Wrapper, visr::reverbobject::ReverbObjectRenderer, visr::signalflows::BaselineRenderer, visr::signalflows::BunchRenderer, visr::signalflows::CoreRenderer, visr::signalflows::DelayVector, visr::signalflows::GainMatrix, visr::signalflows::TimeFrequencyFeedthrough, visr::signalflowspython::VisrRenderer

Unnamed Group

using visr::CompositeComponentChannelRange = visr::ChannelRange

Making the types for defining audio connections known inside CompositeConponent and derived classes These are convenience aliases to make the syntax in derived signal flows more concise.

Note
: This also means that we include the ChannelList/ChannelRange definition in this header, as these classes become part the CompositeComponent interface.

using visr::CompositeComponentChannelList = visr::ChannelList

Public Functions

visr::CompositeComponentCompositeComponent(SignalFlowContext const &context, char const *name, CompositeComponent *parent = nullptr)

Constructor.

Parameters
  • context: Reference to a signal flow context object providing basic runtime parameters as period length or sampling frequency.
  • name: “the name of the component. Used to address the component inside other components and for status reporting.
  • parent: Reference (pointer) to a parent component if the present object is part of a containing signal flow. If nullptr is passed, this component is the top level.

visr::CompositeComponent~CompositeComponent()

Destructor.

std::size_t visr::CompositeComponentnumberOfComponents() const

The number of contained components (not including the composite itself). This method considers only atomic and composite components at the next level, i.e., not recursively.

impl::CompositeComponentImplementation &visr::CompositeComponentimplementation()

Return a reference to the internal data structures holding ports and contained components. From the user point of view, these data structure is opaque and unknown.

impl::CompositeComponentImplementation const &visr::CompositeComponentimplementation() const

Return a reference to the internal data structures holding ports and contained components, const version. From the user point of view, these data structure is opaque and unknown.

void visr::CompositeComponentparameterConnection(char const *sendComponent, char const *sendPort, char const *receiveComponent, char const *receivePort)

Register a connection between parameter ports (both real ports of contained components or external placeholder ports).

Parameters
  • sendComponent: The name of the component holding the send port (local name, not the fully qualified name). When specifiying an external port of a composite component, use an empty string or "this".
  • sendPort: The local (not fully qualified) name of the send port.
  • receiveComponent: The name of the component holding the receive port (local name, not the fully qualified name). When specifiying an external port of a composite component, use an empty string or "this".
  • receivePort: The local (not fully qualified) name of the receive port.
Exceptions
  • std::invalid_argument: if a specified component or port does not exist.

void visr::CompositeComponentparameterConnection(ParameterPortBase &sender, ParameterPortBase &receiver)

Register a connection between parameter ports (both real ports of contained components or external placeholder ports).

Parameters

void visr::CompositeComponentaudioConnection(char const *sendComponent, char const *sendPort, ChannelList const &sendIndices, char const *receiveComponent, char const *receivePort, ChannelList const &receiveIndices)

Register an audio connection between a sending and a receiving audio port. This overload uses C strings to denote both the names of the components holding the ports and the output ports itself. Lists of channel indices are to be specified for the sending and the receiving port. The sizes of these lists must be identical, and the contained indices must not exceed the width of the send and receive port, respectively. Empty lists for both the send and receive indices are permitted and result in no connection.

See
ChannelList for the syntax to specify the channel index lists.
Parameters
  • sendComponent: Name of the component holding the sending audio port. If the send port is an external input of this component, use “” or “this”
  • sendPort: The name of the sending port.
  • sendIndices: A list of channel indices denoting the send channels of the sending side.
  • receiveComponent: Name of the component holding the receiving audio port. If the receive port is an external output of the present component, use “” or “this”
  • receivePort: The name of the receiving port.
  • receiveIndices: A list of channel indices denoting the receive channels within the receiver port.
Exceptions
  • std::invalid_argument: if a specified component or port does not exist.

void visr::CompositeComponentaudioConnection(AudioPortBase &sendPort, ChannelList const &sendIndices, AudioPortBase &receivePort, ChannelList const &receiveIndices)

Register an audio connection between a sending and a receiving audio port. This overload uses audio ports (either directly referencing external in- and output of this components or retrieving ports of contained components using the Component::audioPort() method). Lists of channel indices are to be specified for the sending and the receiving port. The sizes of these lists must be identical, and the contained indices must not exceed the width of the send and receive port, respectively. Empty lists for both the send and receive indices are permitted and result in no connection.

See
ChannelList for the syntax to specify the channel index lists.
Parameters
  • sendPort: The send port object.
  • sendIndices: A list of channel indices denoting the send channels of the sending side.
  • receivePort: The receive port object.
  • receiveIndices: A list of channel indices denoting the receive channels within the receiver port.

void visr::CompositeComponentaudioConnection(AudioPortBase &sendPort, AudioPortBase &receivePort)

Register an audio connection between all channels of a sending and a receiving audio port. This overload uses audio ports (either directly referencing external in- and output of this components or retrieving ports of contained components using the Component::audioPort() method). It establishes one-to-one connections between the channels of the sender and the receiver.

Parameters
  • sendPort: The send port object.
  • receivePort: The receive port object.
Exceptions
  • std::invalid_argument: if the port widths do not match.

Class AudioPortBase

class visrAudioPortBase

Base class for audio ports. Audio ports can form part of the external interface of components and denote start and end points od audio signal connections. An audio port is characterised by a sample type (fundamental integral and floating-point data type as well as complex floating-point types), the width, that is, the number of elementary audio signals represented by this port.

Subclassed by visr::AudioInputBase, visr::AudioOutputBase

Protected Functions

void *visr::AudioPortBasebasePointer()

Return the data pointer to fir first (technically zeroth) channel. The type of this pointer is char and needs to be casted in derived, typed port classes.

void const *visr::AudioPortBasebasePointer() const

Return the data pointer to fir first (technically zeroth) channel, costant versiob The type of this pointer is char and needs to be casted in derived, typed port classes.

Private Members

impl::AudioPortBaseImplementation *visr::AudioPortBasemImpl

Pointer to the private, opaque implementation object.

Class AudioInputBase

class visrAudioInputBase : public visr::AudioPortBase

Base class for audio input ports. This base class is not intended to be used by API users. This class itself cannot be instantiated, because it is not associated with a specific sample type. Only derived classes may actually be instantiated.

Subclassed by visr::AudioInputT< SampleType >, visr::AudioInputT< DataType >

Template class AudioInputT

template <typename DataType>
class visrAudioInputT : public visr::AudioInputBase

Class template for concrete audio inputs holding samples of a specific type.

Template Parameters
  • DataType: The sample type used by this audio port type.

Alias class AudioInput

Non-template of the visr::AudioInputT port template specialised for the default sample type.

using visr::AudioInput = typedef AudioInputT<SampleType>

Alias for audio input ports using the default datatype (typically float)