part2txt — Write a text file containing partial tracks data


The part2txt opcode takes a PVS_TRACKS fsig input and writes the data as sequence of track lists, one for each time point, to a line-oriented text file. Each track is placed on a separate line containing the amplitude, frequency, phase, and track ID. A separator line containing four -1.0 values is used to define the end of the track list for a given time point.


part2txt SFile,ftrks


SFile -- output filename


ftrks -- output pv stream in TRACKS format


Here is an example of the part2txt opcodes. It uses the file part2txt.csd.

Example 746. Example of the part2txt opcodes.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.


instr 1
isiz = 2048
ihsiz = isiz/4
S1 = "flutec3.wav"
p3 = filelen(S1)
ain diskin2 S1,1
ffr,fphs  pvsifd   ain, isiz, ihsiz, 1
ftrk      partials ffr, fphs, 0.01, 1, 1, 500
part2txt "partialsh.txt",ftrk

i1 0 1

The example above shows partial tracking of an ifd-analysis signal and cubic-phase additive resynthesis with pitch shifting.

See also

Tools for Real-time Spectral Processing (pvs opcodes)


Author: Victor Lazzarini
June 2015