Page 1 of 1

Apc40 and the Button_Matrix

Posted: Tue Feb 09, 2010 4:56 am
by Markemark
Okay so I go to Controller apc40, then to Component Session_Control then Control and observe the property value coming from the Button_Matrix. Output in the Max print window shows x x x x for each button press on the apc40 buttons. First number being 1 on button down 0 button release, second number is 0-4 indicating row, third 0-7 indicating column, forth number not sure just always outputs a 1(maybe someone knows?). My question here is when you move the red rectangle the output values do not change. For example if the red rectangle is in its default position the top left most button when pressed down will output 1 0 0 1. If I move the red rectangle now say 1 scene down and 1 track over that same button I'd expect to now output 1 1 1 1, its stays the same. Please let me know if I am observing the wrong area. Right now I have a static observation of the 40 buttons, what I'd like is a dynamic observation of the red rectangled grid. Any input would be great!!!

Re: Apc40 and the Button_Matrix

Posted: Wed Feb 10, 2010 9:59 am
by halley
If you bind the button_matrix values to the actual scene/track offset, what would you do
when you don't want to use the button_matrix to control clips but to control something else?

It makes sense that the property values returned by the button_matrix are related 'only' to the button_matrix:
i.e., as you have already discovered, button press/release, row, column...

then when you have the button_matrix value you simply apply any logic you want:
- scene_offset/track_offset mapping when you control clips/session
- note/octave/velocity/ mapping when you control notes
- ...

as suggested above try to look to the scene_offset and track_offset properties
they should both be properties of the Session_Control Component (cannot check at the moment).

Re: Apc40 and the Button_Matrix

Posted: Sun Feb 14, 2010 9:21 pm
by Markemark
Yes I discovered what you explained here and this is the way to go to have both options static and dynamic. I have only been able to get the offsets from a live.object though, if I try to observe with live.observe, max print window returns "property cannot be listened to". Is this my error or is this a limitation of m4L. Any input appreciated!!!


Re: Apc40 and the Button_Matrix

Posted: Tue Feb 16, 2010 5:26 pm
by halley
usually, but not always, properties that can be observed are the ones
originated directly inside live, and/or the ones that don't create too much
events (unless these are essential events, like with some timing/transport properties).

track_offset and scene_offset are properties of the components.
these properties are not part of the session itself, but only of the partial
view of the session space that you have on your hardware (APC/Launchpad/whatever...).

you maybe interested in observing/listening what triggers or its related to the update
logic of track_offset and scene_offset properties. For instance, you maybe want to know when
bank buttons are pressed, bank left/right buttons update track_offset, bank up/down
buttons update scene_offset.
track_offset and scene_offset are the 'coordinates' of the hardware_view/red_rectangle
inside the session area, so you may want to observe the number of tracks and the number
of scenes because these are boundary conditions:
- if the track count and/or scene count changes there should be a check if the track_offset
and/or scene_offset are still within the allowed range (mainly if tracks are deleted).
- if the hardware_view/red_rectangle reaches the boundaries of the session area some of
the bank buttons may be disabled (for example, it makes sense that the bank left button
is enabled only when track_offset value is more than 0, in the same way it makes sense that the bank
right button is enabled only when the track_offset value incremented by 1 is less than the track count value).

if you observe bank buttons, tracks and scenes you should be able to observe the red rectangle
anyway, remote scripts code is not publicly released so I could easily miss somethings here
that are part of the actual implemented logic.

Re: Apc40 and the Button_Matrix

Posted: Tue Feb 16, 2010 10:27 pm
by Markemark
How 'bout that 4th character from the button press, anyone have an idea why its there? Its always a 1 even with session overview on.

Re: Apc40 and the Button_Matrix

Posted: Wed Feb 17, 2010 12:57 am
by halley
could it be a reference to the device?
suppose you have more than one APC,
the 4th number basically directly tells
on which APC the button was pressed. so
first APC Button_Matrix Control returns
'1', second returns '2' and so on.