port
Prev | Orchestra Opcodes and Operators | Next

## port

port — Applies portamento to a step-valued control signal.

## Description

Applies portamento to a step-valued control signal.

## Syntax

    kres port ksig, ihtim [, isig]

## Initialization

ihtim -- half-time of the function, in seconds.

isig (optional, default=0) -- initial (i.e. previous) value for internal feedback. The default value is 0. Negative value will cause initialization to be skipped and last value from previous instance to be used as initial value for note.

## Performance

kres -- the output signal at control-rate.

ksig -- the input signal at control-rate.

port applies portamento to a step-valued control signal. At each new step value, ksig is low-pass filtered to move towards that value at a rate determined by ihtim. ihtim is the “half-time” of the function (in seconds), during which the curve will traverse half the distance towards the new value, then half as much again, etc., theoretically never reaching its asymptote. With portk, the half-time can be varied at the control rate.

## Examples

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

Example 577. Example of the port opcode.

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

    <CsoundSynthesizer>
    <CsOptions>
    ; 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 port.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    instr 1

    aout  diskin2 "fox.wav",1, 0, 1
    kf,ka ptrack aout, 512	; pitch track with winsize=1024
    kcps  port kf, 0.01	; smooth freq
    kamp  port ka, 0.01	; smooth amp
    ; drive an oscillator
    asig  poscil ampdb(kamp)*0dbfs, kcps, 1
          outs  asig, asig

    endin
    </CsInstruments>
    <CsScore>
    ; simple sine wave
    f 1 0 4096 10 1

    i 1 0  5
    e
    </CsScore>
    </CsoundSynthesizer>

## See Also

areson, aresonk, atone, atonek, portk, reson, resonk, tone, tonek

Prev | Up | Next
pop_f | Home | portk