Scaling and transformation objects can't take named file to write?

I was adding a bit to my patch that writes the fits to a file (temporarily as I’m just testing interface stuff) and I realized that fluid.standardize~, fluid.umap~, fluid.robustscale~ (and more) all happily take a write message and pop up a window, but you can’t just say write filename.json or write filename.

I remember mentioning this a while back, but it seemed to me that this was updated(/fixed) so that you can do vanilla stuff like read filename.json without needing an absolute path, but that doesn’t appear to be the case for write commands. Unless the format is different (the help/reference offer no info or example on this).

They don’t take relative paths, but work fine with full paths a la write /tmp/mystandardize.json

If you really need to write to the same path as your patcher then use thispatcher to get its path

1 Like

It’s not happy with an absolute absolute path either:
write "Macintosh HD:/Users/rodrigo/Sync/Projects/FluCoMa/Patches/Toolbox 2/Analysis Abstractions/test_loudness_scale.json"

It needs regexp-ing off of everything before the first /:
write "/Users/rodrigo/Sync/Projects/FluCoMa/Patches/Toolbox 2/Analysis Abstractions/test_loudness_scale.json"

Is there a technical reason for the asymmetry as read appears to be happy with a relative path?

Use conformpath max boot rather than faff around with regex

Yes. The algorithm objects are doing the writing themselves, whereas the Max SDK file writing guidelines are built on the pattern that Max itself is doing the writing and resolves whatever weirdness they do with paths under the hood. The way it does this doesn’t yield a file path as a string (which is what I need to pass back to the algorithm), and I didn’t have the wit when I improved this functionality to work out how to do it.

I’ll come back to this as a lowish priority thing at some point.

1 Like