Skip to content

linslide

Change values in a channel over time.

Syntax

linslide Schan, idur, idest [, idel] [, itype] [, iendreset] [, initval]
linslide(Schan, idur, idest [, idel] [, itype] [, iendreset] [, initval])

Usage

linslide updates a channel (Schan) to move from the channel's current value to reach a destination value over a period of time.

If linslide is re-evaluated, then any currently running linslide action on the specified channel is replaced by the new instance.


Outputs and arguments

Schan -- Output Channel name. linslide doesn't have a k-rate output. Instead it updates values in this channel.

idur -- Duration (in tempodur beats) to reach idest.

idest -- Destination value

idel (optional, default=1) -- linslide starts motion on the next idel beats.

itype (optional, default=0) -- curve type as per the Csound transeg itype. Default is linear.

iendreset (optional, default=0) -- When non-zero the channel value returns to initval on release.

initval (optional, default=current Schan value) -- Ignore the current Schan value and set an initial value to start from.

Example

See the example for linslide.orc

linslide
instr Sound101
  ;; Sound source
  ares vco2 p4,p5
  kfr = chnget:k("vcf")
  ares moogladder2 ares,kfr,0.7
  ares declickr ares,0.0001,0.0008
send ares
endin

patchsig "Sound101", "outs"
;; connect sound to output.

loopevent fillarray_i(n("Sound101"),0,1/12,0.5,0), fillarray_i(-2,0,2,-2,0,3,-2,0,4) - 7, fillarray_i(1/8),1,-1,0.65,1/3
;; generate events.

instr Sched14
  idest = random:i(150,4000)
  ;; choose a random destination.

  linslide "vcf",3,idest
  ;;set the vcf to drift to random values.

  printf_i "destination vcf = %f\n",1,idest

  schedule p1, nextbeat(6), 1
  ;; and around again
turnoff
endin

schedule "Sched14", nextbeat(1),1
;; start the show