Running amiss a little here, I think.
Why do you need to convert the value to hex? Its going to be passed as a decimal number between 0 and 127, so you should send it to the Live.Object as decimal within this range. You also have to preface it with 240 (sysex start status) and append it with 247 (sysex end status).
Don't forget the tosymbol in between it and [call max_to_midi]. Python needs it to be a tuple, and that's how to make it so it can use the value. If the value being sent is outside of these criteria, it wont work. Otherwise, you have a good start. Remember, zl is your friend. In addition to trigger, you can use buddy, or you can reorder a list pretty easily using one of the zl functions. Thresh and Speedlim are other good objects to get rid of unwanted throughput if the resolution of the change is interpolated in the synth, or you just don't care about how smoothly the number changes over time.
JS is wonderful, but I would stay away from it if you can in the beginning. I use it extensively these days for accessing the api, and its especially useful for dealing with arrays and such, but I'd get the hang of message ordering and the basic list functions. Everything your trying to do can be done in a small max patcher with nothing but native max externals (except the M4L objects, that is).
For the record, though, inlet is a property of this, I think:
Code: Select all
function msg_int(blah)
{
if(inlet==0)
{
post(blah, "blah\n");
}
}
pid's contribution probably solved a few problems for you, but might've caused a few new ones as well. See if this gets you moving any faster:
Code: Select all
<pre><code>
----------begin_max5_patcher----------
1880.3oc6as0aihCE94zeEVQZz9RlHeEH6a6NRU6S6S6CqznpJB3z3cH3r.o
WlQy+802Hk1RRvPJSVoQsJTvD724yGe724X52tZxzkxG4kSA+J3yfIS91USl
Xtj9BSbmOY5l3GSxhKM21zD4lM77poyrsUwerxb8+ZsnDn9sZMGTFugCDo73
Yfk6p.OHxx.aKjKiWl8DXIGrQVvA7UqDIB0iBHxMeqLY9cfhc4y.7xs7DQbl
5tWIK.wplp.xUfDYdUgLqbN.T2+YhbdhbWtADKbWLe2FQdFuxfXj6haiqRVK
xu61BdRk0hivKlCmAvAX8gHn9SDRc.byyOI4tp5GEzcUQpwjkK+mOFfpQxJE
3xUFtooeqPAevuKyRa1bo3qll0cQMpJ3kJNHtRHyafrPXnALLyAn6CvM5uz2
u5J8GyNSCXK2IxRU7BPlCdXcbE3I4te4dNHNqfGm9DHUlqFQkfUwEy.w4ofG
jEeobdqC.DOG.n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MYC0BMwZgWCLYg5uTQXCMhtcJ5HKH0xNEQHi2NEcvPHAd6c3zHO.uC5Eg2w4
sJxna5qXPL8bWEYB6RtJxgtYNP5Oqh7Oqh7nTEYz+iqhb8Fk9g+9U+56Fjhr
URl3dQNBg9mBElL7H28HPx6XAVsknGSCOQg5COcIOraJHFS7uR8nfK8J0qVV
H0VDJOWjKzPGjvn9VtUDcPa+7H3DYDAnZPaz8qbYNE2rdTkdD6RtJ8FpQY2q
6oeC0VIVWBIQ9ToLT+KmwriVGwyq.bM4TuCX2VtqXUbBuDf71QxwWP6NzaCB
4mrbzhKYOIcQCUcr29Q1HNHRsJSeSRC+C+s4Sa4h79Y3DmWQOhqzWmgy8K6y
13bt26xmaGyvVsNXafURHymQd194CKu6EhVHJAJv.sXE0QVjQ1BSqZA4jszv
JMcm4UR8UuSyFPqu9KM8R4thjZpr9suBf1i5TdYkHeexee94WbM.a+MsVjlx
yaZVJensR0HiCDGX615LlTgVAvtfI33goftfonwESQc.S5skvGLERB0kbgwr
p4sEz8km41kDh5hL2YC0RXcgcCGW1k1ELwFULg6DOoGwocGSr.SQ1v1A2vEz
8mMPzpqke2PKwCzhiZh1vvyFZQcEs3tiVZC1Tg1.3YCs3thVjGnsA9TnkRNa
nk1Uz5wbIs38FnswYCcleW7DniazH8qsvIwjt9I9fIWDbraOpng6OaLPKEOp
LHpKqf+Jf+tOp1kUvQAWdqwXvTvngoNE+vfI73gIbWwDY7vDpqXhNdXB1ULM
dYX7p.ksiI8KrhOqd5heRra4D19eLl4rgFknKdZT33F4B9Nj6wPwTm79GWE6
rNoSabG6LcG8TZIXiOlHmZF4O.dBeJLgFeLcp50PviOlNYzT5nhIRWTwPG25
0f5jJlwUAJJrC9SHleqDNTL0krGPia9WcYokgLqScx2u5+DpWXlF
-----------end_max5_patcher-----------
</code></pre>
Hope this helps. Took me forever to get the hang of this stuff. Fortunately, there are so many different ways to accomplish the same things
edit: I should mention, make sure you check where the "control surface x" dialog hooked up to the live.object is pointing to. I changed it when I was working on your patch, because that is where the Project X script is instantiated in my prefs, but if you only have one control surface installed, it should be "0", not "1". This can really bugger you if you forget about it. That's where a little js magick is nice (but not present, at the moment).