Page 1 of 1

Get current track?

Posted: Tue Nov 10, 2009 10:19 am
by gavspav
What is the best way to get the track number of the current device?
I've done it like this (below) but reckon there is an easier way?


<pre><code>
----------begin_max5_patcher----------
547.3ocyVF0jaBBDG+Y8SAiOmKiBlKZeq8qQmaxfHMgVEbT7ZZu49tWYId0b
mV8rFaePLt6B7merrgmbc7RTm4UdnOf9Lxw4IWGGvjwfykuc7xomYYzJHLOI
+6pju5sw5RyOqAyYJZZBUdr0gHEL2D5cA6ZM9EkTKo4bv0GKEzLzmTYostU0
5LtV+iBtUPdv.hdnSuqD+DbF3u0+hYYctP1zOPdAWLVP0rSB4wCkbl1NZA62
0zGzcDS6N32AQa8eY3aFGq.rCjw3yttllMSEM04I7x9HP3bIfPp81rvffrCP
PP38.I7GgD34Ph9SRpkET12PTTBhgD8AJxbAkgRsOFnsTvBGGC7AGZdse+Hv
Jb4fktgRY8wH7e0wICiVN3XSghLsD71cKdhTNuphdj+F3bjqazyo9vi+rSgd
WXA+mvBjrDgMsg1Tl6W1JMCTDV7HeaiCiRdKYh9O.LPlRfusFb7MnF7PILlr
Ej9jn5PJ+QAiiXToRJXzrCEzRt7EfkIjblpVp6tV5PQx+dJZqBAnLFHId+pk
cMvoNb7vXY7Z18SF76udjkLDaUInE6OHZHcPCDBr2+pKCAyhw907pRUWxZWG
sWxA86YJkWoERpVnjcBhbULmDoobvc65LWjVnZ92qKZ.8PuadSVRloiLhjLW
MYE0TzDnTvJiI7Tzj+5qofQzTzUwbqkj4D9nR5Ur7liI+Ir0EspRhLAEAnbt
Rp4imc+EHIIKjC
-----------end_max5_patcher-----------
</code></pre>

Re: Get current track?

Posted: Tue Nov 10, 2009 3:47 pm
by pukunui
Looks fine to me. I imagine canonical_parent is optional, but there's no penalty.

-A

Re: Get current track?

Posted: Sun Nov 15, 2009 2:36 pm
by LaotzeSunHammer
Thanks, I've been trying to do this myself. So to take it one step further, what is the necessary command to get the current device number?

Re: Get current track?

Posted: Wed Nov 18, 2009 7:27 pm
by stretta
Is there a simple way to be notified when the track the patch is on is selected?

Re: Get current track?

Posted: Wed Nov 18, 2009 7:29 pm
by hoffman2k
stretta wrote:Is there a simple way to be notified when the track the patch is on is selected?
Compare the selected track number with the track number you can get from the device using the this_device API commands.

Re: Get current track?

Posted: Wed Nov 18, 2009 7:31 pm
by stretta
I was afraid that was what you were going to say.