Conversation
|
Build for testing: |
|
Build for testing: |
|
Build for testing: |
|
Build for testing: |
|
Build for testing: |
|
Good job, everything works great, I just couldn't test the HDMI output. |
|
The clicking noise due to the DC component is still annoying. Why can't you test the HDMI output? |
Because my Raspberry Pi's are built in and the HDMI interface is difficult to access. |
Ah okay, then it's not because of the code :) |
|
I also added ramping, so even performances with DC components don't click when changing volume or pan. The parameter is adjusted a little slower, but it's not that bad. |
|
Build for testing: |
|
Build for testing: |
8da3810 to
62bce01
Compare
|
Build for testing: |
|
Build for testing: |
|
Build for testing: |
|
Build for testing: |
|
Build for testing: |
|
Now with NEON zero cross detection. While playing, changing Master Volume from 100% -> 0% takes about 1 second (depending on ZCs). Synth_Dexed PR: |
|
Build for testing: |
|
Build for testing: |
|
Wondering if this could be done on a Syth_Dexed level for all parameters... |
|
I tried doing it for cutoff and resonance, but it didn't work this way. (or I overlooked something) |
0.0 full left 1.0 full right
as it's fixed in the pan
|
Build for testing: |
Reviewer's GuideThis PR implements zero-crossing aware ramping for parameter changes (volume, panning, master gain) by introducing ARM NEON-optimized scaling and zip utilities and integrating them into the stereo mixer and MiniDexed audio pipeline to eliminate pops and clicks during live adjustments. Sequence diagram for zero-crossing aware parameter change during audio mixingsequenceDiagram
participant User as actor User
participant Mixer as AudioStereoMixer
participant DSP as arm_scale_zc_ramp_f32
User->>Mixer: Change parameter (e.g., volume, pan)
Mixer->>Mixer: Update mp_w (target multiplier)
Mixer->>DSP: Call arm_scale_zc_ramp_f32 with current and target multiplier
DSP-->>Mixer: Scaled audio with smooth ramp at zero crossing
Mixer->>Output: Output noiseless audio
Sequence diagram for master volume change in CMiniDexedsequenceDiagram
participant User as actor User
participant MiniDexed as CMiniDexed
participant DSP as arm_scale_zc_ramp_f32
User->>MiniDexed: setMasterVolume(newVol)
MiniDexed->>MiniDexed: Update m_fMasterVolumeW (target)
MiniDexed->>DSP: Call arm_scale_zc_ramp_f32 for each channel if needed
DSP-->>MiniDexed: Smoothly ramp master volume at zero crossing
MiniDexed->>Output: Output noiseless audio
Class diagram for updated AudioStereoMixer and new DSP utilitiesclassDiagram
class AudioStereoMixer {
+void gain(uint8_t channel, float32_t gain)
+void gain(float32_t gain)
+void pan(uint8_t channel, float32_t pan)
+void doAddMix(uint8_t channel, float32_t* in)
float32_t panorama[NN][2]
float32_t mp[NN][2]
float32_t mp_w[NN][2]
}
class arm_scale_zc_ramp_f32 {
+void arm_scale_zc_ramp_f32(const float32_t* pSrc, float32_t* pScale, float32_t dScale, float32_t* pDst, uint32_t blockSize)
}
class arm_zip_f32 {
+void arm_zip_f32(const float32_t* pSrc1, const float32_t* pSrc2, float32_t* pDst, uint32_t blockSize)
}
class arm_scale_zip_f32 {
+void arm_scale_zip_f32(const float32_t* pSrc1, const float32_t* pSrc2, float32_t scale, float32_t* pDst, uint32_t blockSize)
}
AudioStereoMixer --> arm_scale_zc_ramp_f32 : uses
AudioStereoMixer --> arm_scale_zip_f32 : uses
AudioStereoMixer --> arm_zip_f32 : uses
Class diagram for updated CMiniDexed master volume handlingclassDiagram
class CMiniDexed {
float32_t m_fMasterVolume[8]
float32_t m_fMasterVolumeW
+void setMasterVolume(float32_t vol)
+int GetMasterVolume127() const
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @soyersoyer - I've reviewed your changes - here's some feedback:
- In the gain(float32_t) overload you’re clamping and calling powf(gain,4) inside the loop—which both repeats expensive work and mutates
gainfor subsequent channels—so consider moving the clamp and multiplier calculation outside the loop and applying the precomputed multiplier to each channel. - The hardcoded ramp constants (RAMP_DT = 1/254 and RAMP_EPS = 1/127) could use a brief comment or better yet be made configurable so it’s clear how they relate to your desired ramp duration and precision.
- The NEON and non-NEON paths in arm_scale_zc_ramp_f32 duplicate a lot of logic; it might be worth factoring out the shared zero-cross/ramp detection into a single helper to reduce duplication and ease future maintenance.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the gain(float32_t) overload you’re clamping and calling powf(gain,4) inside the loop—which both repeats expensive work and mutates `gain` for subsequent channels—so consider moving the clamp and multiplier calculation outside the loop and applying the precomputed multiplier to each channel.
- The hardcoded ramp constants (RAMP_DT = 1/254 and RAMP_EPS = 1/127) could use a brief comment or better yet be made configurable so it’s clear how they relate to your desired ramp duration and precision.
- The NEON and non-NEON paths in arm_scale_zc_ramp_f32 duplicate a lot of logic; it might be worth factoring out the shared zero-cross/ramp detection into a single helper to reduce duplication and ease future maintenance.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Build for testing: |
Ramp the scale parameter and change it only at zero crossings to minimize pops and clicks.
|
Build for testing: |
It would be nice to be able to change any parameter while playing without any pops and clicks.
In principle, it is possible if the parameter change occurs at zero crossing.
I wrote ramping and zero cross detection for panning, TG Volume / Expression change and Master Volume.
While playing, changing Master Volume from 100% -> 0% takes about 1 second (depending on ZCs).
If anyone has any ideas on how to do it better or faster, please don't keep it to yourself :)
Summary by Sourcery
Implement zero-crossing detection and ramped scaling for panning, per-channel gain, and master volume to enable pop-free parameter changes, integrate new DSP routines into the mixer and processing pipeline, and update build scripts to include the new source files.
New Features:
Enhancements: