How to record multiple data streams into a single SDIF-file using ftm.sdif.write?

From ftm

Q: How do I record 3 separate data streams into a single SDIF-file using ftm.sdif.write? I don't fully understand the syntax of the open and define messages to ftm.sdif.write. Do I have to define both the frame and matrix, or could I do with either? (Alexander Refsum Jensenius)

A: To clarify, there's the definition of the types (1MTD/1FTD), and the declaration to ftm.sdif.write that they shall be written. I urge you to stick to the convention of using X... for private experimental types.

For the declaration, if the frame and matrix signature is the same (highly recommended), then only one suffices, and you can give it as args to the ftm.sdif.write external (as in this corrected patch):

   [ftm.sdif.write XMID 0 XXYZ 1 XPOL 2]

with a simple

   "open /tmp/testfile3.sdif"

or as framespec fs-short as in:

   "open /tmp/testfile3.sdif XMID 0 XXYZ 1 XPOL 2"

If you insist on using distinct signatures, you have to use the framespec fs-long (defined in ftm.sdif.write.help):

   "open /tmp/testfile2.sdif { FMID 0 MMID } { FXYZ 1 MXYZ } { FPOL 2 MPOL }"

BTW, the midi type is already in the standard as:

   1MTD 1MID { Status, Data1, Data2 }
   1MTD 1SYX { Data }
   1FTD 1MID { 1MID MIDIEvent; 1SYX MIDISystemExclusive;  }

BTW2: Another convention is to give a key TableName to your NVT, then you can access it directly with ftm.sdif.info.


Example Patch: Media:write multi-stream 3.pat