Optimized DSP functions.
More...
#include "zrythm-config.h"
#include "utils/math.h"
#include "juce_wrapper.h"
Go to the source code of this file.
|
| void | zrythm::utils::float_ranges::linear_fade_in_from (float *dest, int32_t start_offset, int32_t total_frames_to_fade, size_t size, float fade_from_multiplier) |
| | Calculate linear fade by multiplying from 0 to 1 for.
|
| void | zrythm::utils::float_ranges::linear_fade_out_to (float *dest, int32_t start_offset, int32_t total_frames_to_fade, size_t size, float fade_to_multiplier) |
| | Calculate linear fade by multiplying from 0 to 1 for.
|
| void | zrythm::utils::float_ranges::make_mono (float *l, float *r, size_t size, bool equal_power, bool optimize=true) |
| | Makes the two signals mono.
|
◆ linear_fade_in_from()
| void zrythm::utils::float_ranges::linear_fade_in_from |
( |
float * | dest, |
|
|
int32_t | start_offset, |
|
|
int32_t | total_frames_to_fade, |
|
|
size_t | size, |
|
|
float | fade_from_multiplier ) |
Calculate linear fade by multiplying from 0 to 1 for.
- Parameters
-
| total_frames_to_fade | samples. |
- Note
- Does not work properly when
- Parameters
-
| fade_from_multiplier | is < 1k. |
| start_offset | Start offset in the fade interval. |
| total_frames_to_fade | Total frames that should be faded. |
| size | Number of frames to process. |
| fade_from_multiplier | Multiplier to fade from (0 to fade from silence.) |
◆ linear_fade_out_to()
| void zrythm::utils::float_ranges::linear_fade_out_to |
( |
float * | dest, |
|
|
int32_t | start_offset, |
|
|
int32_t | total_frames_to_fade, |
|
|
size_t | size, |
|
|
float | fade_to_multiplier ) |
Calculate linear fade by multiplying from 0 to 1 for.
- Parameters
-
| total_frames_to_fade | samples. |
| start_offset | Start offset in the fade interval. |
| total_frames_to_fade | Total frames that should be faded. |
| size | Number of frames to process. |
| fade_to_multiplier | Multiplier to fade to (0 to fade to silence.) |
◆ make_mono()
| void zrythm::utils::float_ranges::make_mono |
( |
float * | l, |
|
|
float * | r, |
|
|
size_t | size, |
|
|
bool | equal_power, |
|
|
bool | optimize = true ) |
Makes the two signals mono.
- Parameters
-
| equal_power | True for equal power, false for equal amplitude. |
- Note
- Equal amplitude is more suitable for mono compatibility checking. For reference:
- equal power sum = (L+R) * 0.7079 (-3dB)
- equal amplitude sum = (L+R) /2 (-6.02dB)