is it possible for TWO max devices sharing memory

Learn about building and using Max for Live devices.
Post Reply
TabSel
Posts: 90
Joined: Thu Jan 05, 2012 7:05 am

is it possible for TWO max devices sharing memory

Post by TabSel » Thu Nov 08, 2012 12:24 pm

so, you store a number in device 1 and have access to this number in another device 2?

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

Re: is it possible for TWO max devices sharing memory

Post by broc » Thu Nov 08, 2012 1:05 pm

Yes, can easily be done with a [value] object.

TabSel
Posts: 90
Joined: Thu Jan 05, 2012 7:05 am

Re: is it possible for TWO max devices sharing memory

Post by TabSel » Thu Nov 08, 2012 1:09 pm

Can you just briefly describe how?

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

Re: is it possible for TWO max devices sharing memory

Post by broc » Thu Nov 08, 2012 1:25 pm

Both devices need to have a value object with the same name, eg. [value mynumber].
Then you can set the value in device 1 and get the value in device 2.

For more details see help/ref file.

TabSel
Posts: 90
Joined: Thu Jan 05, 2012 7:05 am

Re: is it possible for TWO max devices sharing memory

Post by TabSel » Thu Nov 08, 2012 2:05 pm

Thank you!

Confused with all the objects. You wrote value, I read number...

oddstep
Posts: 1732
Joined: Tue Feb 12, 2008 9:47 pm
Location: Plymouth the great

Re: is it possible for TWO max devices sharing memory

Post by oddstep » Sat Nov 10, 2012 1:18 am

yeah i've recently discovered you can do this with named coll objects. its great

pid
Posts: 354
Joined: Thu Nov 05, 2009 9:51 am

Re: is it possible for TWO max devices sharing memory

Post by pid » Sat Nov 10, 2012 9:39 am

and works for [buffer~]'s too. but you have to be very careful with all these solutions.

different tracks will reside on different threads, and if you are not careful you might attempt to read a piece of data from one before the data has finished writing on another. which can cause big problems.

always manage your 'notifications' properly between data sharing. data sharing across a live set is not and not possible to be true 'real time'.

i always send a second notification saying 'has completed' to check before reading data elsewhere.
3dot... wrote: in short.. we live in disappointing times..

TabSel
Posts: 90
Joined: Thu Jan 05, 2012 7:05 am

Re: is it possible for TWO max devices sharing memory

Post by TabSel » Sat Nov 10, 2012 9:47 am

But one device writing, one or more reading is thread save at least?
May be writing to queue in one device and constantly emptying the queue in the reading devices every 20ms or so will ensure ordering?

Post Reply