Can't retrieve scene list with JS

Learn about building and using Max for Live devices.
Post Reply
autodidactic
Posts: 71
Joined: Sun Jul 22, 2007 4:12 am

Can't retrieve scene list with JS

Post by autodidactic » Mon Oct 06, 2014 6:33 pm

Hi guys. I'm using Live8+M4L+Max5 here. I'm just trying to kick the tires on M4L a bit and am running into a bizarre bug. I'm trying to retrieve the list of scene names using JS and LiveAPI. I can get the list of scene IDs but when I try to go and use those ids to get the actual scene names, it seems to throw errors.I've pasted my code into pastebin.

Here's the link: http://pastebin.com/fnWYKdgQ

The error I get is [jsliveapi | get: no valid object set]. It doesn't throw this error for every scene id, only for scene ids that are above a certain number. I can't verify the exact number because I've been deleting and adding scenes manually while troubleshooting. It did seem that any scene I've come across with an id > 20 (or so) LiveAPI can't find. Not sure where to go from here. Is this a bug? Am I missing something?

autodidactic
Posts: 71
Joined: Sun Jul 22, 2007 4:12 am

Re: Can't retrieve scene list with JS

Post by autodidactic » Mon Oct 06, 2014 8:26 pm

Ok, so I just tried it on a fresh Live Set with the default 20 scenes. The scene ids range from 2-21 and scene ids 20 & 21 both throw the error.

Next, I add another scene, but this time scenes with ID 21 & 22 throw the error.

Now I add 3 more scenes and again the last 2 (Scene ID 24 & 25) throw the error.

So weird.

autodidactic
Posts: 71
Joined: Sun Jul 22, 2007 4:12 am

Re: Can't retrieve scene list with JS

Post by autodidactic » Mon Oct 06, 2014 11:13 pm

I think I figured it out. It seems that LiveAPI also stores the scenes as a list. So the best way to get a list of all the scene names is by using "live_set scenes N" but where N DOES NOT equal the ID of the scene but it's index in the scene list. Top scene is index 0, 2nd scene is index 1 etc. I hope I haven't spoken too soon, but so far this seems to be the case.

Post Reply