High-speed light control (40 outputs) via Music/Audio analysis in C++

Hi everyone,
I am working on a project to synchronize 40 lights with music using a PLCnext controller AXC F 2152.
The Goal: I want to analyze audio signals (either from a file or live input) and trigger specific lighting patterns based on frequency or beat detection.
Current Approach: I am planning to develop this using a C++ application running on the PLCnext, taking advantage of its real-time capabilities. My idea is to handle the signal processing and logic in C++ and communicate with the I/O modules (or external protocol).
My Hardware Setup:
Controller: PLCnext AXC F 2151
Lighting Protocol: Direct Digital Outputs
I would appreciate your advice on the following:
Performance: Is the PLCnext CPU capable of handling basic FFT (Fast Fourier Transform) for audio analysis in real-time without affecting the critical task execution?
Architecture: Would you recommend running the C++ program as a Program Library fully managed by the ESM (Execution & Synchronization Manager), or as a standalone Linux process interacting via GDS?
Connectivity: For controlling 40 lights rapidly, is there a specific library or protocol implementation you recommend for C++ on this platform (e.g., specific DMX libraries)?
Any examples, GitHub repos, or architectural tips would be greatly appreciated.
Thanks in advance!