voice — An emulation of a human voice.


An emulation of a human voice.


ares voice kamp, kfreq, kphoneme, kform, kvibf, kvamp, ifn, ivfn


ifn, ivfn -- two table numbers containing the carrier waveform and the vibrato waveform. The files impuls20.aiff, ahh.aiff, eee.aiff, or ooo.aiff are suitable for the first of these, and a sine wave for the second. These files are available from ftp://ftp.cs.bath.ac.uk/pub/dream/documentation/sounds/modelling/.


kamp -- Amplitude of note.

kfreq -- Frequency of note played. It can be varied in performance.

kphoneme -- an integer in the range 0 to 16, which select the formants for the sounds:

  • eee”, “ihh”, “ehh”, “aaa”,

  • ahh”, “aww”, “ohh”, “uhh”,

  • uuu”, “ooo”, “rrr”, “lll”,

  • mmm”, “nnn”, “nng”, “ngg”.

At present the phonemes

  • fff”, “sss”, “thh”, “shh”,

  • xxx”, “hee”, “hoo”, “hah”,

  • bbb”, “ddd”, “jjj”, “ggg”,

  • vvv”, “zzz”, “thz”, “zhh

are not available (!)

kform -- Gain on the phoneme. values 0.0 to 1.2 recommended.

kvibf -- frequency of vibrato in Hertz. Suggested range is 0 to 12

kvamp -- amplitude of the vibrato


Here is an example of the voice opcode. It uses the file voice.csd, and impuls20.aiff.

Example 502. Example of the voice opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; Select audio/midi flags here according to platform
; Audio out   Audio in    No messages
-odac           -iadc     -d     ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o voice.wav -W ;;; for file output any platform

; Initialize the global variables.
sr = 22050
kr = 2205
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  kamp = 3
  kfreq = 0.8
  kphoneme = 6
  kform = 0.488
  kvibf = 0.04
  kvamp = 1
  ifn = 1
  ivfn = 2

  av voice kamp, kfreq, kphoneme, kform, kvibf, kvamp, ifn, ivfn

  ; It tends to get loud, so clip voice's amplitude at 30,000.
  a1 clip av, 2, 30000
  out a1


; Table #1, an audio file for the carrier waveform.
f 1 0 256 1 "impuls20.aiff" 0 0 0
; Table #2, a sine wave for the vibrato waveform.
f 2 0 256 10 1

; Play Instrument #1 for a half-second.
i 1 0 0.5



Author: John ffitch (after Perry Cook)
University of Bath, Codemist Ltd.
Bath, UK

Example written by Kevin Conder.

New in Csound version 3.47