Live API question : JS vs. Python

Learn about building and using Max for Live devices.
Post Reply
Glennzone
Posts: 60
Joined: Mon Sep 06, 2004 5:26 pm
Location: Virginia, USA
Contact:

Live API question : JS vs. Python

Post by Glennzone » Mon Jan 21, 2013 10:05 pm

Hi folks,

Just looking for some clarification : In the Live API is it true that what is exposed in JavaScript are the same objects as those exposed in Python ?

I'm working on some customizations to the Launchpad in the python scripts. I just want to make sure I'm on the right page.

I've been working on a M4L device, but my impressions are that python scripts are faster.
HW : MacMini (OSX, 16GB),
HP ZBbook 15 (W7 64-bit, 32GB RAM)

Various musical\non-musical MIDI controllers

SW : Ableton Live 8.4.2 Suite (using MIDI only), M4L, Max6, Custom Max app
Cubase Elements 7, VEP5, Komplete9, SD2.2

amounra93
Posts: 432
Joined: Sat Jan 24, 2009 8:16 pm
Location: Arcata, CA
Contact:

Re: Live API question : JS vs. Python

Post by amounra93 » Tue Jan 22, 2013 12:40 am

http://cycling74.com/forums/topic.php?id=23910

;)

a

edit::Sorry, I was pressed for time earlier. I guess my simple opinion is that "Yes, Python is much faster". Whatever you're going to do with the API in javascript is going to have to be handed over to Python anyway (and there is much involved there). But working in m4l also has it's strengths. I recommend using both, but doing as much as you can comfortably do in Python. Some processes just don't make much of a difference, and the prototyping time is going to be faster in js than in Python.

General rule: send as few calls to API objects as you can get by with, if efficiency is your goal. Python will deal with any API stuff natively faster than m4l will. If you need to call a process that is going to manipulate an array of API objects, write the method in Python, and initiate it from js using a single call.
http://www.aumhaa.com for Monomod and other m4l goodies.

Glennzone
Posts: 60
Joined: Mon Sep 06, 2004 5:26 pm
Location: Virginia, USA
Contact:

Re: Live API question : JS vs. Python

Post by Glennzone » Wed Jan 23, 2013 2:34 am

That's good info. I hope it gets lots of reads so others can benefit as well.

It's wonderful to get a concensus.

Thanks,
Glennzone
HW : MacMini (OSX, 16GB),
HP ZBbook 15 (W7 64-bit, 32GB RAM)

Various musical\non-musical MIDI controllers

SW : Ableton Live 8.4.2 Suite (using MIDI only), M4L, Max6, Custom Max app
Cubase Elements 7, VEP5, Komplete9, SD2.2

Post Reply