** 1 page feature / 781 words / 4 grabs ** Audio ABCs Danny MacAleer dismisses the renaissance of analogue sythesisers... For some reason, analogue synthesisers are experiencing a bit of a renaissance, fetching high premiums, and causing riots at car boot sales when spotted amongst the rubble and home-made biscuits. Despite all the fuss, there's nothing an analogue piece of circuitry can do that can't be emulated by a few bits of digital logic (even noise). Since digital audio is little more than huge collections of numbers (in some coherent form), samples can be generated by any means - even using a text editor. First Word may not have the twiddle-factor of an analogue synthesiser, but it certainly has the sonic potential. The system works as follows: Each letter in the ASCII character set has a different numerical value (for example a space character is represented by $20), and combinations of these can form recognisable patterns. Unfortunately, a letter to the building society still sounds as bad as it looks... For a square wave you need two discrete values: '0' ($30) and 'd' ($64), for example. The first character is inputted a number of times (the more, the lower in pitch the resultant sound will be), and then the second, the same number of times. As a rough guide: ** italic on ** Frequency in Hertz = sample rate / number of characters ** italics off ** This pattern is then repeated, perhaps with varying 'periods' so as to create a pulse width modulating effect, for as far as the text editor can go without starting a new line (typically 255 characters although a few can handle much longer lines). Carriage returns have their own ASCII value, which cause 'spikes' in the audio, so it's best to keep a single line (although it is quite conceivable to use this to some advantage). More exotic waveforms are an extension of the above idea. Sawtooth waveforms are produced by writing the alphabet forwards, whilst triangle waves can be made by writing the alphabet forwards and then backwards. To experiment with other numeric patterns, you'll need an ASCII character set map, but resonant waves, sine waves, and filter sweeps are all possible. (If you're handy with C or BASIC, you could write a program that constructs a disk file full of numbers, like the one below, and save yourself all that typing.) Once you have a waveform cycle, this 8-bit data needs to be loaded into a sample editor (as a *.SPL file in Replay 16) to be elongated, as it's probably quite insubstantial in the audio scheme of things. This requires a tedious bit of cutting and pasting, something most editors are good at. It may also need optimising - particularly if you've used low values. Then you can be creative, using the editor's envelope shaping facilities to add some much needed dynamics to the sample. Some editors will let you 'draw in' a new amplitude envelope, but any fade in/out combination tool can be equally as effective. A brief physics lecture... To create a truly authentic analogue rasp, the sample must be thickened to the consistency of school custard. One method is to use phasing - where two identical samples are overlaid, with one slightly out of phase. This is achieved by inserting a small space at the start of the sample. Fluctuations in the amplitude are produced (thickening and thinning in different places of the sound). If you repeat the process a few times, the sound can be dramatically altered. All this amplitude wibbling is due to the phase relationship (which shouldn't be confused with a celebrity marriage) of the original sound, and the time-shifted sound (see diagram). A shift of 1 to 45° is typical for effects; 180° out of phase produces a cancelling effect (since the two waveforms are equally opposite); 360° is a full-cycle. Some editors, like Replay 16 or Zero-X, include similar built-in effects, thus taking a welcome excursion around the mathematics. ** BOX OUT ** ** Non proportional font, check the special characters survive ** /* ANSI C code for generating a square wave disk file */ #include #include #define PERIOD 100 FILE *fp; char sdata[20000]; void main() { short x = 0, y = 0; while(x < 20000) { if(y < PERIOD) sdata[x] = 100; if(y >= PERIOD) sdata[x] = -100; x++; y++; if(y>= (PERIOD * 2)) y = 0; } if((fp = fopen("a:\\square.spl", "wb")) == NULL) exit(0); fwrite(sdata, sizeof(char), 20000, fp); fclose(fp); exit(1); } ** end boxout ** ** CAPTIONS ** ** SAMPLES1.GIF ** How to create a phasing effect in Replay 16 ** SAMPLES2.GIF ** After a liberal dose of paste, the sample is long and usable ** SAMPLES3.GIF ** Chisel off the sharp edges with a suitable envelope shaper (Avalon) ** SAMPLES4.GIF ** Even the alphabet is musical. Honest!