Programmatically modify M4L device width?

Oct 12, 2011 at 6:37pm

Programmatically modify M4L device width?

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?

#59277
Oct 12, 2011 at 7:08pm

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?

#213062
Mar 25, 2013 at 11:02am

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

#213063
Mar 25, 2013 at 11:24am

send a message “setwidth xxx” to a live.thisdevice object.

;)

#213064
Mar 25, 2013 at 11:26am

Ah!!!!!! thanks!!

#213065
May 30, 2013 at 3:44am

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.

#251194
May 31, 2013 at 7:12am

Does the above message dynamically resize the device in Live? I haven’t tried it yet, but if it does, that is awesome.

#251294
Feb 27, 2014 at 2:21pm

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?

#282399

You must be logged in to reply to this topic.