lorisplay

lorisplay — renders a stored set of bandwidth-enhanced partials using the method of Bandwidth-Enhanced Additive Synthesis implemented in the Loris software, applying control-rate frequency, amplitude, and bandwidth scaling envelopes.

Syntax

ar lorisplay ireadidx, kfreqenv, kampenv, kbwenv

Description

lorisplay renders a stored set of bandwidth-enhanced partials using the method of Bandwidth-Enhanced Additive Synthesis implemented in the Loris software, applying control-rate frequency, amplitude, and bandwidth scaling envelopes.

Initialization

istoreidx, ireadidx, isrcidx, itgtidx are labels that identify a stored set of bandwidth-enhanced partials. lorisread imports partials from a SDIF file and stores them with the integer label istoreidx. lorismorph morphs sets of partials labeled isrcidx and itgtidx, and stores the resulting partials with the integer label istoreidx. lorisplay renders the partials stored with the label ireadidx. The labels are used only at initialization time, and may be reused without any cost or benefit in efficiency, and without introducing any interaction between instruments or instances.

Performance

lorisplay implements signal reconstruction using Bandwidth-Enhanced Additive Synthesis. The control data is obtained from a stored set of bandwidth-enhanced partials imported from an SDIF file using lorisread or constructed by another unit generator such as lorismorph. kfreqenv is a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave. kampenv is a control-rate scale factor that is applied to all partial amplitude envelopes. kbwenv is a control-rate scale factor that is applied to all partial bandwidth or noisiness envelopes. The bandwidth-enhanced partial data is stored in memory with a specified label for future access by another generator.

Examples

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

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

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1
; clarinet.sdif can be found in /manual/examples

; Play the partials in clarinet.sdif from 0 to 3 sec with 1 ms fadetime
; and no frequency , amplitude, or bandwidth modification.

instr 1

ktime	linseg	  0, p3, 3.0			; linear time function from 0 to 3 seconds
	lorisread ktime, "clarinet.sdif", 1, 1, 1, 1, .001
kfrq	= p4	; pitch shifting
asig	lorisplay 1, kfrq, 1, 1
	outs 	  asig, asig
endin

; Play the partials in clarinet.sdif from 0 to 3 sec with 1 ms fadetime
; adding tuning and vibrato, increasing the "breathiness" (noisiness) and overall
; amplitude, and adding a highpass filter.

instr 2

ktime	linseg	0, p3, 3.0			; linear time function from 0 to 3 seconds
						; compute frequency scale for tuning
    
ifscale	=	cpspch(p4)/cpspch(8.08)		; (original pitch was G#4)
						; make a vibrato envelope
kvenv	linseg	0, p3/6, 0, p3/6, .02, p3/3, .02, p3/6, 0, p3/6, 0
kvib	oscil	kvenv, 4, 1			; table 1, sinusoid
kbwenv	linseg	1, p3/6, 1, p3/6, 100, 2*p3/3, 100 ;lots of noise
	lorisread ktime, "clarinet.sdif", 1, 1, 1, 1, .001
a1	lorisplay 1, ifscale+kvib, 2, kbwenv
asig	atone	a1, 1000			; highpass filter, cutoff 1000 Hz
	outs	asig, asig
endin

</CsInstruments>
<CsScore>
; a sinusoid 
f 1 0 4096 10 1

i 1  0   3  1.2	; shifted up
i 1  +   1  1.5
i 1  +   6  .5	; shifted down
s

;     strt   dur   ptch
i 2      1    3    8.08
i 2      3.5  1    8.04
i 2      4    6    8.00
i 2      4    6    8.07
e

</CsScore>
</CsoundSynthesizer>


Credits

This implementation of the Loris unit generators was written by Kelly Fitz (loris@cerlsoundgroup.org). It is patterned after a prototype implementation of the lorisplay unit generator written by Corbin Champion, and based on the method of Bandwidth-Enhanced Additive Synthesis and on the sound morphing algorithms implemented in the Loris library for sound modeling and manipulation. The opcodes were further adapted as a plugin for Csound 5 by Michael Gogins.