New opcode: sndload

(note: there is also another new opcode for which the manual will be
posted later. It is possible that these opcodes will be changed until
the 5.03 release)

        sndload Sfname[, ifmt[, ichns[, isr[, ibas[, iamp[, istrt  
                [, ilpmod[, ilps[, ilpe]]]]]]]]]

DESCRIPTION
———–

sndload loads a sound file into memory for use by loscilx.

INITIALIZATION
————–

Sfname – file name as a string constant or variable, string p-field, or
    a number that is used either as an index to strings set with strset,
    or, if that is not available, a fine name in the format soundin.n is
    used. If the file name does not include a full path, the file is
    searched in the current directory first, then those specified by
    SSDIR (if defined), and finally SFDIR. If the same file was already
    loaded previously, it will not be read again, but the parameters
    ibas, iamp, istrt, ilpmod, ilps, and ilpe are still updated.

ifmt (optional, defaults to zero) – default sample format for raw
    (headerless) sound files; if the file has a header, this is
    ignored. Can be one of the following:

      -1: do not allow headerless files (fail with an init error)
       0: use the same format as the one specified on the command line
       1: 8 bit signed integers
       2: a-law
       3: u-law
       4: 16 bit signed integers
       5: 32 bit signed integers
       6: 32 bit floats
       7: 8 bit unsigned integers
       8: 24 bit signed integers
       9: 64 bit floats

ichns (optional, defaults to zero) – default number of channels for raw
    (headerless) sound files; if the file has a header, this is
    ignored. Zero or negative values are interpreted as 1 channel.

isr (optional, defaults to zero) – default sample rate for raw
    (headerless) sound files; if the file has a header, this is
    ignored. Zero or negative values are interpreted as the orchestra
    sample rate (sr).

ibas (optional, defaults to zero) – base frequency in Hz. If positive,
    overrides the value specified in the sound file header; otherwise,
    the value from the header is used if present, and 1.0 if the file
    does not include such information.

iamp (optional, defaults to zero) – amplitude scale. If non-zero,
    overrides the value specified in the sound file header (note:
    negative values are allowed, and will invert the sound output);
    otherwise, the value from the header is used if present, and 1.0 if
    the file does not include such information.

istrt (optional, defaults to -1) – starting position in sample frames,
    can be fractional. If non-negative, overrides the value specified
    in the sound file header; otherwise, the value from the header is
    used if present, and 0 if the file does not include such
    information. Note: even if this parameter is specified, the whole
    file is still read into memory.

ilpmod (optional, defaults to -1) – loop mode, can be one of the
    following:

      any negative value: use the loop information specified in the
          sound file header, ignoring ilps and ilpe
      0: no looping (ilps and ilpe are ignored)
      1: forward looping (wrap around loop end if it is crossed in
         forward direction, and wrap around loop start if it is
         crossed in backward direction)
      2: backward looping (change direction at loop end if it is
         crossed in forward direction, and wrap around loop start if it
         is crossed in backward direction)
      3: forward-backward looping (change direction at both loop points
         if they are crossed as described above)

ilps (optional, defaults to 0) – loop start in sample frames
    (fractional values are allowed), or loop end if ilps is greater
    than ilpe. Ignored unless ilpmod is set to 1, 2, or 3. If the loop
    points are equal, the whole sample is looped.

ilpe (optional, defaults to 0) – loop end in sample frames (fractional
    values are allowed), or loop start if ilps is greater than ilpe.
    Ignored unless ilpmod is set to 1, 2, or 3. If the loop points are
    equal, the whole sample is looped.

voice

voice

voice ― 음성 만들기

Syntax

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

Initialization

ifn, ivfn — 2개의 table number로 carrier waveform 과  vibrato waveform이 요구된다.   아래의 files인  impuls20.aiff, ahh.aiff, eee.aiff, ooo.aiff 가 carrier로 적합하고 sine wave가 vibrato wave로 사용될 수 있다. 이 파일들은 요기에서 다운로드 가능
ftp://ftp.cs.bath.ac.uk/pub/dream/documentation/sounds/modelling/.

Performance

kamp — Amplitude

kfreq — 소리날 음의 Frequency (변화가능)

kphoneme — 0~16의 정수로서 formant를 결정

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

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

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

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

아래의 것들은 아직 불가능함.

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

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

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

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

kform — Gain(0.0~1.2)

kvibf — vibrato의 frequency  (0~12Hertz가 적당)

kvamp — vibrato의amplitude

Examples

Here is an example of the voice opcode. It uses the files voice.orc, voice.sco, and impuls20.aiff.

Example 417. Example of the voice opcode.

/* voice.orc */
; 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
endin
/* voice.orc */

        
/* voice.sco */
; 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
e
/* voice.sco */

        

Credits

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

Example written by Kevin Conder.

New in Csound version 3.47

new opcodes

A number of streaming partial track processing opcodes
have been added to Csound5 sources in CVS. These should
be available in the next binary release. Manual pages have
also been added to the manual CVS repository.

Here’s a summary of additions:

fsig  trscale    fin, kscl[, kgain]

Frequency scaling (pitch-shifting).

fsig  trshift     fin,kshift[,kgain]

Frequency shifting.

fsig1, fsig2  trsplit      fin,ksplit[,kgain1, kgain2]

Track splitting.

fsig   trmix   fin1,fin2

Track mixing.

fsig, kfreq,kamp   trhighest   fin, kgain

Extracts highest track.

fsig,kfreq,kamp  trlowest   fin,kgain

Extracts lowest track.

fsig    trfilter   fin,kamnt, ifn

Filters tracks using amplitude response on a function-table

fsig   trcross    fin1, fin2, ksrch, kdepth [, kmode]

Cross-synthesis of tracks (ksrch is ‘search interval ratio’)

fsig   binit   fin, ifftsize

Creates an amp-freq bin-frame from a tracks input.

More details & examples on the manual pages.

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth