Magazine Archive

Home -> Magazines -> Issues -> Articles in this issue -> View

Article Group:
Computer Musician

The Programmable Digital Sound Generator (Part 5)

Part 5: Sound Systems Revisited

Article from Electronics & Music Maker, November 1984

Our series on Clef Products' synth add-on for the BBC Micro comes to a conclusion. Alan Boothman ties up the loose ends.


Our coverage of Clef Products' music system for the BBC Micro comes to a conclusion.

A BASIC program was written which gives level values rising in the manner of a natural progression as the key velocity increases. Sixteen points were chosen covering the 2mS-32mS depression period mentioned earlier, and the term 'natural progression' covers a combination of nonlinearity, shape of slope, and lower and upper limits of level. Four curves are available for use, varying in extent between 1 and 4 and containing suitable level offsets. Thus, for the strings only curve 3 is used, so as to give a relatively gentle touch control to both the rise and fall of the sound. The electric piano specification shows a contrasting situation where oscillator 1 uses a very hard velocity curve and oscillator 3 adopts the same curve used in the strings. Since the curve in oscillator 1 is controlling a relatively bright waveform (17) a sharp increase in high harmonics will occur under heavy playing. In contrast the more mellow waveform (20) will be the dominant sound with light touch.

The variation in tone at this stage only covers the moment of attack and corresponds to dynamic tone and level by touch-sensitivity. Later parameters in the envelope specification will decide the moving tonal pattern throughout the period of the envelope, while a zero in the velocity curve position means that the oscillator concerned will be non-touch sensitive, controlled only by 'MAX LEV'.

Frequency Tables



The generation of the tables was covered earlier, and requires only a simple BASIC program. Sound System 1 adopts the convention that Tables 1, 2 and 3 are on pitch, sharp and flat, respectively. Thus, in the string specification, all three tables are used, one for each oscillator, to produce a chorus effect. In the case of the electric piano, the longer mellow portion of the sound is on pitch whilst the attacking brighter oscillator is deliberately sharp, thereby giving a dynamic pitch variation throughout the envelope plus a small pitch response to keyboard touch.

Frequency Table 4 has been reserved to give a non-harmonic relationship to the fundamental frequency, but by using the simple BASIC program suggested, it's possible to load alternative table groups containing the characteristics required by the user.

A separate BASIC program within Sound System 1 allows waveforms to be developed by additive synthesis of chosen harmonics of sine, square, triangle and sawtooth waveforms. In BBC Micro terms, this is a 'chained' activity which preserves the machine code operating routines and tables below PAGE in the computer, and replaces the master BASIC program (which controls the displays and operating routines) with the waveform generation program. Before using this facility, it's necessary to set up an instrument specification which gives roughly the required envelope-shaping. Where a waveform is not already available, Tables 1 to 4 should be inserted into the blank WF Number positions. Within the wave generation program, the waveforms can then be modified in positions 1-4 whilst the user checks the overall result by playing the keyboard or using a stored sequence. The use of high-resolution graphics (MODE 4) to display waveforms makes this program substitution necessary, but the speed of the BBC DFS is such that all this occurs very rapidly. Reverting back to the main system is equally rapid and the newly-developed waveforms move with you, allowing further tailoring of the other parameters. At any stage, individual waves can be saved or grouped into a 16-waveform set and used in conjunction with the other 16 permanently present in the PDSG.

Channel



The string specification makes maximum use of the channel facility in that the centre channel (3) contains in-pitch sound, which mixes with 0.5% sharp and 0.5% flat sounds in left and right channels respectively, whilst the larger 1% difference between Tables 2 and 3 gives a faster relative phase movement across the stereo image.

Programming to remain compatible with two envelope edge shapes can become surprisingly complicated, particularly when touch-sensitive levels are also involved. In the linear mode (2), Sound System 1 treats all rates (Attack, Decay, and so on) after suitable scaling as an increment of amplitude, and the program simply accumulates from zero to maximum level (or the level defined by touch), and then drops by subtraction through Decay, Sustain and Release. If any of the rates involved are particularly fast, the increment is suitably scaled down and fed to the PDSG at a faster rate to give a smoother edge.

If a logarithmic or exponential edge shape is required, a table is used to define the falling activity but the rising edge is translated from the touch data to give a series of exponentially-reducing increments which are accumulated to form the edge.

Envelope Parameters



The remaining parameters come within the general area of ADSR with the ability to fix the maximum level for each oscillator and the level at which decay rate is replaced by sustain rate. The electric piano uses logarithmic edges, the attack rate of which is scaled progressively slower from 1 to 11, and the falling rates are scaled to be roughly equivalent to their counterparts in overall time, using numbers between 0 and 100 to indicate increasing speed. The amplitude increments mentioned in the previous section are actually two bytes long in order to give a wide range of time to the envelope edges. This gives a maximum limit of around 17 minutes spread over 65,000 numbers, so in order to use a sensible number of displayed increments (0-100), all ADSR rates have to be non-linearly scaled as part of the BASIC control program.

The electric piano uses oscillator 1 as the percussive component and oscillator 2 for the longer sustain portion. However, the overall sound is dynamic in tone by virtue of the relative numbers chosen for each parameter. The string specification uses linear edges throughout, but an interesting feature is the use of a decay rate which reduces the amplitude of sound before reaching the constant sustain section. This assists further in producing a clean sound when both chordal and melodic activities are occurring on the keyboard at the same time. The strings would normally be used in Pedal Mode 2, which means that the parameters on line 13 only come into force when all keys are released and the pedal is pressed. In contrast, the electric piano would use Pedal Mode 1, replacing the release rate with pedal rate under all conditions of pedal depression.

Figure 1. Instrument specification - 'STRING 4T'.


Figure 2. Instrument specification - 'PELEC 1'.


A summary of the sort of programming required to create a practical instrument along the lines of Sound System 1 is shown in Figure 3. This should give further food for thought on how the PDSG, with or without a keyboard, can be adopted to gour own personal requirements.

PDSG pricing and availability details from: Clef Products, (Contact Details). See this month's Back Issues page for details of how to obtain previous instalments in the 'E&MM Digital Music' series.

Figure 3. Sound System 1 - Software requirement summary.

BASIC Programming


  • 1 Provide screen display of instrument Index and enable selection of an alternative instrument from the computer keyboard.
  • 2 Provide screen display of a single instrument specification and enable modification of any parameter from the computer keyboard.
  • 3 Scale ADSR rate parameters to give suitable two-byte amplitude increments and a flagged indication of update frequency.
  • 4 Control back-up storage for instrument specifications and sets, recorded sequences, waveforms and waveform sets.
  • 5 Create multiple two-byte frequency increment tables to be loaded as required.
  • 6 Create multiple non-linear velocity curves to be loaded as tables.
  • 7 Create non-linear edge tables for envelope shaping.
  • 8 Provide a means of creating waveforms of varied harmonic content with both screen display and audio feedback.

Assembly (MC) Programming


  • 1 Scan keyboard, stacking important events for further processing.
  • 2 Execute allocation and cancellation of logical oscillators.
  • 3 Prime oscillators with required frequency, waveform and channel information.
  • 4 Perform calculation and table manipulation to control oscillator level.
  • 5 Write, read and interpret sequence information.
  • 6 Provide fast routines for waveform and instrument specification transfer.


Series - "Programmable Digital Sound Generator"

This is the last part in this series. The first article in this series is:


All parts in this series:

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 (Viewing)


More with this topic


Browse by Topic:

Electronics / Build



Previous Article in this issue

Rumblings

Next article in this issue

Amstrad CPC464 Home Computer


Publisher: Electronics & Music Maker - Music Maker Publications (UK), Future Publishing.

The current copyright owner/s of this content may differ from the originally published copyright notice.
More details on copyright ownership...

 

Electronics & Music Maker - Nov 1984

Computer Musician

Topic:

Electronics / Build


Series:

Programmable Digital Sound Generator

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 (Viewing)


Feature by Alan Boothman

Previous article in this issue:

> Rumblings

Next article in this issue:

> Amstrad CPC464 Home Computer...


Help Support The Things You Love

mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.

If you value this resource, you can support this project - it really helps!

Donations for January 2025
Issues donated this month: 0

New issues that have been donated or scanned for us this month.

Funds donated this month: £22.00

All donations and support are gratefully appreciated - thank you.


Magazines Needed - Can You Help?

Do you have any of these magazine issues?

> See all issues we need

If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!

Please Contribute to mu:zines by supplying magazines, scanning or donating funds. Thanks!

Monetary donations go towards site running costs, and the occasional coffee for me if there's anything left over!
muzines_logo_02

Small Print

Terms of usePrivacy