is it possible to focus view on a Live Device using M4L/LOM


    Jul 10 2019 | 11:44 am
    i want to be able to swiftly bring my M4L device into view using a button from a controller, instead of navigating to it manually using the mouse.
    i had the impression this was possible to do using the "select_device" command, but after trying it out (and reading the reference), it doesn't work like this.
    anyone know if it is possible to do this in any way?
    it could be possible by making my whole device into a Bpatcher and open it as a floating window, but i would prefer not to do it that way.
    bringing into view the Track in which the device is contained would be acceptable but i think this is also not possible?
    i am still using Live 9/max 7, and can't think of a way to do it, has anything changed for this in Live 10?
    any feedback appreciated, even if it's just a confirmation that it's not possible.
    thanks

    • Jul 10 2019 | 12:10 pm
      i just saw the "select_instrument" command which " Selects track's instrument or first device, makes it visible and focuses on it. " i suppose this will work for my device even though it's a midi effect device? if yes, this is good enough for the project i am currently making, although for the next project i still need a "focus on device" command since there will be multiple device's in a single track for efficiency reasons.
    • Jul 10 2019 | 3:28 pm
      I use select_device for this purpose, it’s just not a 1-stop shop in that you want to select its track first and possibly also make sure that the right Detail view (e.g not clip view) is showing.
    • Jul 11 2019 | 10:59 am
      do you mean that if the right track is selected, "select_device" will bring the device into view?
    • Jul 11 2019 | 2:32 pm
      Right. And live_set view has a property “selected_tracks” and it is settable.
    • Jul 12 2019 | 11:16 am
      i am having trouble getting the "select_instrument" to work. it is selecting the device but not bringing it into view. can anyone test the patch? i map a key to the button, i select a different track, i press the key (twice for it to work because it's on "toggle"), it does not bring the track or device into view, however when i manually select the right track, i can see that the device has been selected. so it seems the command is passing through to the right object, just not bringing it to view.
      in the meantime i will try Tylers approach to set "selected_tracks", but would be nice to have feedback if my patch is working for other users. thanks
    • Jul 12 2019 | 2:37 pm
      Maybe I misunderstand , but can't you just midimap the title bar of the device to the button of the controller?
    • Jul 13 2019 | 2:26 am
      Good point! I always forget you can do this, and it’s basically exactly the use case Mark described. (Though there are plenty of other cases programmatically revealing devices handy)
    • Jul 13 2019 | 10:30 am
      @mothergarage thanks for the tip, i hadn't thought about that, although i want to achieve this without manual midimaping for various reasons. i'm still confused about why my patch is not bringing the device into view. The command seems to be passing through to the right object and selecting the right device, just not bringing it to view as stated by the LOM reference. it would be nice if someone can test it out, or if someone could provide a working example of either "select_instrument", "select_device" or "selected_device" approach. thanks
    • Jul 13 2019 | 11:43 am
      https://docs.cycling74.com/max7/vignettes/live_object_model from this LOM Documentation, it mentions that "select_device" does not automatically show the tracks containing it.
      However, property "selected_track" of Song.View can be set, meaning you can select the tracks you want, as long as you obtained ids.
      I'd suggest using [live.observer], children "tracks" of Song to obtain all ids of tracks. The ids [live.observer] prints out is always in order from left to right(top to bottom), maybe use coll&counter?
      Edit: Think of it, using [coll] with [listfunnel] would be handy.
    • Jul 13 2019 | 2:57 pm
      It's not mentioned on the info, but you'll find an implementation of how to focus to different views in this device: https://gumroad.com/l/ODGd
    • Jul 16 2019 | 8:21 pm
      i managed to do it by setting the selected_track, and thanks to crampe's suggestion it was easy to make it focus on the right view. here is my working patch for anyone who might have the same trouble in the future
      thank's to all of you for your help!