Forums > MaxMSP

recalling values after patch is closed..help neede.

June 19, 2012 | 10:13 am

Hi,

This patch uses mtr to record the slider values and play them back. However, when the patch is closed the values are lost. Can anyone point me in the right direction to get the values to recall after patch is saved and re-opened please?

J

– Pasted Max Patch, click to expand. –

June 19, 2012 | 10:26 am

You can save the mtr datas in a file with the write message and reload them with the read messsage.


June 19, 2012 | 2:09 pm

thanks- i have tried to add write and read- however, once I’ve written file it wont open with read- am i missing something obvious, or have i made an error with the patch design?

– Pasted Max Patch, click to expand. –

June 19, 2012 | 6:04 pm

Try writing/reading it as an .xml file rather than the default .pat


June 19, 2012 | 6:49 pm

Thanks- could you give me an example of this as an .xml file?

J


June 24, 2012 | 8:34 pm

Anyone please give me an example of how to get this patch to write and read? Having trouble using Spectro’s suggested .xml file solution…

– Pasted Max Patch, click to expand. –

June 24, 2012 | 8:53 pm

You have to get rid of the -inf values. Or record the amplitude values instead of dB values:

– Pasted Max Patch, click to expand. –

June 25, 2012 | 8:41 am

Sorry for the continued confused tone, but I’m still not getting this write read solution (!)

So I have hit record, moved the slider around and on play I can see the values being recalled. But I want to access theses values after the patch has been closed, so I have put in write and read. Write saves to a folder, but on read I just get the attached list of values.How can I get these values back into the patch so I can analyse the values in context please? Am I doing this in the wrong order?..Help please(!)

[attachment=197567,4085]

Attachments:
  1. readwrite.jpg

June 25, 2012 | 9:22 am

Maybe what you want to do cannot be achieved through the mtr object.

The mtr object can be understood to be an interface around an incoming midi controller of which the value can be recorded and played back, as a very bare bones sequencer. The list that it produces is the time after which the first controller arrives upon recording (in your example 2026 ms) and consecutive time steps (50 ms). Of course these time values are combined with the recorded values.

It seems you need a different solution, as you say you want to access these values, probably outside realtime. There are not really off the shelf solutions for that. There are other ways to read the mtr generated file, for example with the text object, after which you can read out values.


June 25, 2012 | 10:24 am

Would you be able to show me how i would get a list of values back into the patch using the text object? I have tried but no dice..I have attached the values as a text file.

– Pasted Max Patch, click to expand. –
Attachments:
  1. record2a

June 25, 2012 | 10:28 am

AFAIK You can do what you want with mtr provided it uses ‘legal’ values. As per my earlier suggestion, here is an example of how to write the latest mtr recording when the patch is closed and load the xml file when patch is loaded – the main patch should be saved in one of your MAx search paths to be guaranteed to work.

To avoid entering into issues of unreadable values from AtodB, this version alternately records and play back the *gain~* control value, not the atodB level as you are trying to do – whether or not that is what you want I will leave to you to sort…

– Pasted Max Patch, click to expand. –

June 25, 2012 | 10:47 am

Thanks very much spectro- this is great- recalling values after patch is closed. However, it looks like the values write over what was there before when I open up the patch and record new values- even if i save it as a different name . Is there a way to write the data to a named file- so i could get several people to use this patch and recall their individual values?


June 25, 2012 | 10:55 am

Yes, of course there is a way to write/read to a named file. With that said, and with all due respect to you, I have followed some of your related threads for a while and I think you could perhaps spend some time with the tutorials so you can get a better grip on Max in general and rely less on other forum members to solve all your (really quite basic) issues.


July 3, 2012 | 11:34 am

Have addressed the write issue, so that patches dont overwrite eachother- but when i load it i get the error:
flonum: bad arguments for message "float". Its still working o.k., what’s causing this message?

– Pasted Max Patch, click to expand. –

Viewing 14 posts - 1 through 14 (of 14 total)