Re: Saving long array to file
[email protected] Mon, 26 Apr 2021 18:55:43 +0200
| Newsgroups | gmane.comp.audio.supercollider.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, Am 26.04.21 um 17:55 schrieb [email protected]: > Supercollider does this thing where when you write a long array to a file, > it only writes out some of the values of the array, before saying > '...etc...'. For example, if I wanted to save a long array with 1000 values > to a file, it might do something like '[x1, x2, x3, xn, ...etc...'. The > problem with this is that I cannot then access the array from the file, > since those values are lost. Does anybody know a workaround to this issue? You can prevent arrays (or other large data structures) from getting cut off by calling .asCompileString -> myArray.asCompileString.postln; should post the whole array. > > I should also note that what I'm trying to do is save presets of a gui to a > file on my computer, so that I can access those files and they'll set the > parameters of the gui. I've written a GUI class for which I can save presets to disk by writing data to an archive (see the Archive class). In my class I've used myOject.writeTextArchive which isn't an Archive method (but creates an Archive, I think). If you like, have a look at my class: https://github.com/nuss/CVCenter/blob/master/CVCenter/CVCenter.sc#L1713 ... maybe that gives you an idea. Best, Stefan _______________________________________________ sc-users mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: http://www.listarc.bham.ac.uk/marchives/sc-users/ search: http://www.listarc.bham.ac.uk/lists/sc-users/search/