Ableton / link

Ableton Link
Other
1.09k stars 149 forks source link

setTempo() example ? #92

Closed alx-1 closed 3 years ago

alx-1 commented 3 years ago

Hi all, I'm trying to use setTempo but get this error : passing 'const ableton::Link::SessionState' as 'this' argument discards qualifiers [-fpermissive] mySession.setTempo(newBPM,time);

I guess this should be asked in a forum but I can't find an example for the correct use of setTempo().

Edit : simply removing the 'const' like so does the trick : auto mySession = link.captureAppSessionState(); Now to try to propagate this to the other clients...

Thank you

newBPM = 142;
const auto mySession = link.captureAppSessionState();
const auto time = link.clock().micros();
mySession.setTempo(newBPM,time); // setTempo()'s second arg format is : const std::chrono::microseconds atTime
fgo-ableton commented 3 years ago

Ja. The session state is modified when setting the tempo, so it should not be const.