Sending a jit.matrix using a j.return

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Sending a jit.matrix using a j.return

Ricardo
Hi forum,

I'm in need of sending a jit.matrix from the model to the view. Is there a reason one should not do this? Or could it be done a better way?

The reason for sending the matrix is that Im using the output to draw a mask and sending the coordinates back to the model. See Example.maxpat

What happens when I do it this way, is that the mask fills, just occasionally. At random. I cannot seem to understand why this is.

It is a "proof of concept" patch at this point, so it is very rough at this time, but any input are very welcome.

The model is intended to make realtime masking for projection mapping. It is based on VPT5 by HC Gilje and used with his permission.

rdp_gl_mask.zip
Reply | Threaded
Open this post in threaded view
|

Re: Sending a jit.matrix using a j.return

Trond Lossius
Administrator
Hi Ricardo,

The following seems to work:

<pre><code>
----------begin_max5_patcher----------
1103.3oc6Y0sciZCD9Z7SAGtNMEgArSuZ66PuKm83i.jwJqPhJIbb5dx6d0O
.Vfw+rcccb6IWD6j4SBMy2LZXlIeelWPFaGRD3+a9O66488YddFQZAds+sWP
EbWNAJLKKHqFJy2f3AOXAgTJSBkXF0.SYTTGzVL50sXANCSvx2zvfVD150Bj
zdrgOF9f9C+u1BRX4eCUTvgkhbNiPzKKrEKmfy+lbCm0TtwUNhByHnMGtAKv
1CAxJqXEHsjnNILdgxtbTSHurkaBVyXA8ZHsoBSIHoXvIUkgJb2sZUrF43kY
nOLsbEGk2x.IIIZN.DOW+Uxbf9q4otbB17jCXYu7KQAtOIqB606r7BViU1Kh
KZ8HsZixXpqcD64rEsG9El4As3gdQXpUTXuHNR6Ms6OsWJjqrGoxXZ3F5LXW
Zbv9Gihj4zFrQUrBeeVmJsmBRAwZiNJdwwn.sGyFY3pTArZDESq4HAhtOLrG
t.sF1PjqVynRA9uLJHH5wIwWCyQGcyTXk059cNFR5rufRNtfQ0Jw.tVKt63d
1GXcuItFiYETX8DaV4jU7xQ.EJirQjA4lKVD2.Xu.IiQFB0uOBZsrEtFSoiX
QIq93fbb4lSr2LlBr5TOaChXUC0htRkKQtR.2NjskPBghdUY8id76fTbEThj
XqKHJrG7fq8fgHam.oPEEmidEWHsYPbCFTKGW2mKq2KWfKQB4PYRnM2vdIB4
aVR2QTSW5xURTUMQYECWvfzutWIcSCOP9nzwufkOV+JlVvds+RmNFxj3Q9Vc
aHn5DU+zG9cPRLvP.m7VQNHSj6JJxjzBrbo9qklj4Ct1NJ60xfNwuOaV2u7v
+PiuMbw4jjncV+zKOxQpLRTe8KgVoBe33c9eQSH9kHJhiy8+BGUqBpztawup
xZJQb+vqEIdXvvOL01xoQOYH04gQl+J53b6haE2ph4nLr.4G6muAxUtckO+j
LmZKsNgODNDjXHOPD3bbX5MhC+yJjjy7iOMskAokmfrh9AIKvkQV.yKgSSNG
Wkbi3JBCVTgDBevoucd8hptLhZoIZZwYuWFeyx4oq1hbGkBKMzIfJ9oyQTyu
lDUNqpRUS3jL0erA4e.W8SQDgNHtESdlHoDaYuVZxxVQm3smQSQP6KpjfoGq
ZByYqwml4DrFddWLhMOnporApgp5HIl1Wh8ycuOe751fKJPzwbRAVnKHyVZ3
E4k+2RiWb2nwIWnFmd2nwwWnFmbkzX+uNauDymVq3yAU7gLnBv7E1AUrz1dt
oz+4IISOnBv+GGTA3oTSRZaAkSQAeNnhOGTwmCp39aPE.ayM1QTb9AUbUalN
qQE5Q+YZ06p2ASpCaDE284Gcaw5w1jivaQtys47wKW2lZleYQRysTXzcT+eZ
R6dZBVgss2XhxhA2U8+Mlq9HZ+ao8e2gc3TIo2Os+E+etlohuwMSMUqIlG63
5W0J8n5VGUy5g0qd7ZUGWmp5jee1eC38TX0H
-----------end_max5_patcher-----------
</code></pre>


The trick here is to make the j.return @type generic, as what is returned is not the matrix in itself, but rather two symbols “jit_matrix u001000804”, where the second symbol contains a pointer (in C++) to the actual matrix content. Additionally, because it is just the same message being sent over and over again (jit_matrix u001000804), it’s important to ensure that repetitions are not filtered. And finally, if you use the left outlet of j.remote in the view, a “set” message will be prepended, and when receiving messages often, some of them might be filtered out. I avoid this by using j.receive instead.

Obviously this wildly work if the model and view are both hosted within the same Max application. If the view is on another networked computer you would instead need to develop a mechanism for sending the matrixes over the network.

Best,
Trond


> On 07 Aug 2015, at 11:21, Ricardo <[hidden email]> wrote:
>
> Hi forum,
>
> I'm in need of sending a jit.matrix from the model to the view. Is there a
> reason one should not do this? Or could it be done a better way?
>
> The reason for sending the matrix is that Im using the output to draw a mask
> and sending the coordinates back to the model. See Example.maxpat
>
> What happens when I do it this way, is that the mask fills, just
> occasionally. At random. I cannot seem to understand why this is.
>
> It is a "proof of concept" patch at this point, so it is very rough at this
> time, but any input are very welcome.
>
> The model is intended to make realtime masking for projection mapping. It is
> based on VPT5 by HC Gilje and used with his permission.
>
> rdp_gl_mask.zip
> <http://jamoma-forums-mailing-lists.3076123.n2.nabble.com/file/n7582063/rdp_gl_mask.zip>  
>
>
>
> --
> View this message in context: http://jamoma-forums-mailing-lists.3076123.n2.nabble.com/Sending-a-jit-matrix-using-a-j-return-tp7582063.html
> Sent from the Jamoma Users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Jamoma-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jamoma-users


------------------------------------------------------------------------------
_______________________________________________
Jamoma-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-users
Reply | Threaded
Open this post in threaded view
|

Re: Sending a jit.matrix using a j.return

Pascal Baltazar-5

Le 8 août 2015 à 08:15, Trond Lossius <[hidden email]> a écrit :

Obviously this wildly work if the model and view are both hosted within the same Max application. If the view is on another networked computer you would instead need to develop a mechanism for sending the matrixes over the network.

Are you sure it doesn’t work when declaring Minuit devices  (with j.modular) and using e.g. [j.remote myRemoteApp:/myMatrixReturn] to connect remotely to [j.return myMatrixReturn] in the main patcher ?
I haven’t tested, but it should work, AFAIK

Best,

p


------------------------------------------------------------------------------

_______________________________________________
Jamoma-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-users
Reply | Threaded
Open this post in threaded view
|

Re: Sending a jit.matrix using a j.return

Trond Lossius
Administrator
Hi,

I would be surprised if that works. You would get the message itself across (jit_matrix uSomthing), but the pixel content of the matrix, and the fact that the second symbol (uSomthing) is associated with jitter matrix content, would not be communicated over the network. Hence at the receiving end, uSomething would be a meaningless symbol, and would be interpreted in the same way as in this example:

<pre><code>
----------begin_max5_patcher----------
316.3ociREsaCBCC74vWAJOyp.1FcZ+JSSUAvp0UPBJwzRUU+2WhCr0tppsW
RvmsuymCmSDxZyD3joum9QpPbNQHXn.fXNVH6USMcJGWlrGbN0VPlEyQvDw3
6QZSuhr3TZcmZ2RdyH0ADcZ.hhHkoeNmxQm5XT4Rw5wdT6KmUpbFbPQM6P81
MVnghjTTsdUdl+pLb81qgyR+2eSsmnnvLSEynXKqlod+SOKCPWRRBGY+Sq6s
3pgint0b7w1K6ZKdigJ9SCUlWvFJObVk+PCUdugJt1PbaxNT+6mVV5.9stzY
FsMKNHtdxR+Q7VvQnVQnQeUME2TyNrsE3z4KcgNUcGviX9cCmZX3.XcyTxCh
eYu2XCgqy3PTGCYFkV3.tTeEinr98H4Whi13+QSUuHisZZAqdD40dRP4KIeA
8BsqUC
-----------end_max5_patcher-----------
</code></pre>

This is unless Minuit has been extended to recognise that a symbol contained in a node contains additional matrix information, and do these additional steps:

- push the matrix itself across
- re-associate the symbol with the matrix at the receiving end

Alternatively you would have to create a different kind of view for networking purposes that would stream the image itself across using jit.net.send and jit.net.recv.

Best,
Trond


> On 08 Aug 2015, at 10:18, Pascal Baltazar <[hidden email]> wrote:
>
>
>> Le 8 août 2015 à 08:15, Trond Lossius <[hidden email]> a écrit :
>>
>> Obviously this wildly work if the model and view are both hosted within the same Max application. If the view is on another networked computer you would instead need to develop a mechanism for sending the matrixes over the network.
>
> Are you sure it doesn’t work when declaring Minuit devices  (with j.modular) and using e.g. [j.remote myRemoteApp:/myMatrixReturn] to connect remotely to [j.return myMatrixReturn] in the main patcher ?
> I haven’t tested, but it should work, AFAIK
>
> Best,
>
> p
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Jamoma-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jamoma-users


------------------------------------------------------------------------------
_______________________________________________
Jamoma-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-users
Reply | Threaded
Open this post in threaded view
|

Re: Sending a jit.matrix using a j.return

Pascal Baltazar-5
Yes, of course, you’re right !!!

Sorry for the noise…

Best,

p

Pascal Baltazar
[hidden email]
http://www.baltazars.org

> Le 8 août 2015 à 11:17, Trond Lossius <[hidden email]> a écrit :
>
> Hi,
>
> I would be surprised if that works. You would get the message itself across (jit_matrix uSomthing), but the pixel content of the matrix, and the fact that the second symbol (uSomthing) is associated with jitter matrix content, would not be communicated over the network. Hence at the receiving end, uSomething would be a meaningless symbol, and would be interpreted in the same way as in this example:
>
> <pre><code>
> ----------begin_max5_patcher----------
> 316.3ociREsaCBCC74vWAJOyp.1FcZ+JSSUAvp0UPBJwzRUU+2WhCr0tppsW
> RvmsuymCmSDxZyD3joum9QpPbNQHXn.fXNVH6USMcJGWlrGbN0VPlEyQvDw3
> 6QZSuhr3TZcmZ2RdyH0ADcZ.hhHkoeNmxQm5XT4Rw5wdT6KmUpbFbPQM6P81
> MVnghjTTsdUdl+pLb81qgyR+2eSsmnnvLSEynXKqlod+SOKCPWRRBGY+Sq6s
> 3pgint0b7w1K6ZKdigJ9SCUlWvFJObVk+PCUdugJt1PbaxNT+6mVV5.9stzY
> FsMKNHtdxR+Q7VvQnVQnQeUME2TyNrsE3z4KcgNUcGviX9cCmZX3.XcyTxCh
> eYu2XCgqy3PTGCYFkV3.tTeEinr98H4Whi13+QSUuHisZZAqdD40dRP4KIeA
> 8BsqUC
> -----------end_max5_patcher-----------
> </code></pre>
>
> This is unless Minuit has been extended to recognise that a symbol contained in a node contains additional matrix information, and do these additional steps:
>
> - push the matrix itself across
> - re-associate the symbol with the matrix at the receiving end
>
> Alternatively you would have to create a different kind of view for networking purposes that would stream the image itself across using jit.net.send and jit.net.recv.
>
> Best,
> Trond
>
>
>> On 08 Aug 2015, at 10:18, Pascal Baltazar <[hidden email]> wrote:
>>
>>
>>> Le 8 août 2015 à 08:15, Trond Lossius <[hidden email]> a écrit :
>>>
>>> Obviously this wildly work if the model and view are both hosted within the same Max application. If the view is on another networked computer you would instead need to develop a mechanism for sending the matrixes over the network.
>>
>> Are you sure it doesn’t work when declaring Minuit devices  (with j.modular) and using e.g. [j.remote myRemoteApp:/myMatrixReturn] to connect remotely to [j.return myMatrixReturn] in the main patcher ?
>> I haven’t tested, but it should work, AFAIK
>>
>> Best,
>>
>> p
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Jamoma-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jamoma-users
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Jamoma-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jamoma-users


------------------------------------------------------------------------------
_______________________________________________
Jamoma-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jamoma-users
Reply | Threaded
Open this post in threaded view
|

Re: Sending a jit.matrix using a j.return

Ricardo
Thanks guys, this was clarifying. I need to find a better solution it seems. Thanks again for the input.
Reply | Threaded
Open this post in threaded view
|

Re: Sending a jit.matrix using a j.return

Ricardo
Hi again,

I tested the solution with @repititions/filter 0. And it works. Thanks. Now the issue with sending the matrix to a "view" which is not running on the same computer, now that is a different story. I'm just going to ask a stupid question here, but is it not possible to convert the matrix into some sort of list before sending it to j.return, then assembly that list as a matrix in the view?

What I basically need is a way to update the masking points in the LCD in view. I do not need to send a jit.matrix back into the model.