Ableton Live 9 Lite and openFrameworks


#1

Hello, I want to send OSC messages to Ableton from my OF app, in order to trig sounds in ableton.

I have looked into this addon https://github.com/genekogan/ofxAbletonLive but the instructions are not up-to-date (when downloading the LiveOSC .zip, there is no folder containing the scripts, but a .dmg file).

Which is the preferred way to achieve this? are there any other addons out there?


#2

Hi,
I recently used https://github.com/stufisher/LiveOSC2
Notice, as suggested in the comments here that you’ll need to modify socket_live8.py by commenting the following lines

# if _have_ssl:
# _realssl = ssl
# def ssl(sock, keyfile=None, certfile=None):
# if hasattr(sock, "_sock"):
# sock = sock._sock
# return _realssl(sock, keyfile, certfile)

I tried to use gene’s addon but at the end it was easier for me to directly send the osc messages I needed. The “api” is quite straightforwards. I used it on Macos Sierra, OF 0.10 and Live 9.7.5
hope this helps.
best


#3

I can not find any file named socket_live8.py in that repository. Is is somewhere else?


#4

sorry, this is the repo I used


#5

For some reason LiveOSC2 didnt worked while LiveOSC did


#6

Hello @roymacdonald , I have downloaded the repository and edit the setup_live8.py file.
I’m trying to figure out with address to use, do you have some code around that I can test on my machine?


#7

Hi, you send osc to 9005 and receive in 9006.
Just tested the following code and it works for me.
An important thing. in Live, got to Preferences and in Midi select LiveOSC in the Control Surface dropdown. otherwise it will not work.

#pragma once

#include "ofMain.h"
#include "ofxOsc.h"

class ofApp : public ofBaseApp{

	public:
	void setup();
	void mouseMoved(int x, int y );
	
	ofxOscSender sender;
		
};

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
	sender.setup("localhost", 9005);
}
//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y ){
	ofxOscMessage m;
	m.setAddress("/live/volume");
	m.addIntArg(1);
	m.addFloatArg(ofMap(x, 0, ofGetWidth(), 0, 1, true));
	sender.sendMessage(m, false);

}

#8

I can not hear any sound out of it. I have dragged a sound effect in one of the midi columns, but still no sound. And I have pressed play. Maybe I did not get something, it is the first time that I use Ableton.


#9

is the track volume moving via OSC?
you need to press the play button in the track slot. or you canuse the more conventional timeline view by pressing the tab key.


#10

Now I get the track playing, but the volume is not changing while changing the mouse pos in the OF app. I have selected Prefereces -> Midi -> LiveOSC in the Control Surface dropdown, I have also tried to close and reopen ableton, same result


#11

which version of live are you using?
I remember that at first it didn’r work and it only did after I restarted the computer and reopened Live a few times. Sounds like black magic but I don’t have a better answer than that.
(notice that the int argument you send in the osc message is the track number, where the first track is 1, not zero)


#12

Thank you for your support @roymacdonald. After a restart, it is working. This thing behave weirdly. My ableton version is 9.7.6.

By the way, I have discovered sonic PI in the meantime, it has a nice documentation and it works without magic

Of course, it is totally a different software.


#13

@edapx Why is it behaving weirdly?

Yeah, Sonic Pi seems to be really nice.
cheers!


#14

I mean, it is weird that it worked just after a restart. I have tried both Ableton and Sonic PI, but for what I want to do (sending some notes depending on some variables) Sonic PI looks more easy and straightforward to me.
Thanks :wink:


#15

I see. right, Ableton can be a bit of an overkill in some cases.
cheers!


#16

This is a super simple exercise that uses Sonic PI and OpenFrameworks


#17

Ofcourse I’m not sure what notes you’re playing or what your sound requirements are, but Maximilian is my go-to for doing audio stuff and it runs right inside oF and not having to use OSC or other things in the middle is very helpful.


#18

@ayruos , Right, there are several libs and addos for sound generation from within OF, but you can’t live code those (at least as easily as using SonicPi). Both options are equally valid and each has its pro and cos.
cheers


#19

Yes of course :slight_smile: