vibrato — Generates a natural-sounding user-controllable vibrato.
kout vibrato kAverageAmp, kAverageFreq, kRandAmountAmp, kRandAmountFreq, kAmpMinRate, kAmpMaxRate, kcpsMinRate, kcpsMaxRate, ifn [, iphs
ifn -- Number of vibrato table. It normally contains a sine or a triangle wave.
iphs -- (optional) Initial phase of table, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is 0.
kAverageAmp -- Average amplitude value of vibrato
kAverageFreq -- Average frequency value of vibrato (in cps)
kRandAmountAmp -- Amount of random amplitude deviation
kRandAmountFreq -- Amount of random frequency deviation
kAmpMinRate -- Minimum frequency of random amplitude deviation segments (in cps)
kAmpMaxRate -- Maximum frequency of random amplitude deviation segments (in cps)
kcpsMinRate -- Minimum frequency of random frequency deviation segments (in cps)
kcpsMaxRate -- Maximum frequency of random frequency deviation segments (in cps)
vibrato outputs a natural-sounding user-controllable vibrato. The concept is to randomly vary both frequency and amplitude of the oscillator generating the vibrato, in order to simulate the irregularities of a real vibrato.
In order to have a total control of these random variations, several input arguments are present. Random variations are obtained by two separated segmented lines, the first controlling amplitude deviations, the second the frequency deviations. Average duration of each segment of each line can be shortened or enlarged by the arguments kAmpMinRate, kAmpMaxRate, kcpsMinRate, kcpsMaxRate, and the deviation from the average amplitude and frequency values can be independently adjusted by means of kRandAmountAmp and kRandAmountFreq.
Here is an example of the vibrato opcode. It uses the file vibrato.csd.
Example 1199. Example of the vibrato 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 vibrato.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> sr = 44100 ksmps = 32 nchnls = 2 0dbfs = 1 instr 1 kaverageamp init .5 kaveragefreq init 5 krandamountamp line p4, p3, p5 ;increase random amplitude of vibrato krandamountfreq init .3 kampminrate init 3 kampmaxrate init 5 kcpsminrate init 3 kcpsmaxrate init 5 kvib vibrato kaverageamp, kaveragefreq, krandamountamp, krandamountfreq, kampminrate, kampmaxrate, kcpsminrate, kcpsmaxrate, 1 asig poscil .8, 220+kvib, 1 ;add vibrato outs asig, asig endin </CsInstruments> <CsScore> f 1 0 16384 10 1 ;sine wave i 1 0 15 .01 20 e </CsScore> </CsoundSynthesizer>