Hi!
I’ve found that you can read/write any Object
from/to a file directly with .readArchive
and .writeArchive
.
However, the output of Array
and Signal
is pretty different.
Array.fill(10,{1.0.rand}).writeArchive("somePath/ArraySC.txt");
produces
var o, p;
o = [
Array.prNew(10)
];
p = [
// Array
0, [ 0.74801242351532, 0.87406754493713, 0.64634370803833, 0.055408000946045,
0.62177062034607, 0.73370254039764, 0.3752326965332, 0.61893105506897,
0.30372893810272, 0.010981678962708 ]
];
prUnarchive(o,p);
while
Signal.chebyFill(10, [1]).writeArchive("somePath/ArraySC.txt");
produces
Signal[ -1.0, -0.77777779102325, -0.55555558204651, -0.33333334326744, -0.11111111193895, 0.11111111193895, 0.33333334326744, 0.55555558204651, 0.77777779102325, 1.0 ]
Are these methods legacy ones? Is there a straight forward way to write almost all kinds of data (buffers, wavetables, arrays, signals, multichannel signals, etc) into files? By this I mean using only one method for all data types.