Programmatically modify M4L device width?


    Oct 12 2011 | 6:37 pm
    I'm building a Max For Live device which needs to be able to expand or contract its width based on user interaction.
    How can I do this programmatically? I've been futzing around with thispatcher and pattr to no avail...
    I see that 'devicewidth' is a basic patcher arg when I open my .amxd file in a source code editor.
    Any ideas?

    • Oct 12 2011 | 7:08 pm
      OK, I see that I can freely modify this parameter in the js object with one line:
      this.patcher.devicewidth(width)
      And I see this resize the box when I'm editing in Max. But Live won't resize its box dynamically. Is there a way to trigger Live to reload the patch?
    • Mar 25 2013 | 11:02 am
      Does anyone knows if there are any news on setting the device width dynamically? The change log of Max 6.1.1 states "device width settable". And I think I remember that Julien Bayle posted something about that somewhere outside this forum (was is facebook???). Though I cannot find anything about that in the documentation of the LOM and the behavior of
      this.patcher.devicewidth(width) hasn't changed. (I'm on Live 9 (32bit) Max 6.1.1 (32bit) Mountain Lion)
      Jan
    • Mar 25 2013 | 11:24 am
      send a message "setwidth xxx" to a live.thisdevice object.
      ;)
    • Mar 25 2013 | 11:26 am
      Ah!!!!!! thanks!!
    • May 30 2013 | 10:44 am
      thats very handy.  thanks.  how is the default m4l device width defined?  even though i have everything hidden from presentation mode, the device width seems to take the maximum of everything.
    • May 31 2013 | 2:12 pm
      Does the above message dynamically resize the device in Live? I haven't tried it yet, but if it does, that is awesome.
    • Feb 27 2014 | 10:21 pm
      I'm using the line object to smoothly widen the device if need be (from a toggle, not manually), and it works when the editor is open but not when it's closed. Is it just currently not set up to handle that at the moment?