Skip to content

patchsig

Route audio between instruments.

Syntax

patchsig Ssource, SDestination [ ,ilevel/Slevel]
patchsig(Ssource, SDestination [ ,ilevel/Slevel])

Usage

graph LR
  A[Source] --> B[Destination]

patchsig routes audio output from one instrument to the input of another. The destination must have inputs such as an 'Effect' instrument or the global output. patchsig works in conjunction with the send UDO, used within instruments. send sends audio to a global audio array. patchsig gets the audio and delivers it to inputs of the destination instrument.

Channel assignments (e.g. 'left' output, or 'right' input) are automated. patchsig alternates the distribution of audio output channels to all input channels, thus a mono instrument output will have it's output copied to each input of a stereo Effect. A stereo source to a 4-channel Effect will have the left channel patched to inputs 1 & 3, and the right channel to channels 2 and 4.

Re-patching to different instruments live in performance is also possible: patchsig takes care of any required 'disconnections'.

There is no restriction on the order of instruments connected by patchsig, however a k-period delay between instruments may be introduced if a higher numbered instrument is patched to a lower numbered one.


Arguments

Ssource -- String name of the instrument sending audio

SDestination -- String name of the instrument receiving audio. These should be 'Effect' instruments with audio inputs. (See EffectConstruct)

  • "outs" is available as a destination, and sends audio to the output.

ilevel (optional, default=1) -- An amplitude multiplier applied to the Destination output.

Slevel (optional, alternative to ilevel) -- When using a string Slevel will read a channel name to retrieve the multiplier.

Example

patchsig.orc

patchsig
instr Sound101
  ;; Sound source

 ares pluck p4,p5,p5,0,1

send ares
endin

loopevent fillarray_i(n("Sound101"),0,0.75,0.5,0), genarray(0,14,1.333) - 7, euclidean_i(9,5,1),1,-1,0.83
;; generate events


EffectConstruct "flange", {{
ain = ains[0]

aout1 flanger ain, oscil:a(0.001,1/3)+0.003,0.4

aouts[] fillarray aout1
}},1,1
;; Flange effect


EffectConstruct "stereospread", {{
ain = ains[0]

aout1 vdelayx ain, oscil:a(0.01,0.3)+(1/3), 0.5, 1024
aout2 vdelayx ain, oscil:a(0.01,0.21)+(1/3), 0.5, 1024

aouts[] fillarray aout1, aout2
}},1,2,1
;; Stereo effect


patchsig "Sound101", "flange"
patchsig "flange", "stereospread"
patchsig "stereospread", "outs"
;; Source source to flange, flange to stereo effect, stereo effect to output.