trsplit — Streaming partial track frequency splitting.


The trsplit opcode takes an input containg a TRACKS pv streaming signal (as generated, for instance by partials) and splits it into two signals according to a k-rate frequency 'split point'. The first output will contain all tracks up from 0Hz to the split frequency and the second will contain the tracks from the split frequency up to the Nyquist. It can also, optionally, scale the gain of the output signals by a k-rate amount (default 1). The result is two output signals containing only part of the original spectrum.


fsiglow, fsighi trsplit fin, ksplit[, kgainlow, kgainhigh]


fsiglow -- output pv stream in TRACKS format containing the tracks below the split point.

fsighi -- output pv stream in TRACKS format containing the tracks above and including the split point.

fin -- input pv stream in TRACKS format

ksplit -- frequency split point in Hz

kgainlow, kgainhig -- amplitude scaling of each one of the outputs (default 1).


Here is an example of the trsplit opcode. It uses the file trsplit.csd.

Example 1155. Example of the trsplit opcode.

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

; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o trsplit.wav -W ;;; for file output any platform

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

ain	 diskin2 "drumsMlp.wav", 1
fs1,fsi2 pvsifd  ain, 2048, 512, 1		; ifd analysis
fst	 partials fs1, fsi2, .003, 1, 3, 500	; partial tracking
fslo,fshi trsplit fst, 1500			; split partial tracks at 1500 Hz
aout	 tradsyn fshi, 1, 1, 500, 1	; resynthesis of tracks above 1500Hz
         outs aout, aout

f1 0 8192 10 1	;sine

i 1 0 2

The example above shows partial tracking of an ifd-analysis signal and linear additive resynthesis of the upper part of the spectrum (from 1500Hz).

See also

Tools for Real-time Spectral Processing (pvs opcodes)


Author: Victor Lazzarini
February 2006

New in Csound 5.01