Can I get the file path of the current live set using max for live?

    Jul 28 2013 | 4:46 pm
    Hey everyone, I would like to create a max for live patch that makes it easy to create built-in live lessons. The first thing I need is a way to get the file path of the current live set. Is there a way? I can't seem to find anything in the Live API that can do this.

    • Jul 29 2013 | 2:36 pm
      I don't think so, explicitly...
      the only hacky thing i can think of is having a an audio clip in the set, getting the path to the clip and then getting the set path name from that...
    • Jul 29 2013 | 3:03 pm
      Use this.patcher.filepath. In Max 6.1.3, this returns the path of the Live set. In Max 6.1.2, this used to return the path of your Max device. Note however that this implementation is buggy, see:
    • Jul 29 2013 | 3:11 pm
      Lee and Thomas, thank you for the quick replies. Thomas, I will play around with your method and see if I have the same issues. I am sorry to hear that you are having trouble with this. Honestly it seems like a pretty normal thing to want, I wonder why we need to resort to JS in the first place. Seems like the filepath should be a property of the Live set, but hey what do I know.
    • Jul 29 2013 | 5:15 pm
      So, I tried a couple things including the JS solution posted here. I can get the path of the max patch itself(using the thisdevice object or the JS method posted above). The Max patch is not saved within my live set. I need the filepath of the live set itself. Still on the hunt..
    • Jul 29 2013 | 5:46 pm
      Thomas, weird, I thought I was on the latest version of Max, but after re-reading your previous post I went in and checked and it turns out I am using an older version. I'll update to 6.1.3 and try again(hopefully it'll work!), thanks for your help!
    • Jul 29 2013 | 5:52 pm
      Thomas, I am getting the buggy response in the patch that you described, sometimes sending a path and sometimes sending the patcher's filename without the path. But, for me when it sends the path it is the path of the amxd file, and not the path of the live set. Strange that it would work two different ways. I am on Max 6.1.3 32 bit on a Mac.
    • Jul 29 2013 | 6:00 pm
      Lee, how do you go about getting the filepath to an audio file contained in a live set?
    • Jul 29 2013 | 8:09 pm
      you can grab the filepath of an audio clip (e.g. live_set clip_slots x y clip ) - i think the property is filepath or something like that - not at my laptop currently... the clip will have to have been created by live tho (i.e. recorded) in order for it to be in your folder structure, or you'll have had to do a collect and save first
      very hacky! not really a usable solution, but can't think of anything better
      as for why this isn't available... send a request to C74 - they maintain a list of requests for new attribs... i don't know how this is actioned, but at least it's recorded...
      we're still trying to figure out why we can't even get the name of a set ;)
    • Aug 04 2013 | 2:02 pm
      Loudon, that's interesting that you get the path of your Max Patch. I will look into it again. I am glad though that you experience the same regression regarding that it only works sometimes, therefore confirming my bug report.
      Lee, I like the idea of getting the filepath of an audio clip. It's extremely hacky, yes, but it may just work well enough if used with caution, or maybe if combined in a workaround hackish solution with this.patcher.filepath.
    • Aug 28 2013 | 2:53 pm
      There should be a way to get the current live set file path :(
    • Aug 28 2013 | 3:31 pm
      The reason why it might be difficult is because the liveset initially is given a temporary path, until you save it under a name e.g. "untitled1", so a new live set has a temporary path. It would be great if live forced you to give a name for your set, or if it could/would change the name of the temporary set (and all the files inside the temporary folder) to the name you have chosen.
    • Dec 21 2014 | 10:44 pm
      This device returns the *project* folder location and name. Not exactly what you want, but the solution might lead to something you need in terms of functionality. * YOU WILL NEED TO "COLLECT ALL AND SAVE" YOUR SET BEFORE THIS DEVICE FUNCTIONS PROPERLY!*
    • Dec 22 2014 | 5:29 pm
      Naetron, thank you so much! This is perfect, you are a rock star. Will be easy to navigate to subfolders once I know the project path...
    • Dec 22 2014 | 9:45 pm
      Hey, no problem. Happy Life Day!
    • May 15 2015 | 5:36 pm
      This device returns the *project* folder location and name. Not exactly what you want, but the solution might lead to something you need in terms of functionality. * YOU WILL NEED TO "COLLECT ALL AND SAVE" YOUR SET BEFORE THIS DEVICE FUNCTIONS PROPERLY!*
      Wait, this doesn't return the project folder of the Live set, it returns the folder that the device is saved in. Is this really the solution you were looking for, Loudon? Is this more varying behavior because of versions? I have Max 6.1.8. I haven't tried the 1st 2 suggestions yet but I will…
    • May 15 2015 | 5:48 pm
      This is true, but It should return the project path once you 'collect all and save' (or manage the project file to collect this device into the "presets' folder of the project). It's definitely a workaround, but there's a lot of that that comes with the territory.
    • May 19 2015 | 11:15 pm
      Ohhh, collect ALL and save. Well don't I just look foolish. For what it's worth, it turned out that was not an automatic enough solution for me after all, so I pursued Lee's suggestion instead. I needed a place to store temporary files written to disk with sfrecord~, so the paths I'm getting with his method are perfect. I automated it as much as possible and contained it in an abstraction
      It's not so terribly unwieldy after all.
    • May 22 2015 | 3:46 pm
      Thanks for bringing this back to life! The fact that it requires this hackathon is a major issue, but I am digging on NAETRON's solution. Clean, and I am OK with having to collect all and save, makes sense to me. TO_THE_SUN, I am impressed with your work here, I am afraid I am a bit lost in your patch, but impressed none-the-less, If I can figure it out I will totally use it. Thank you personally, and a big thanks for all those in the future that will stumble on this thread and find two great solutions.
    • May 22 2015 | 7:36 pm
      Yeah it's definitely a tangled mess in there; I just threw it together as quickly as possible. But if you put it in your device all it will do is output the path when it loads, and store it in [v ---path]. Inside what it's doing is creating a new track and scene, quickly recording a clip in it, retrieving the path, then deleting the track and scene and resetting a few other things. It does all of this in a flash of a half a second when you drop the device in, which would probably be strange and confusing to someone who is not expecting it and might require an explanation some kind if strangers are going to be using your device, but other than that it's pretty unobtrusive.