recalling values after patch is closed..help neede.

josha's icon

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?

Max Patch
Copy patch and select New From Clipboard in Max.

J

pdelges's icon

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

josha's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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?

spectro's icon

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

josha's icon

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

J

josha's icon

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...

Max Patch
Copy patch and select New From Clipboard in Max.

Tj Shredder's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

josha's icon

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(!)

4085.readwrite.jpg
jpg
jvkr's icon

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.

josha's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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.

4088.record2a
record2a
spectro's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

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...

josha's icon

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?

spectro's icon

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.

josha's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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?