projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.4k stars 375 forks source link

Ableton Link integration #451

Open Be-ing opened 3 years ago

Be-ing commented 3 years ago

Ableton Link is a network protocol for communicating musical timing information. It would be great to bypass projectM's built in beat analysis DSP with Ableton Link to facilitate integration with other audio and video applications. Note that the Link library is licensed GPLv2+.

revmischa commented 3 years ago

Yeah that'd be awesome

Be-ing commented 3 years ago

The "quantum" in the Link protocol could be used to trigger preset changes on musical phrase boundaries instead of an arbitrary number of seconds.

revmischa commented 3 years ago

I'm not terribly sure but some of that could maybe be done by modifying https://github.com/projectM-visualizer/projectm/blob/master/src/libprojectM/projectM.cpp#L309 Edit: no that's not it...

revmischa commented 3 years ago

I think this is where the values get fed into the current preset for evaluation, if you read in the beat signal from Link you could synchronize time/fps I think https://github.com/projectM-visualizer/projectm/blob/d85d41b69c1c4c258baaeb587f4d8c72c33bff25/src/libprojectM/MilkdropPresetFactory/PresetFrameIO.cpp#L30

And I believe here for the shaders: https://github.com/projectM-visualizer/projectm/blob/master/src/libprojectM/Renderer/ShaderEngine.cpp#L444

kblaschke commented 2 years ago

Due to license restrictions, we cannot use any headers from the Ableton Link API in libprojectM unless we also change the license from LGPL to GPL.

What is possible though is an API function/callback mechanism that would allow applications to feed the required data into libprojectM, overriding the internal beat detection. As long as the embedding application is GPL-licensed (I put the projectMSDL rewrite under GPL, so that's a given), it could use the Ableton Link library to tretrieve the beat data and then feed it into libprojectM. Same goes for closed-source applications if someone has a commercial Ableton Link license.