outrg

outrg — Allow output to a range of adjacent audio channels on the audio output device

Description

outrg outputs audio to a range of adjacent audio channels on the audio output device.

Syntax

outrg kstart, aout1 [,aout2, aout3, ..., aoutN]

Performance

kstart - the number of the first channel of the output device to be accessed (channel numbers starts with 1, which is the first channel)

aout1, aout2, ... aoutN - the arguments containing the audio to be output to the corresponding output channels.

outrg allows to output a range of adjacent channels to the output device. kstart indicates the first channel to be accessed (channel 1 is the first channel). The user must be sure that the number obtained by summing kstart plus the number of accessed channels -1 is <= nchnls.

Examples

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

Example 722. Example of the outrg 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 outrg.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 4        ;quad
0dbfs  = 1

instr 1

kleft init 1
asig  vco2 .5, 220			;sawtooth
idur = p3/(nchnls-1)
knext init idur
kpos init 0
krate init 1/idur
kbase init 0
ktime timeinsts
if ktime>=knext then
  kleft = kleft + 1
  knext = knext + idur
  kpos = 0
  kbase = ktime
else
  kpos = (ktime-kbase)/idur
endif
printks "speaker %d position %f\n", 0, kleft, kpos
a1,a2 pan2 asig, kpos
      outrg  kleft, a1, a2
kpos = kbase/idur
endin

</CsInstruments>
<CsScore>

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


Its output should include lines like these:

speaker 1 position 0.000200
speaker 1 position 0.000400
speaker 1 position 0.000600
.....
speaker 1 position 1.000000
speaker 2 position 0.000000
speaker 2 position 0.000200
....
speaker 2 position 0.999800
speaker 3 position 0.000000
speaker 3 position 0.000200
....
speaker 3 position 0.999600
speaker 4 position 0.000000
.....

See also

Signal Output

Credits

Author: Gabriel Maldonado

New in version 5.06