write-sdif-file
allows writing a list of time-tagged SDIFFRAME
objects into a new file.
The SIDF types of every frame, and of every matrix in the frames must be either in the SDIF standard types, or declared with the
types
input with a list ofSDIFTYPE
objects.
Name-value tables containing meta-data can also be included to the file with
SDIFNVT
objects connected to thenvts
input.
Similar to open-file-stream
, open-SDIF-stream
opens and returns a “stream” to a file (designated using a pathname), which can be used to incrementally write SDIF data.
Before anything, it is necessary to write the SDIF file header with sdif-write-header
. Optional inputs options allow declaring SDIF types, name-value tables, or stream descriptors:
types
: a list ofSDIFTYPE
objects.nvts
: a list of SDIFNVT
objects.sids
: a list of stream descriptors of the form (ID name description)
where ID is a number (the stream ID), name
is a string, and descritpion
is a “tree” (also a string, describing the purpose or “target” of the data un URL-style, e.g. "a/b/c"
).Once the SDIF header is written, frames (SDIFFRAME
objects) can be added in the files one by one with sdif-write-frame
.
The “file stream” opened and returned by
open-SDIF-stream
can be closed withclose-SDIF-stream
when no more read or write operations need to be done to the file.
→ See also how to do this in a loop in the See also the
sdif-write-loop
help-patch.
As a complement to dedicated file-reading tools, a number of dedicated functions help writing SDIF files from OM# objects:
bpf->sdif
saves a BPF
object as SDIF. The type of frames/matrices can be specified (and declared if necessary) using additional inputs if the function.The
scope
parameter ofbpf->sdif
determines whether the x-dimension of the BPF should be considered as time (default) or as the elements in a single matrix.
chord-seq->sdif
saves a list of times as 1MRK
/1TRC
frames in a new SDIF file.
markers->sdif
saves a list of times as empty 1MRK
frames in a new SDIF file.
→ See also the
sdif-write-objects
help-patch.