Return to Main Index for the CDP System.

CDP circles logo

WEDGE – create Csound .orc & .sc to produce texture streams

Contents: Tools to define a multi-stream, multi-event 'wedge'
Usage Description Overview Inputs & Outputs Trajectories
Wedge Streams Event Distribution Other Options The Special Files Applications

Usage

wedge ityp srccnt durfile trajtype framefile fillfile outfile [-tN] [-gN] [-v] [sr] [kr]
Plus options to use the supplementary textfiles (named exactly like this): scanfil, bandwfil, funcdata, and the global files: densdata, scatdata, pwarpfil, and weightfi. These are text files placed in the current directory. The program automatically looks for them and uses them if they are there. Their names are not placed in the command line.

Parameters

itype – instrument type: a negative frequency number or 1 (the latter for sampling – audio – instrument)
srccnt – integer value indicating the number of source soundfiles
durfile – textfile (any name): durations of source soundfiles in seconds; do not include soundfile names.

NOTE that the sound input soundfiles are assumed to be – and MUST be – named: soundin.1, soundin.2 etc. (Atari) or sin1, sin2 etc. (PC) because they will be used by Csound's GEN01. It is best if the input soundfiles all have the same sample rate; differing sample rates are accepted, but the results are more unpredictable.

trajtype – int: enter number for one of the following types of pitch space trajectory:

 1 – linear wedge
 2 – exponential wedge
-1 – linear diswedge (also set SYNCFLAG in the framefile)
-2 – exponential diswedge (also set SYNCFLAG in the framefile)

framefile – textfile (any name) containing the 8 parameters defining the shape of the pitch wedge – see diagram (enter numbers for each parameter on successive lines):

  1. WTHICKNESS – int: final number of streams in wedge – must be a power of 2: 2, 4, 8, 16 ...; the points at which each successive stream-division takes place are called 'nodes'.
  2. WOCTUP – float: 8ve transposition value for top edge of wedge (e.g., 0.5 for {? octave up)
  3. WOCTDN – float: 8ve transposition value for bottom edge of wedge, usually negative (e.g., -0.5 for {? octave down); values relate to proportions of an octave: 0.5 = 6 semitones.
  4. WSTARTTIME – float: time from beginning to first splitting of the streams (> 0.0)
  5. WENDTIME – float: time from beginning of the sound to the end of the splitting of the streams (must be > wstarttime)
  6. WTAIL – float: time from end of wedge expansion to end of sound
  7. WDEC – float: amplitude decimation factor, value between 1 (no decimation) and 2 (safe); a factor of 1.3 is recommended, higher if the sounds have high amplitudes.
  8. SYNCFLAG – int: DISWEDGE only: 1 = synchronised start, 2 = unsynchronised (I don't believe Diswedge works - Ed.)

fillfile – textfile (any name) containing the parameters defining the distribution of events ON the pitch trajectories (enter numbers for each parameter on successive lines):

  1. CATYP – int: cascade type 1 (one voice to many) or 2 (all voices start at time 0); if 1, also give a value for DELPROP (float 0.0 <–> 1.0) for proportional temporal spacing.
  2. REPET – int: number of repeats allowed in the order-sequence of several sounds
  3. SQTYP – int: order-sequence type 1 (random), 2 (random with REPET), 3 (scan list). SQTYP 3 requires and automatically uses the textfiles scanfil (scan_rate time) and bandwfil (bandwidth time) – these filenames only. NB – if SQTYP 3 is used, you must also use TITYP 3.
  4. TITYPE – int: 1 (one source) & 2 (several sources) – proportional timing, and 3, fixed timing. If 3, set ABSDIST (the fixed average time interval between sound events).
outfile – generic name for the Csound orchestra and score output by the program
-t – will call the textfile funcdata (this name only) for truncate or loop operations (time duration_ratio) – 1 = no change, < 1 truncates durations, > 1 loops, extending durations
-gNN is float value optional gain factor; calculate as 32767 divided by the maximum amplitude reported during a Csound compilation.
-v – verbose option
sr – sample rate selection: 48000, 24000, 32000, 44100 (Default), or 22050
kr – control rate (divisor of sample rate) – must give this value if use sample rate other than 44100
densdata – optional file (this name only) with time density pair (1 = no change, > 1 = more dense, < 1 = less dense)
scatdata – optional file (this name only) with time event_scatter pair (0 = no scatter, 1 = max scatter)
pwarpfil – optional file (this name only) with time pitch_warp pair (1 = no change, 2 = octave higher, 0.5 = octave lower)
weightfi – optional file (this name only) with bandindex amplitude pair (bandindex: 0 = top of band, 1 = bottom; amplitude:0 = same, 1 = maximum weighting, 0.5 = mean amplitude)

NOTE that values in the various textfiles for the time parameter relate to the duration of the final wedge-shaped soundfile, which will be WENDTTIME + WTAIL (see diagram).

Diagram of framefile parameters

Diagram: showing the relationship of the Wedge framefile parameters

Return to Wedge Contents

Description

WEDGE is a powerful tool for use in connection with Csound in order to create musical textures. It implies the presence of one or several soundfiles which are placed in pitch and time space in specific ways. WEDGE enables you to define an expanding or contracting texture, and it then writes out the appropriate Csound orchestra and score which will produce it. When you then run Csound with this orchestra and score, the wedge-shaped soundfile is produced. WEDGE introduces a number of automatic functions, including how pitch and time space are defined.

Return to Wedge Contents

On using WEDGE

OVERVIEW

A detailed presentation of the various parameters follows.

Return to Wedge Contents

DEFINING THE INPUTS & OUTPUTS

(1) itype – instrument type

  • Negative frequency – an absolute value (sign disregarded) used as the frequency of a test instrument created by the program. This allows the user to run WEDGE with a simple waveform as a test to observe what happens when the various parameters have been set in a certain way.
  • 1 – sampling instrument: uses the input source soundfiles and prepares for audio output

(2) outfile – this is the generic name of the file for the Csound orchestra and score produced by the program, ready for compilation by Csound
(3) srccnt – the number of source soundfiles
(4) durfile – a textfile (any name) containing the durations of the source soundfiles; the durations are listed in order, one to a line. You may wish to use the Groucho program SNDINFO LEN to get precise soundfile durations. Do not include the names of the soundfiles in durfile

Return to Wedge Contents

DEFINING THE STREAM TRAJECTORIES

(5) trajtype – int: the selection of available pitch shape trajectories (enter the appropriate number):

 1 –  wedge: linear expansion outwards from single stream
 2 –  wedge: exponential expansion outwards from single stream
-1 – diswedge: linear contraction inwards towards single stream (Don't think this works - Ed.)
-2 – diswedge: exponential contraction inwards towards single stream (Don't think this works - Ed.)

Return to Wedge Contents

DEFINING THE WEDGE SHAPE

(6) framefile – a textfile (any name) containing the 8 parameters defining in detail the shape of the pitch trajectories and other attributes of the wedge. Enter the value of the parameters one to a line, in the order that the parameters are listed here; do not include the text name of the parameter. The parameters are as follows:

  1. WTHICKNESS – int: final stream-thickness of wedge in powers of 2: (2 =< wthickness < MAXWEJ); MAXWEJ is defined as 2048 (streams): 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048.
  2. WOCTUP – float: 8ve transposition value to set frequency level of the top edge of the wedge
  3. WOCTDN – float: 8ve transposition value to set frequency level of the bottom edge of the wedge. Note that the thickness of the wedge is calculated as WOCTUP - WOCTDN. E.g., 0.5 - -0.5 = 1 (octave), whereas 0.5 - 0.2 = 0.3 (octave). This is why negative numbers are usually needed.
    [Given these upper and lower frequency limits, the program divides the available frequency space by the final number of streams, each of which will then be equally spaced.]
  4. WSTARTTIME – float: start time of wedge shape after the beginning of the sound (must be > 0.0)
  5. WENDTIME – float: end time of the wedge (must be > wstarttime)
  6. WTAIL – float: duration of sound beyond wedge, i.e., from where the pitch trajectories level out to the end of the sound
  7. WDEC – float: the amplitude decimation factor from one level of the tree to the next. Because the number of streams present is doubling at each of these changes of level, there is a real danger of excessive amplitude build-up. The decimation factor WDEC is used to reduce the amplitude in order to counteract this. The value 2 should handle the worst case, so it should be used when safety seems prudent. < 1 is dangerous: the soundfile may 'blow up'. A factor of about 1.3 should work in most cases, higher if the sounds have a fairly high amplitude level.
  8. SYNCFLAG – (1 or 0) – for DISWEDGE only (trajectory types -1 and -2), 1 = synchronised start, 0 = unsynchronised. In the DISWEDGE shape all the streams are present at the start; this gives the option to synchronise them or not.

Return to Wedge Contents

EVENT DISTRIBUTION ALONG THE WEDGE

(7) fillfile – a textfile (any name) containing the 4 main parameters defining the distribution of sound events along the pitch trajectories. Write fillfile in the same manner as framefile and place in the current directory. The parameters are as follows:
  1. CATYP – (int) which cascade type: chosen from:
    • 1 – for 'wedge' (expanding), when trajtype is 1, linear or 2, exponential): i.e., one voice before the splitting into the wedge, and then the entry of more and more voices at each new level of the tree, OR
    • 1 – 'diswedge' (contracting), when trajtype is -1, linear or -2, exponential): many voices in wedge gradually reducing at each level of the tree to only one voice from the end of the wedge to the end of the sound.
    • 2 – for 'wedge' OR 'diswedge': all voices start at time 0.0. (The total number of sounds which can sound at once is in fact set by WTHICKNESS: the number of streams).

    If CATYP = 1, set DELPROP: enter float value (0.0 < DELPROP <= 1.0) on the line after the 1 indicating CATYP. DELPROP controls the proportional spacing in time between the sound entries.

  2. REPET – int >= 0: for several source-sounds, the number of allowed repeats in the order-sequence, including those at block boundaries. This parameter works in conjunction with SQTYP. The various source sounds are coming and going all the time as the wedge evolves. REPET provides a way of controlling the degree of sameness/difference in the resulting sound texture.


  3. SQTYP – int: order-sequence of sounds type: 1, 2, or 3:

    • 1 – random-permutation of srccnt-sound objects in srccnt-block, and again & again. Thus a random ordering of the srccnt sound objects is made; this forms one block in which each sound occurs once. Then another random ordering is made, etc.
    • 2 – random-permutation of srccnt -objects in blocks, with REPET number of repetitions of each sound allowed in, OR AT THE INTERFACES OF, the blocks. Thus, if there are 4 source sounds and REPET = 2, there will be 8 members in that block before the next random permutation is made.
    • 3 – scan the sounds in the list of sounds, using scan & bandwidth parameters listed in the file scanfil (this name only), with the maximum number of repeats as set by REPET. When SQTYP 3 is used, TITYP 3 must also be used.<
    scan runs from 0.0 to 1.0 and varies in time. Breakpoint information (time scan_value) on separate lines must be placed in a file named scanfil. Scan is where in the list of soundfiles the program is looking at any given time; 0 is the start of the list of source soundfiles, and 1 the end. For example, there could be 100 soundfiles the nature of which is graded in some way, so it could be useful to move gradually over time from the beginning to the end of the list.
    bandwidth runs from 0.0 to 1.0 and varies in time. Breakpoint information (time bandwidth_value) on separate lines must be placed in a file named bandwfil. Bandwidth is what proportion of the whole list of soundfiles the sounds will be selected from at any given time. For example a value of 0.1 would look at 10 of the 100 soundfiles around the location where scan is pointing, and a value of 0.05 would look at 5 soundfiles, etc.

  4. TITYP – int: time-generation type: 1, 2 or 3:

    • 1 – one source: the average timing of sound entries is proportional to source-length.
    • 2 – several sources: the average timings of sound entries are proportional to source-lengths.
    • 3 – set a fixed average time-distance between sound-events. MUST BE USED IF SQTYP 3 IS CHOSEN. Also, a value must be given for ABSDIST (float), the average time between sound events. It must be > 0.0. Enter it on the line following the 3 indicating TITYP. Any time value is acceptable.

Return to Wedge Contents

OPTIONAL COMMAND LINE PARAMETERS

These several options provide a number of supplementary tweaks:

(8) -t – gives the possibility of truncating or looping the sound events. A factor is read from a duration time breakpoint table which must be named funcdata. For a sampling instrument (TITYP 1) duration is interpreted as a multiple of the duration of the input sound, and can thus be used to truncate, or loop the source sound: where 1 = no change, < 1 truncates (not all of it is used), > 1 loops (has to go back to the beginning to get material for the additional duration).
(9) -gNN is an optional gain factor. Compile your resulting score file with CSound and check the maximum level readout which it provides. This provides precise information for setting your gain factor. -g can be used to normalise the result (or just avoid distortion). The maximum amplitude level is 32767. This divided by the actual maximum level shown by Csound gives the gain gactor. For example, if the actual maximum level turned out to be 32000, you could optimise this with a gain factor of 1.02396875: 32767 divided by 32000 = 1.02396875. It could lead to inaccuracies to round off this figure; I found that rounding it to 1.0240 yielded 32768, one higher than the maximum level allowed. Simply truncating the figure is ok; the result comes out a little less than the maximum level, which could be a little safety margin.
(10) -v – verbose option
(11) sr – sample rate. The choice is 48000, 24000, 32000, 44100 (Default), or 22050.
(12) kr – control rate (as in Csound, a divisor of sr); this is to provide the control rate figure needed by the Csound score. Must be set if sr other than 44100.

Return to Wedge Contents

THE ADDITIONAL GLOBAL FILES

The program will automatically pick up the following files, if they are present in the current directory:

densdata – density of the data: how many simultaneously or overlapping events per unit of time. Density is the distance between events measured in source-durations, given as breakpoint data in a file which must be named densdata. Format: time density. There may be several streams, each with different sound material, but this does not necessarily mean that they will all be sounding at once. For the purposes of this kind of texture, the soundfiles may very well contain temporally separated discrete sound events rather than continuous sounds. The degree of potential overlap of these sounds can be controlled by the densdata file: how many times within the given time zone do you want to hear another event. Density is not an integer 1, 2 etc. but a floating point multiple applied to the duration of the source material: 1 = no change, > 1 = more dense, < 1 = less dense.

scatdata – scattering of the events is the time spacing between them as given as breakpoint data in a file which must be named scatdata. Format: time scatter. If scatter = 0.0, the events are not randomly scattered, i.e., as regularly spaced as they can get. If scatter = 1.0, the events are as randomly scattered as they can get.

pwarpfil – pitch-warping, given as breakpoint data in a file which must be named warpfil. Format: time pwarp. The pwarp values are transposition ratios: 1 = no change, 2 is an 8ve higher, 0.5 is an 8ve lower, etc. (See SNDINFO UNITS).

weightfi – amplitude-weighting across the frequency bands of the wedge, given as breakpoint data in a file which must be named weightfi. Format: bandindex amplitude. Bandindex range is 0.0 (top of band) to 1.0 (bottom of band) in WEDGE or DISWEDGE. Divide up the wedge into as many bands as you like (bandindex) and assign an amplitude weighting to each (amplitude); amplitude range is 0.0 to 1.0, with 0.5 as mean amplitude.

Return to Wedge Contents

Musical applications

The creation of certain types of textures is one of the fundamental features of 20th century music, perhaps related to the presence of atomic and quantum theory in contemporary physics. Random functions can be useful to place the individual events in a natural way, but a certain amount of additional shaping is important in order to relate the textures to other formal shapes in the composition.

Note that when Csound finishes compiling the sound, it displays the 'overall amps' value. If overmodulation has occurred, this will be greater than 32767 the next line will list the number of samples which have overmodulated. You can adjust the amplitude values with CSNDATTN or SCORP to bring them within range. Another approach would be to run WEDGE again with WDEC in the framefile reduced. WEDGE is an interesting program to study and use in order to begin to explore the possibilities of texture composition and find ways of balancing the random and the formal. Also see CSNDATTN, the new TEXTURE Group, SCORP and A Wedge Tutorial by Archer Endrich.

Return to Wedge Contents
Return to Main Index for the CDP System.


Converted to HTML: 11 October 1998

Last Updated: 22 February 2000
Documentation: Archer Endrich
All observations & ideas for improvement appreciated
Composers Desktop Project
12 Goodwood Way
Cepen Park South
Chippenham, Wiltshire
SN14 0SY ENGLAND
Tel. +44 (0)1249 461361
Email: archer@trans4um.demon.co.uk
© Copyright 1998-2000 Archer Endrich & CDP