Use Non-Frames Version Previous Page Next Page
Signal Input and Output: File I/O

dumpk, dumpk2, dumpk3, dumpk4, readk, readk2, readk3, readk4

                   dumpk     ksig, ifilname, iformat, iprd
                   dumpk2    ksig1, ksig2, ifilname, iformat, iprd
                   dumpk3    ksig1, ksig2, ksig3, ifilname, iformat, iprd
                   dumpk4    ksig1, ksig2, ksig3, ksig4, ifilname, iformat, iprd
  ksig             readk     ifilname, iformat[, ipol]
  k1, k2           readk2    ifilname, iformat[, ipol]
  k1, k2, k3       readk3    ifilname, iformat[, ipol]
  k1, k2, k3, k4   readk4    ifilname, iformat[, ipol]

Description

Periodically write orchestra control-signal values to a named external file in a specific format.

Initialization

ifilname - character string(in double quotes, spaces permitted ) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory

iformat - specifies the output data format:

Note that A-law and U-law output are not available, and that all formats except the lsat two are binary. The output file contains no header information.

iprd - the period of ksig output i seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.

ipol (optional) - if non-zero, and iprd implies more than one control period, interpolate the k- signals between the periodic reads from the external file. The default value is 0 (repeat each signal between frames). Currently not supported.

Performance

These units allow up to four generated control signal values to be read or saved in a named external file. The file contains no self-defining header information, but is a regularly sampled time series, suitable for later input or analysis. There may be any number of readk units in an instrument or orchestra, and they may read from the same or different files. There may be any number of dumpk units in an instrument or orchestra, but each must write to a different file.

Opcode History

dumpk opcodes were originally called kdump. As of Csound version 3.493 that name is deprecated. dumpk should be used instead of kdump. The readk opcodes were originally called kread, but were not implemented until Csound version 3.52. However, the optional readk argument, ipol is ignored. This situation is expected to be corrected in a later release.

Example

  knum    =         knum+1                                               ; at each k-period
  ktemp   tempest   krms, .02, .1, 3, 2, 800, .005, 0, 60, 4, .1, .995   ;estimate the tempo
  koct    specptrk  wsig, 6, .9, 0                                       ;and the pitch
          dumpk3    knum, ktemp, cpsoct(koct), "what happened when", 8 0 ;& save them

Use Non-Frames Version Previous Page Next Page
Signal Input and Output: File I/O