help request as im really stuck

Learn about building and using Max for Live devices.
Post Reply
Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

help request as im really stuck

Post by Gravis » Mon May 31, 2010 11:27 pm

Hi guys

So i've spent the last 2 hours trying to figure out what i'm doing wrong and cant work out what the hell is going on ...

I have a Kenton Killamix mini and i'd like to map the joystick to move up and down the scene selection and left and right to move the currently selected track.

Up and down scene selection - This is easy as the midi assignment cant be done with the standard midi mapping (no need for max for live here) :)

Left and right track selection - Ok this is where it goes wrong. My simple idea was to use the API abstractions M4L.api.SelectPreviousTrack and M4L.api.SelectNextTrack which work exactly how i want them to. However the midiin object will not pick up the controllers values/messages for left and right (left = CC21, right = CC19) or the up and down for that matter. When i move the joystick the 'MIDI Track In Indicator' in the top right hand corner of Live registers that Live has received a message that it can use. However, my patch does not get the message for some reason?


<pre><code>
----------begin_max5_patcher----------
365.3ocuT1raCCBCG+L4o.w4rp7Qoqc21dH1kopIRf0xThIJP0xVUe2Wfjr0
uhJUqZW.YiM9u+EG1FfHYpFglfe.+BFg1FfPNWVGndaDoj0jWvztvHkBslsR
PB6NyHZLN+YEr0CNgMkpMlBgwkRbuWI2EnJ686hSnCwVwL4qkvpWqE4lNgjL
KZRTHNNJwtklLg1ZLaRDdYeNuo.CvJEt66wZIq.+jpfObkc017Ykn69HjCxT
K+xcPrsJ+HXILn2DqucAA1kPOoBH9nsuNAJU0RvfMhQHSz4HyTOHS5T6FsyX
t+jwm1O9109Fb1ULRjd4F+dpcMI8Z66SlHxXvpqap3FhkRIWJAuIyhEWFLot
UZGdhFCLOKp4LfMJUZGVGAJwWFJtDIER332Sbp15+PRoUapyGp7Peh+U4bg1
HAlQpf8BxMlrWTqkbt.1+moV5VoZ6jdUfWd1Ob9Jpiq2Xph9OqJpWpZ5ePUs
F6B9F7TZocD
-----------end_max5_patcher-----------
</code></pre>


If i press a button on the kenton killamix then the print out 'blah' occurs so i know my patch can get messages and the print does work.

The way i have the joystick setup is to only send a value of 127 when its all the way left or all the way right (this should make it easy to move one track at a time).

I just do not understand why the midiin object is not getting a value from my joystick :( grrrrrrrrrrr

Please help :)
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: help request as im really stuck

Post by Gravis » Tue Jun 01, 2010 12:06 pm

The one on the top right, next to the 'd' indicator.

Yeah live recognizes it. I can send midi messages from the kenton, to the patch itself when i press a button no the controller, but not when i use the joystick. so my patch prints 'blah' when other i do anything on the controller EXCEPT for when i move the joystick.

Live recognises that the MIDI message from the killamix for the joystick has arrived and when i just try to midi assign the joystick to something (say 'stop all clips') then it works fine. It just seems like the CC#18 for a value of 127 does not get picked up by the midiin object in max, which is surely wrong :( ?
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: help request as im really stuck

Post by broc » Tue Jun 01, 2010 12:35 pm

You could use a [ctlin] object connected to number boxes to see which CC messages actually come in.

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: help request as im really stuck

Post by Gravis » Tue Jun 01, 2010 9:05 pm

ok so using a very simple ctlin object like so ...


<pre><code>
----------begin_max5_patcher----------
413.3ocyUF0aCBBDG+Y8SAgmcKBVq5dao6k9v9DrzrfJqkEEZTbqaM869.Ta
ccl1XpYsuHgi6f+2OON1ZaAiEankPvCfW.VVassrLlzFrZlaAyIaRxHkF2f7
p7XZAzodIVpwnH986PtAsVeSvkbRN0r1iELRV6JpnEUxLpzrY3FqqIxjUL9x
WKnIxZwfvSBt20Af8mpG7cMSTeAKZBpdejeslVGAjwkPG.LlvWB26kVJkruM
9fP26G4iBCNHFFuUKHssc115ONWNKBGUV3oTtJ8CBtgYA8SUl2laR5Fi3gIx
LFuWBEMTB4cJBgLkIX7jARnNCW6ZFj6nVyTSDOWzsaMShHOmpO0iJZdd9SyA
yVQ3bZVujBMTR4dJREEV2owSODh9CotJLXl5PKDYfOHYUzdg.dTgvzfNkKAQ
2TPHiV.Nw8FuQEDgXStW2qE45MNjvDMT0K73WaMZPa+23oTTUjzdybeCSvAU
jRKkLNQxD7tdoahzwqUrzTJuaNmyRWKTW0ajAXQu+tFlpPmSU5mC+2UE9rpJ
3BTkZxN6eXqNhTM
-----------end_max5_patcher-----------
</code></pre>


I move the joystick ...

Left -> MIDI Channel 1, CC#21, value 127
Right -> MIDI Channel 1, CC#19, value 127
Up -> MIDI Channel 1, CC#20, value 127
Down -> MIDI Channel 1, CC#22, value 127

This is what the killamix manual says i should get, and using an external MIDI Monitor it says the same thing, so that first bit is good, but the problem happens when i try to move the joystick in any of these directions.

Live still registers the MIDI message (top right corner next to the D flashes). However the patch doesn't get any more updates, no values change?

Why the heck not??????????? :(

The Computer is getting the message, Live is getting the message, but Max4Live is not ...... so lost right now.

[edit]
Ok so although Live receives the message the second time i press the joystick in any direction, the MIDI track, in Live doesn't show any note being played (you can see this in the mixer section)

My track settings for testing purposes are ..

MIDI From - All Ins, All Channels
Monitor - In
MIDI To - No Output

Is it possible that because Max4Live is receiving a message which is exactly the same as one before it without any changes, it is ignoring it as some sort of optimisation?
[/edit]
Last edited by Gravis on Wed Jun 02, 2010 7:50 pm, edited 1 time in total.
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: help request as im really stuck

Post by broc » Wed Jun 02, 2010 1:18 pm

Short answer to your bold question: no.

Note however that controllers in general send CC only if the value changes.

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: help request as im really stuck

Post by Gravis » Wed Jun 02, 2010 7:49 pm

i've checked that, and my controller is definitely sending the message even when the value hasn't changed. I'm using MIDI Monitor to validate that.

Plus, if i assign the CC value to a button say 'stop all clips' in live, Live reads it every time and continues to 'stop all clips' over and over again.

I dont get why Max4Live would stop receiving it.
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

pukunui
Posts: 405
Joined: Thu Jan 29, 2009 10:26 pm
Location: Los Angeles

Re: help request as im really stuck

Post by pukunui » Wed Jun 02, 2010 8:53 pm

It would appear that Live is filtering the repetition.

Try sending different values

-A

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: help request as im really stuck

Post by broc » Wed Jun 02, 2010 10:32 pm

Oops, Live's midi implementation again.. squeezing Max in a strait-jacket..

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: help request as im really stuck

Post by Gravis » Wed Jun 02, 2010 11:19 pm

Is there a way to stop this 'repetition blocking' ?

I've come up with a work around in my head, haven't got time to test it tonight, but should work although it'll be really wasteful on processing.

The joystick on the controller can be set to send values from 0-127 incrementally as you move it. So i could say that ...

IF value = 0 THEN
move selected track left
ELSE IF value = 127 THEN
move selected track right
ELSE
do nothing

This way Max/Live would get all the messages cause the value would be changing all the time. This is SUCH a bad way of doing it. I have to process 63 messages before getting the one i want.

What the hell Ableton? Can someone at least help me understand why you made the decision NOT to pass it through to MAX4Live, whilst Live itself will receive the message?
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

pukunui
Posts: 405
Joined: Thu Jan 29, 2009 10:26 pm
Location: Los Angeles

Re: help request as im really stuck

Post by pukunui » Wed Jun 02, 2010 11:43 pm

Completely off the top of my head and not guaranteed to work at all 'cos I don't have one of these things, but why don't you make the joystick full range and do something like this

<pre><code>
----------begin_max5_patcher----------
736.3oc0X0siZBDE9Z7ofP5ktJy.CBaZZReNZZZPYVcpv.AFh1tYe267Czkt
B3.pn8BA8vvb9Ney4Weclg05zi3BKymM+logwqyLLjhDBLp9sgUR3wMwgExk
YsIMIASYVyUOigOxjxKypEQKSRKYwXl7ErqjlEx1riP29ib7FlRgPj8B64lN
v.wMWn3JjKx76UuCIRt0oq+4SP25s+kTJiFlfkO5q4jv3FJlPq0KnVu43BNd
CYjTZm51t5xe0rPIEjeKUBfCLgz2lMSbY9ERTQoGnClp..INcb.ZPUNijptB
F85RFKsCyCzimfi5zPcCZeh4o1F1uxvpWvZcHcqUqVOXTtCvUM.v6tCifBRv
EEgawmbtCBL+DX3LCxU.FeI7bkm9.+9Hl1IE6A5R.u8wA6XrrmWt7vgCK1ye
dJsb+B9ZWtOIjVFFWjE8B+6jibTQdpjKbAWxvyw.QRNCHoQGjeeQN.+6WjCE
efCgSXobtYhMAAsa3vdxX342vvQnyGRYMuCuGf2CGsrYGO9G2No3zm2fJyIP
xMHa8HEhv6UcqU5w4JWZZkLXGD3cqJM0AoVfiMAC1QqlSWI4TGOMyc2oyl6H
SU0OaBQSMa9ESO2gmtWQl.eU4d2ySlc5Uhteo76pD3XHjpLWpz2vEnQU+C.u
ejAeeWiyGdXkpvuxsUmLUUYo5rwHf8+csEB7fM558hZKzucS7tWQppLMT0e+
UphziW85wUZolbVEbUJsbGyH1As74wTintyt.6KsFg6CGgjPhHYg4EcDHspG
VQMbjmp2IaMCjp+zHf57gW2f4qkpwJlP+3eFizREx+WtrHsLeSsgT21j46Fa
DtfQnxdgZrHwrwMVzNRTDl1b.JN8mkxM6JPzw7u5hIwTmmEShgKlPLAzASe.
32bL4oCOgd7vj6jBIdXmI7AyaBoyImyzhIGcvzzdzI5+97XZZi5z4nyeRQjN
gbSaV.cJpbIQb7e71r+.tYBnjB
-----------end_max5_patcher-----------
</code></pre>

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: help request as im really stuck

Post by Gravis » Thu Jun 03, 2010 9:51 pm

<pre><code>
----------begin_max5_patcher----------
656.3oc2X10aaBCEF9ZxuBjuNKxlfAbuaS6Sottp0NsKpplHfWq2.6HvYKaU
8+9LFyZRFciFConcCebvXNuO75iMbyDGvBwZZIv8H2KbcbtYhiiNTU.Gy4Nf
730IYwk5lA3zuKV7Evz5KIoqk5vkzLZhzE4E1bI9pbwJYFUpuOOSz5PxerjV
+PAKh4WAl5B.tWZZxmEbYI6m5Ff7lAuq+X7c6tkwxjqY7q9Tg5oW2iywU2iK
BAq1Efq15oNdq9mGmq6evSKXwYMoLKUGSoumfP9fpf2NYR0lo8DcBdroCFpA
BBFYGcP6CcRD44Tt7Ovyye2GOocv.aS0v1UM59UcDzuRnXR0Vesw.E8WEs6y
DYospbXep7Ob5fp6.b3c51KvFcCi5Sc+927pWe9fJcLR6sCP1+JGF1mR+3W7
xgU4yCzl8.XOnb7+kEACLTARroHXeNAwa8OdV7R1ryzL5DU3yRnb5d4SRDYh
hZgBmg8wPRzT0QQMGfIdHbnR9aH3t5sBI54MPyI06PV3t7FjYXezW+QChryb
4E1ivIQlw3tddtnGHbXU0up20NdPJ2DFEEte1nPMhpmi5giHRzfM.7zB52Xh
UkiyAgMkuLCBMq2c+FDRH8uOCNZ7YFRYmOCAgCZk9yKhS95nyj07gBFSlWjM
qivOn2cYHxnwkYPkktLexfWNab5zZ9fciSy2NmFt+qmgFMNMCprsd1VNM8MC
TBc2+Cj94WEeavUJVUjzHzleFfxC76jHkVJY7XISv2rUpZ.a1pqYooT9lVub
V5RgBYlzv8xVeQ14rRMdpCY0N49fmUH+NwJ7gMqfciU9GzrRs9t+cRUsd+CJ
ofcHoNrbZGDbOb5vlScwkSHVjRpStcxu.Hjy2TK
-----------end_max5_patcher-----------
</code></pre>



So this does what i want it to but very slowly. Is it just me or are the abstractions for moving around the liveset really slow? Cause mine are not responding how quickly i'd like them to :( very laggy
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

pukunui
Posts: 405
Joined: Thu Jan 29, 2009 10:26 pm
Location: Los Angeles

Re: help request as im really stuck

Post by pukunui » Thu Jun 03, 2010 11:35 pm

A better way to do this would be to unravel all those abstractions and only search for all the paths once, then store them in your device. Then when you want to move you won't have to go querying the API a whole lot.

Yes, this way is slow.

-A

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: help request as im really stuck

Post by Gravis » Mon Jun 07, 2010 11:11 pm

Ok i think i've got a better way to do it but im missing the basics here ...


<pre><code>
----------begin_max5_patcher----------
366.3ocyT10aBCBEF9Z5uBRytzYJUgo6ts+FKFCVNSYqELE7iMi+2GPac57i
YzjMun8DdOGfWdJmtJBEORuDLw3GwufQnUQHTPxKfpGihK3Kyx4lPYwEfwvG
CwspxYgk1ftArXCjCYVPLzVxydGeGoopW0JqhW.gJepTxywOqyEMoUyJzyr4
fMrEjZ0JI6GSgJ+EGiGr05YjeFRPRZmTKOkaylHUiGV5rQ0jRYotzXBMoeHR
Hg.qcxlESJB1RO5s6IoOrkmjpFKk50VGE4e05LAkBV3Vx83TtbNz1kv6v+c5
zoWEcXIc7QZEi5cL3v9SfiymStHzz4nnoU8yUfHZ2dADQNMhnGDQjK.QGqQa
r1pwdPMz2xMWBKtctGQSX9Xe1oax59q2iByyccP8yeNE1bu9tjynmUl0bB1z
Ii+d+EfwJUbqTq1oJ1NUMQJDPnflCagTLUKU1ZafGbvujmuqn2jtp6Y4J5U3
J2f0QeA.k8GP
-----------end_max5_patcher-----------
</code></pre>


Basically i want to send a bang to get the object path then set the selected track. When i do this i get an error 'set, no valid object id' eh ???

What would be even better is if i could do this in javascript as a large chunk of my match is wirrten in it, anyone know how i can set the selected track using javascript?

Something like ...

function setSelectedTrackIndex(trackNum) {
// This is not right, but just to give you an idea of what i'm after
live_set_observer = new LiveAPI(this.patcher, "live_set view");
live_set_observer.setSelectedTrack(trackNum);
}


Thanks in advance :)
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

Post Reply