spsend — Generates output signals based on a previously defined space opcode.
spsend depends upon the existence of a previously defined space. The output signals from spsend are derived from the values given for xy and reverb in the space and are ready to be sent to local or global reverb units (see example below).
The configuration of the xy coordinates in space places the signal in the following way:
a1 is -1, 1
a2 is 1, 1
a3 is -1, -1
a4 is 1, -1
This assumes a loudspeaker set up as a1 is left front, a2 is right front, a3 is left back, a4 is right back. Values greater than 1 will result in sounds being attenuated, as if in the distance. space considers the speakers to be at a distance of 1; smaller values of xy can be used, but space will not amplify the signal in this case. It will, however balance the signal so that it can sound as if it were within the 4 speaker space. x=0, y=1, will place the signal equally balanced between left and right front channels, x=y=0 will place the signal equally in all 4 channels, and so on. Although there must be 4 output signals from space, it can be used in a 2 channel orchestra. If the xy's are kept so that Y>=1, it should work well to do panning and fixed localization in a stereo field.
Here is a stereo example of the spsend opcode. It uses the file spsend.csd.
Example 991. Example of the spsend 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 spsend.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> sr = 44100 ksmps = 32 0dbfs = 1 nchnls = 2 ;stereo output ga1 init 0 ga2 init 0 instr 1 ;sends different amounts to reverb irev = p6 asig diskin2 "fox.wav", 1 a1, a2, a3, a4 space asig, 0, 0, irev, p4, p5 ;take position values from p4, p5 ar1, ar2, ar3, ar4 spsend ;send to reverb ga1 = ga1+ar1 ga2 = ga2+ar2 outs a1, a2 endin instr 99 ; reverb instrument a1 reverb2 ga1, 2.5, .5 a2 reverb2 ga2, 2.5, .5 outs a1, a2 ga1=0 ga2=0 endin </CsInstruments> <CsScore> ;WITH REVERB ;place the sound in the left speaker and near i1 0 1 -1 1 .1 ;place the sound in the right speaker and far i1 1 1 45 45 .1 ;place the sound equally between left and right and in the middle ground distance i1 2 1 0 12 .1 ;NO REVERB ;place the sound in the left speaker and near i1 6 1 -1 1 0 ;place the sound in the right speaker and far i1 7 1 45 45 0 ;place the sound equally between left and right and in the middle ground distance i1 8 1 0 12 0 i 99 0 12 ;keep reverb active all the time e </CsScore> </CsoundSynthesizer>