I am new to Pd so please excuse any misconceptions.
I'm trying to read in a file containing a sinusoidal analysis, to provide control for additive synthesis. My patch creates a set of arrays (tables) for the frequency and magnitude values for as many partials as are described in the analysis file (which is generated by a separate program) via messages like [; pd-graph1 array $1-freqArray 100 float 0( . $1 comes from a counter which is reset when I read in a new file.
But once I create an array, it never goes away, and I end up with an ever increasing number of tables named 0-freqArray etc.
How can I delete arrays with a message (as opposed to having to open a dialog box for each one and click the "delete me" flag)? Really, all I want to be able to do is delete all existing arrays each time I am about to read a new analysis file. Is there a message for this?
I tried [; pd-array clear ( which I saw somewhere in the forums, but it just gave me "error: pd-array: no such object".
Thanks, DAn.
Hallo, Dan Ellis hat gesagt: // Dan Ellis wrote:
I'm trying to read in a file containing a sinusoidal analysis, to provide control for additive synthesis. My patch creates a set of arrays (tables) for the frequency and magnitude values for as many partials as are described in the analysis file (which is generated by a separate program) via messages like [; pd-graph1 array $1-freqArray 100 float 0( . $1 comes from a counter which is reset when I read in a new file.
But once I create an array, it never goes away, and I end up with an ever increasing number of tables named 0-freqArray etc.
If you only need one array, why not just create that statically (personally I prefer the [table] object for data, I don't need to see), then load its content with "read"/"write" messages?
Example:
[table MyArray 100]
[read /tmp/data1.txt( | [s MyArray]
[read /tmp/data2.txt( | [s MyArray]
...
The textfiles should just contain the array contents, one number per line. Check out the file 15.array.pd and 16.more.arrays.pd in the docs for more on table manipulation.
Frank
I'm trying to read in a file containing a sinusoidal analysis, to provide control for additive synthesis. My patch creates a set of arrays (tables) for the frequency and magnitude values for as many partials as are described in the analysis file (which is generated by a separate program) via messages like [; pd-graph1 array $1-freqArray 100 float 0( . $1 comes from a counter which is reset when I read in a new file.
But once I create an array, it never goes away, and I end up with an ever increasing number of tables named 0-freqArray etc.
If you only need one array, why not just create that statically (personally I prefer the [table] object for data, I don't need to see), then load its content with "read"/"write" messages?
Example:
[table MyArray 100]
[read /tmp/data1.txt( | [s MyArray]
[read /tmp/data2.txt( | [s MyArray]
...
The textfiles should just contain the array contents, one number per line. Check out the file 15.array.pd and 16.more.arrays.pd in the docs for more on table manipulation.
If you need to "clean" the array at some point you can always send a [resize 1( which will also "wipe" it.
[resize 0( | [s MyArray]
(maybe there's a more finesse way of doing this though?)
Lorenzo
hi
put all arrays into a subpatch wich means [pd subpatch]
message clear | s pd-subpatch
everything in the subpatch will be deleted
best regards der.brandt
I am new to Pd so please excuse any misconceptions.
I'm trying to read in a file containing a sinusoidal analysis, to provide control for additive synthesis. My patch creates a set of arrays (tables) for the frequency and magnitude values for as many partials as are described in the analysis file (which is generated by a separate program) via messages like [; pd-graph1 array $1-freqArray 100 float 0( . $1 comes from a counter which is reset when I read in a new file.
But once I create an array, it never goes away, and I end up with an ever increasing number of tables named 0-freqArray etc.
How can I delete arrays with a message (as opposed to having to open a dialog box for each one and click the "delete me" flag)? Really, all I want to be able to do is delete all existing arrays each time I am about to read a new analysis file. Is there a message for this?
I tried [; pd-array clear ( which I saw somewhere in the forums, but it just gave me "error: pd-array: no such object".
Thanks, DAn.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list