Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-Fade Mixer Support / Single Control Mixer Support #39

Open
DatanoiseTV opened this issue Mar 15, 2024 · 1 comment
Open

Cross-Fade Mixer Support / Single Control Mixer Support #39

DatanoiseTV opened this issue Mar 15, 2024 · 1 comment

Comments

@DatanoiseTV
Copy link

It seems like the mixer elements are not supported (yet)?
I wanted to try crossfading between 2 channels via I2C.

@MCUdude
Copy link
Owner

MCUdude commented Mar 15, 2024

There are lots and lots of different blick I haven't reverse-engineered. But the neat thing about this library is that it's easy to create your own functions to control different blocks.

You can play around with the capture window in SigmaStudio to determine how to control a particular block.

Here, for instance, is the function to control a volume slider with slew. In your case, I would assume you could add two volume sliders, and merge them at the end using a mixer block.

SigmaDSP/src/SigmaDSP.cpp

Lines 173 to 188 in b0d8c8a

/**
* @brief Controls a volume control block with slew
* SigmaStudio path:
* Volume Controls > Adjustable Gain > Shared Slider > Clickless SW Slew (RC) > Single SW Slew vol (adjustable)
*
* @param startMemoryAddress DSP memory address
* @param dB Volume to set in dB
* @param slew slew rate (optional parameter, default 12)
*/
void SigmaDSP::volume_slew(uint16_t startMemoryAddress, float dB, uint8_t slew)
{
float volume = pow(10, dB / 20); // 10^(dB / 20)
int32_t slewrate = 0x400000 / (1 << (slew - 1)); // 0x400000/2^(slew - 1))
safeload_write(startMemoryAddress, volume, slewrate);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants