recalling values after patch is closed..help neede.

Jun 19, 2012 at 10:13am

recalling values after patch is closed..help neede.

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. –
#46154
Jun 19, 2012 at 10:26am

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

#166242
Jun 19, 2012 at 2:09pm

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. –
#166243
Jun 19, 2012 at 6:04pm

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

#166244
Jun 19, 2012 at 6:49pm

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

J

#166245
Jun 24, 2012 at 8:34pm

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. –
#166246
Jun 24, 2012 at 8:53pm

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

– Pasted Max Patch, click to expand. –
#166247
Jun 25, 2012 at 8:41am

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
#166248
Jun 25, 2012 at 9:22am

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.

#166249
Jun 25, 2012 at 10:24am

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
#166250
Jun 25, 2012 at 10:28am

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. –
#166251
Jun 25, 2012 at 10:47am

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?

#166252
Jun 25, 2012 at 10:55am

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.

#166253
Jul 3, 2012 at 11:34am

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. –
#166254

You must be logged in to reply to this topic.