![]() |
VCTR
|
Helper functions to integrate vctr into dsp code written with JUCE (https://github.com/juce-framework/JUCE). More...
Functions | |
| template<is::anyVctr Src> | |
| auto | toSIMDRegister (const Src &src, size_t i=0) |
| Loads elements of src into a juce::SIMDRegister. | |
| template<class SampleType > | |
| auto | blockChannelAsSpan (const juce::dsp::AudioBlock< SampleType > &block, size_t channelIdx) |
| Returns a Span that views a single channel of a juce::dsp::AudioBlock. | |
| template<class SampleType > | |
| auto | blockChannelAsSpanSIMDAligned (const juce::dsp::AudioBlock< SampleType > &block, size_t channelIdx) |
| Returns a Span that views a single channel of a juce::dsp::AudioBlock, expecting SIMD aligned memory. | |
| template<class SampleType > | |
| auto | audioBufferChannelAsSpan (juce::AudioBuffer< SampleType > &buffer, size_t channelIdx) |
| Returns a Span that views a single channel of a juce::AudioBuffer. | |
| template<class SampleType > | |
| auto | audioBufferChannelAsSpan (const juce::AudioBuffer< SampleType > &buffer, size_t channelIdx) |
| Returns a Span that views a single channel of a juce::AudioBuffer. | |
Helper functions to integrate vctr into dsp code written with JUCE (https://github.com/juce-framework/JUCE).
It requires that the project links against the JUCE dsp module.
| auto vctr::juce_helpers::audioBufferChannelAsSpan | ( | const juce::AudioBuffer< SampleType > & | buffer, |
| size_t | channelIdx | ||
| ) |
Returns a Span that views a single channel of a juce::AudioBuffer.
This allows you to operate on audio channels with all available VCTR features. This overload internally calls AudioBuffer::getReadPointer as it works on a const buffer reference.
| auto vctr::juce_helpers::audioBufferChannelAsSpan | ( | juce::AudioBuffer< SampleType > & | buffer, |
| size_t | channelIdx | ||
| ) |
Returns a Span that views a single channel of a juce::AudioBuffer.
This allows you to operate on audio channels with all available VCTR features. This overload internally calls AudioBuffer::getWritePointer as it works on a non-const buffer reference.
| auto vctr::juce_helpers::blockChannelAsSpan | ( | const juce::dsp::AudioBlock< SampleType > & | block, |
| size_t | channelIdx | ||
| ) |
Returns a Span that views a single channel of a juce::dsp::AudioBlock.
This allows you to operate on audio channels with all available VCTR features. In case the SampleType of the block is const, the Span will give you read access, otherwise it will also allow you write access to the channel data.
Note: If you are working with audio blocks that view memory allocated by JUCE, the allocated memory should be SIMD aligned. In that case consider using blockChannelAsSpanSIMDAligned, which will return a Span that expects the memory being SIMD aligned and might choose some better optimised versions of VCTR expressions without any runtime overhead. However, if you are accessing the audio buffer passed from a plugin host you cannot expect any guaranteed alignment. In this case, you should use this function.
| auto vctr::juce_helpers::blockChannelAsSpanSIMDAligned | ( | const juce::dsp::AudioBlock< SampleType > & | block, |
| size_t | channelIdx | ||
| ) |
Returns a Span that views a single channel of a juce::dsp::AudioBlock, expecting SIMD aligned memory.
This does the same as blockChannelAsSpan, except for expecting the memory to be SIMD aligned. Prefer this whenever you are sure that the memory you are working on has proper alignment.
| auto vctr::juce_helpers::toSIMDRegister | ( | const Src & | src, |
| size_t | i = 0 |
||
| ) |
Loads elements of src into a juce::SIMDRegister.
Note: Only available if VCTR is used in a JUCE based project that uses the juce_dsp module.
This function expects that the number of elements in src is an integer multiple of juce::SIMDRegister<Src::value_type>::SIMDNumElements. Note that JUCE chooses either AVX or SSE registers on x64 platforms, depending on the AVX flags being passed to the compiler. In particular, this means that the function could expect a multiple of 8 element float vector as source when built with AVX flags while expecting a multiple of 4 element vector otherwise. So cross-platform compatibility is best when not building with AVX flags. Also note that juce::dsp::SIMDRegister<double> does NOT wrap a float64x2_t type but some fallback type at the time of writing, so this function won't work for doubles on ARM.
If you want to be more explicit about the SIMD register type, consider using the explicit SIMD related member functions of VctrBase.
| src | The container to read from |
| i | The SIMD register index to read. The read data is at position i * juce::SIMDRegister<Src::value_type>::SIMDNumElements |