Skip to content

engine/audio: configurable spectrum grid for Audio Triggers - #2036

Open
Ximerixx wants to merge 1 commit into
mcallegari:masterfrom
Ximerixx:feature/audio-triggers-spectrum-grid
Open

engine/audio: configurable spectrum grid for Audio Triggers#2036
Ximerixx wants to merge 1 commit into
mcallegari:masterfrom
Ximerixx:feature/audio-triggers-spectrum-grid

Conversation

@Ximerixx

Copy link
Copy Markdown

Summary

  • Add spectrumgrid utility with LogUniform (legacy ln f bands) and SemiLogPreferred (1-2-5 decade grid with merge/split to N bands).
  • Extend AudioCapture band registry by grid mode and low-band emphasis (gamma 1.0–4.0); raise max spectrum bands to 64.
  • Partition FFT bins without overlap between bands to fix identical adjacent bar levels (“shelves”) when band Hz width is below FFT resolution.
  • VC Audio Triggers (Qt Widgets + QML): grid mode, emphasis, Hz labels, variable bar widths, XML persistence.
  • Unit tests: engine/test/spectrumgrid/.
  • translate.sh: find lrelease/lupdate under /usr/lib/qt6/bin on Debian/Ubuntu.

Test plan

  • engine/test/spectrumgrid/spectrumgrid_test (7 tests)
  • make check / ./unittest.sh ui (Linux)
  • Manual: Audio Triggers with 64 bars, semi-log grid, emphasis 1.5–2.0; verify no flat shelves on music
  • QLC+ 5: qlcplus-qml, same properties in VCAudioTriggers

Notes

  • Online docs for new options are not included (see CONTRIBUTING.md — can follow up in qlcplus-docs).
  • Linear 10–20 kHz tail in semi-log activates only when SPECTRUM_MAX_FREQUENCY exceeds 10 kHz (still 5 kHz today).

Made with Cursor

Add spectrumgrid with uniform log and 1-2-5 semi-log band partitioning,
extend AudioCapture registration by grid mode and low-band emphasis (up
to 64 bands), and partition FFT bins exclusively to avoid duplicate bar
levels. Expose grid mode and emphasis in VC Audio Triggers (widgets and
QML), variable bar widths from Hz edges, and spectrumgrid unit tests.
translate.sh: locate lrelease/lupdate on Debian Qt paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mcallegari

Copy link
Copy Markdown
Owner

Please don't throw 1000 lines of AI code at me.
Can you at least explain the need for this PR, some documentation of the theory behind, what are the improvements over the current code, etc?
Thanks

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 34.968% (-0.07%) from 35.037% — Ximerixx:feature/audio-triggers-spectrum-grid into mcallegari:master

@Ximerixx

Copy link
Copy Markdown
Author

Please don't throw 1000 lines of AI code at me.
Can you at least explain the need for this PR, some documentation of the theory behind, what are the improvements over the current code, etc?
Thanks

Well, here's the story
Honestly, I just moved from sunlite because my interface died, and I wanted something new. I made new interface from pi and max485.

I wanted to use the effects in-place with the beat of the music, but it was... Honestly ass
I made that changes when the audio spectrum was like at 20-20.000 wide and I had a lot of problems with that
That's why the code

Semilog mode changes the formula on how to divide and distribute of frequencies, so that more of frequencies under 1Khz and 5kHz will be assigned to more bars

Also, beat detection was changed quite a bit, now it's more sensitive, although this need usually clear audio to work properly, I was using monitoring out from the XAir mixer, instead of built in iny notebook microphone array.

I know, ai code looks like slap in the face, but I tested it in real environment, works... pretty good. Only some issues with bpm and beat detection when DJs mixes songs, lol

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

Successfully merging this pull request may close these issues.

3 participants