BACK TO INDEX

Disclaimer

The project described here is NOT based on, or associated with the "LinnDrum II" which is currently being developed by Roger Linn Design. The information presented on this page refers to an amateur electronics project, which aims to re-create the sound of the "LinnDrum LM-2", a drum machine manufactured in the early 1980's by Linn Electronics, Inc.


LinnDrum Expander


Back in the '80s, Linn Electronics Inc. produced several digital drum machines, amongst them was the LM-2 (also called the "LinnDrum"). This machine used 8-bit digital samples of real drums stored in EPROM chips. An on-board sequencer, powered by a Z80 microprocessor, controlled the playback of the sounds to create a fully programmable drum machine.

The LinnDrum LM-2 produced by Linn Electronics Inc.

Originally, the aim of this project was to build an exact replica of the Linn Drum. However, having studied the schematics, it soon became apparent that this would be a very difficult task. These were the major design problems:

1. I wanted to reduce the number of EPROMs required to store the sounds. Since the sound playback circuits use simple binary counters to address the EPROM data, this makes it difficult to combine several sounds into one EPROM.

2. The main digital to analogue converter (DAC) is an 8-bit non-linear type and is no longer being manufactured! This means that a standard 8-bit linear DAC cannot be used as a drop-in replacement.

3. The bass drum, toms and conga drums use a special voltage controlled filter (VCF) chip which although still available, is very expensive to buy. An alternative VCF needed to be designed.

4. The hi-hat uses a special voltage controlled amplifier (VCA) chip, again this is expensive and not readily available. An alternative VCA was needed.


The solution..?

A complete re-think of the project! Basically I've ditched the idea of doing an exact replica and instead come up with the idea of building a kind of Linn Drum "Expander". This will have the same basic sound set as the original instrument, but no on-board sequencing facilities. Here are the specifications of the proposed design:

SOUNDSET: All of the original Linn Drum sounds i.e. Bass drum, Snare drum, Sidestick, Toms (x3), Conga drums (x2), Cabasa, Tambourine, Claps, Cowbell, HiHat Open & Closed, Crash Cymbal, Ride Cymbal.
(Alternative Tom and Snare drum sounds are also available alongside the standard sounds).

POLYPHONY: 15 sounds simultaneously.

CONTROLS: For each instrument separate volume, panning and pitch controls. The hi-hat also has a variable decay control.

MIDI: Each sound is assigned a fixed trigger note number. MIDI velocity data is used to control the loudness of each sound in 8 levels. The MIDI receive channel can be set from 1 to 16 using a simple DIP switch.

DIN SYNC: MIDI clock, start, stop and continue messages are decoded and used to drive the DIN sync output. This allows non-MIDI sequencers and drum machines to be syncronised to MIDI clock via the Linn Drum expander. The incoming MIDI clock can also be divided down to a more suitable rate using MIDI system exclusive messages to set the "division value". This value is stored when the power is turned off so that the unit will always default to the last value used.


Sound Samples

The following sounds were recorded directly from the prototype circuit without any effects or EQ. The various sounds are mixed at the same level using a temporary passive mixer (i.e. just some resistors!). This means that the relative levels between instruments may be wrong, (e.g. the tambourine and cabasa are too loud).

Soundset - Each sound played at maximum velocity followed by minimum velocity. The order of the sounds is bass drum, high tom, mid tom, low tom, alt. low tom, low conga, high conga, tambourine, cabasa, claps, cowbell, snare and sidestick.

Cymbals - Hi-hat closed, hi-hat open, ride cymbal and crash cymbal - all played at maximum velocity.

Snare velocity demo - Just the snare drum playing while increasing and then decreasing the velocity value. This demonstrates the 8 different accent levels available.

Tom pitch demo - Just the tom playing while turning its pitch control to maximum, then minimum and finally to maximum again. (In the final version of the hardware the lower range will be limited slightly, since turning the pitch control to minimum actually prevents that drum producing any sound at all!)

Hi-hat decay demo - Hi-hat playing a simple pattern while the decay control is turned from minimum to maximum.

Hi-hat tuning demo - Hi-hat playing while the tuning control is turned to maximum and then minimum setting. (In the final version of the hardware the lower range will be limited - since it doesn't sound very musical!)

The following MP3s were recorded from the stereo output sockets directly, with no EQ or effects added:
LDDemo01 LDDemo02 LDDemo03 LDDemo04 LDDemo05

LDemo06 LDDemo07 LDDemo08 LDDemo09 LDDemo10

 

The Design

The entire instrument uses three PIC microcontrollers, two PIC18F452 and one PIC18F4685, running at 10 MIPS each, (MIPS=millions of instructions per second). These chips contain all of the Linn Drum sounds in their Flash memory - taken from the original EPROM binary image files. Using the PIC microcontrollers has several advantages: (1) the large amount of FLASH memory can be used to store the sound samples - removing the need to use EPROMS, (2) the PIC has an on-board serial port which can be configured to operate as a standard MIDI interface, (3) the PIC also has an analogue to digital converter (ADC) which is used to determine the setting of the tuning pots.

To get around the problem of the non-linear DAC, (type AM6070), used in the original, I have used a 16-bit linear DAC, (type DAC16F). The PIC micros are programmed with a data conversion table which is used to convert each of the original 8-bit non-linear samples to an equivalent 14-bit linear value. The data in these tables has been carefully calculated using information from the AM6070 data sheet, so in theory the new DAC should produce an output which matches the AM6070 exactly. Note that only 14 of the 16 available bits are used, (the two least significant bits are not needed). It was found that 14-bit resolution was the minimum required to accurately represent all of the possible output voltages of the AM6070 DAC.

The circuit based on the PIC18F4685 generates the longer sounds, (i.e. hi-hats, crash and ride cymbals). This is because it has a larger Flash program memory than the PIC18F452. A simpler and cheaper DAC has also been used since cymbal sounds are mostly noise based, and therefore an expensive device such as the DAC16F cannot really be justified. A 14-bit "R-2R" resistor ladder DAC has been constructed using 0.1% tolerance metal film resistors, buffered using a J-FET op-amp. Despite the use of discrete resistors in its design, this method still produces a good sound quality - (have a listen to the cymbals MP3 file). Incidentally, the TL0xx series op-amps specified in these circuits must NOT be replaced by other types. This is because they have a high slew rate which is needed to cope with the fast changing signal from the DAC.

A modular design has been devised - each of the three PIC circuits is a self contained MIDI drum module in it's own right! This makes adding more sounds as simple as constructing another board and adding it to the system. A cut-down version could also be constructed to give just Bass, Snare and four Toms if required, for example. Only the MIDI interface, mixer and power supply circuits are common to all sound generator boards.

The PIC firmware for the two main voice boards is capable of 6 voice polyphony, while the cymbals and hi-hat board is 3 voice polyphonic. All boards have individual pitch control of each sound and MIDI triggering. I have tried to map the sounds to the General MIDI standard, but this can easily be changed by editing the PIC firmware(s).

 

Photos

Here are some photos of the project, taken during development/construction. (Apologies for the poor camera work on some of these images!)

Click on the thumbnail images to see the larger picture.




This photo shows the prototype circuit being tested. The rats nest of wires on the larger breadboard contains the PIC microcontroller. Below it is a prototype voltage controlled filter being tested.





This is the PCB design for the above circuit without the filters, (those are on a separate PCB). This PCB measures 160mm x 100mm and is single-sided. I have tried to design the PCB so that it is easy to reproduce using the normal photo-etch method.

Two of these boards are needed to generate the bulk of the Linn Drum sounds. Obviously the PIC firmware is different for each board and some component changes also need to be made.




Here is the same PCB, now with the electronic components added, (except for the ICs). This PCB is designated "LDCPU1" and generates the bass drum, three toms and two conga drums. Check out the MP3 sound samples above to hear it in action!




This is the second PCB, (designated "LDCPU2"), which generates the tambourine, cabasa, claps, cowbell, snare and sidestick.


The third PCB, ("LDCPU3"), generates the hi-hat, crash cymbal and ride cymbal. Since this circuit is only required to play three sounds, the spare processor power is used to control the LEDs and provide the DIN sync output. It also has the advantage of a slightly higher maximum sample rate of 48KHz, which means that the sounds can be tuned higher. The resistors nearest to the big 40-pin IC socket form the D to A converter. Use the most accurate resistors you can find, (or afford), for these as any variation in resistance will convert to noise in the output signal. I used 0.1% tolerance 1/4W metal film resistors here and achieved a good sound quality.


PCB "LDFILTER" contains six voltage controlled low-pass filters for the bass, toms and conga drums. The PCB also contains a set of six envelope generators to sweep the filter cutoff frequency when a drum is triggered. The small blue preset pots are used to adjust the sweep range and offset for each filter separately, giving a large degree of control over the filtering of the sounds.

The envelope generators are practically the same as the original LinnDrum, but the filters themselves are an entirely new design. This is because the original filter chips are no longer readily available. The filter used here is a two-pole design, (i.e. 12db/oct), as opposed to the four-pole, (24db/oct), used in the original. After experimenting with various 2-pole and 4-pole prototype filter circuits, it was decided that the difference in sound quality did not justify the extra circuitry required to implement six 4-pole filters. (To implement a total of six 4-pole filters would have required 21 ICs!)





This is the MIDI input interface and DIN Sync output board. The smaller PCB has the MIDI channel DIP switch soldered to it and this connects to the larger board via a short cable. This allows the switch to be panel mounted so that the MIDI channel can be changed easily.


This set of three PCBs are used to hold the front panel controls. The smaller of the three boards contains the output op-amps for the stereo mixer circuit. It is recommended that the op-amps be soldered directly to the PCB, (i.e. without using IC sockets), since the PCB will be mounted vertically in the case and the ICs might work loose in the sockets over time. Ideally I would have preferred the fromt panel PCB to be made as one long board to make it easier to mount behind the front panel, however using several smaller PCBs means that the boards are easier and cheaper to make.


The two PCBs in the left-hand photograph are LDPSU, (power supply unit), and LDLED, (LED control board). The power supply board generates three regulated DC supplies of +5V, +15V and -15V to power the entire instrument. A "star-earth" arrangement has been used in the power supply to help remove unwanted interference in the audio circuits. The middle and right-hand photographs show the completed power supply and LED boards.

LDLED is used to control the fifteen LEDs on the front panel. This small circuit receives control data from board LDCPU3 and lights the LEDs accordingly. A multiplexing scheme is used to control the LEDs simply because there were not enough output ports available on the PIC micro to control the LEDs directly. One advantage of using this method is that the current drawn by this circuit is relatively small, due to the fact that only one LED is actually on at any time.


The photograph above shows the circuit boards fitted inside the 19in rack mount case. It's a bit of a tight fit, with so many cables connecting everything together, but somehow I managed to cram it all in! The front panel PCBs are supported by a simple frame made from angle aluminium. This gives the front panel assembly a good level of rigidity, without making it too bulky. PCB LDLED is bolted to the upper support to simplify the wiring to the front panel LEDs. I have tried to keep the LED wiring as short as possible and separate from the audio wiring to minimize any interference.

The grey wires sticking out of the case at top left are the audio connections from PCB LDCPU1. These now connect to the filter board, (this photo was taken before the filter board was finished).


Here are a few photos of the finished unit with the front panel in place and the control knobs fitted. I have used black control knobs for the mixer controls, (level and panning), and grey knobs for the tuning controls. The blue LEDs above the tuning pots are useful when adjusting the drum sounds as they help to locate the correct set of controls for the drum(s) that are currently playing.

The photo on the right shows the connections and controls available on the rear panel. Like the original LinnDrum, mine has a separate output for each instrument sound and a stereo mix output, all on unbalanced 1/4in mono jacks. There is a single MIDI input socket with a channel select DIP switch next to it. The other DIN socket next to the MIDI input is the sync output which provides a 5 Volt clock signal, (synced to MIDI clock), and a run/stop signal.

Note that the graphic layout of the rear panel differs from the design shown below, since the transfer method of printing the panel did not work! Instead I sprayed the panel grey and used a laser etching machine to etch the graphics directly onto the panel.


The LinnDrum project is housed in a standard 19in 2U rackmount case, with a plain aluminium front panel. The drawing on the left shows the layout for the front and back panels and the labelling of the controls, etc. The photograph next to it shows the finished front panel with the graphics transferred onto it.

To print this design onto the panels, I used a laser toner transfer. First the design is printed as a mirror-image onto the transfer paper using an A3 size colour laser printer. Next the transfer is cropped so that it fits the size of the panel - (an A3 size printout is obviously narrower than a 19in rack panel, so it is positioned in the centre with equal space each side). The panels must be very clean before applying the transfer, so I usually wipe them over with plenty of ethanol or a similar solvent. Once the transfer has been positioned properly, it can be held in place using a few small pieces of heat-resistant tape.

The panel can now be placed into the heat press to transfer the image. The transfer process usually takes a couple of minutes, but can vary depending on ambient temperature and the thickness and type of material being printed onto. When the transfer has cooled down slightly, the backing paper can be carefully peeled back, and hopefully you should have a perfect image! In my experience, however, some of the transfer usually comes away with the backing paper, but these small areas can be touched-up using a fine permanent marker pen. To give the panel a bit of extra protection from scratches, I spray it with satin clear varnish.

Summary

This project took many months to complete, in fact much longer than I originally anticipated. Most of the time was taken up designing the PCB layouts, but designing and testing alternative circuits for the VCF and VCA also caused a major delay.

Having completed the instrument, does it perform exactly like the original LinnDrum? That's a difficult question to answer as I don't actually own a real LinnDrum, that's why I started this project! However comparing the sound of my replica with a recording of a real LinnDrum I can draw a few conclusions..

The sounds are pretty close to the original - you have to listen very carefully to notice any real difference. Whilst trying to maintain a full 15 voice polyphony, I have had to use multiplexing for all of the sounds. Unfortunately this does affect the sound quality for some of the sounds, particularly the conga drums. I have discovered that changing the pitch of a sound whilst using multiplexed sound output can cause increased aliasing distortion in the signal. This was particularly noticeable on the conga drums, which, despite careful filtering, still exhibit a small amount of distortion.

The design of the voltage-controlled filters seemed to take forever! This was one of the most difficult aspects of the project and even now I am not entirely satisfied with them. The filters are based on the standard low-pass filter design from the LM13700N data sheet. Having constructed six of these filters and wired them to the instrument generator board, a low-amplitude tone could be heard in the output signal. I added some power supply decoupling capacitors to the filter, but this only reduced the amplitude slightly - it did not remove it completely.


What I would change

If I were to start this project again I would make a few changes to the design:

I would stick more rigidly to the spec of the original LinnDrum. Sounds such as bass, cabasa, tambourine, claps, cowbell, crash cymbal, ride cymbal and hi-hat would remain as fixed pitch sounds. This would help to generate these sounds more accurately.

Toms and conga drums would be monophonic as on the original. This would remove the need to use multiplexing and thus reduce aliasing distortion with these particular sounds. This change would also make it much more financially viable to use the proper filter chip to filter these sounds.

The snare and sidestick would have variable pitch with their own dedicated playback circuit as in the original. Again this would remove the need to use multiplexing and the problems this causes.


Downloads - also see Linn Drum Expander MkII for an updated version of this project.

Schematics and PCB files are all in PDF format.
PIC microcontroller ASM and HEX files were created using Microchip's free MPLAB IDE V8.10 software.

Please note: the files below are provided for non-commercial use only. You may download them and use them for your own private use, but you may not sell them or use them to manufacture items to sell, without first seeking permission from the author. Thank you.


PCB "LDCPU1"
(Generates bass, toms and congas)

File Description Notes
LDCPU1SC.PDF Schematic drawing  
LDCPU12.PDF Printed circuit board  
LDCPU1OL.PDF PCB Component overlay  
LDCPU1.ZIP PIC Firmware Version 5.2:
Assembly language source & HEX in a zipped file
Program HEX file into PIC18F452 microcontroller
(file also contains config data)



PCB "LDCPU2" (Generates tambourine, cabasa, claps, cowbell, snare and sidestick)

File Description Notes
LDCPU2SC.PDF Schematic drawing  
LDCPU12.PDF Printed circuit board Uses same PCB as LDCPU1
LDCPU2OL.PDF PCB Component overlay  
LDCPU2.ZIP PIC Firmware Version 5.2:
Assembly language source & HEX in a zipped file
Program HEX file into PIC18F452 microcontroller
(file also contains config data)



PCB "LDCPU3" (Generates hi-hat open & closed, ride cymbal and crash cymbal)

File Description Notes
LDCPU3A.PDF Schematic drawing (page 1)  
LDCPU3B.PDF Schematic drawing (page 2)  
LDCPU3C.PDF Printed circuit board  
LDCPU3OL.PDF PCB Component overlay  
LDCPU3.ZIP PIC Firmware Version 5.5:
Assembly language source & HEX in a zipped file
Program HEX file into PIC18F4685 microcontroller
(file also contains config data)



PCB "LDMIDI" (MIDI interface and DIN sync circuits)

File Description Notes
LDBKPNL2.PDF Schematic drawing  
LDMIDI.PDF Printed circuit board  
LDMIDIOL.PDF PCB Component overlay  

 

PCB "LDFP1/2/3" (Front panel circuits)

File Description Notes
LDMIXER.PDF Stereo mixer schematic drawing  
LDFRPANL.PDF Tuning pots & LED control schematic drawing See LDReadMe.TXT file
LDFP6A.PDF Front panel printed circuit boards LDFP1 and LDFP2 use the same PCB design
LDFP6AOL.PDF PCB Component overlay x 3  

 

PCB "LDFILTER" (Filters for Bass, Toms and Conga drums)

File Description Notes
LDENV.PDF Filter envelope shaper schematic drawing Two channels shown
LDVCF.PDF Voltage controlled filter schematic drawing Two channels shown
LDFILTER.PDF Printed circuit board for six envelope generators and six filters See LDReadMe.TXT file
LDFILTOL.PDF PCB Component overlay for above  

 

Other Files (Power supply unit, LED control and miscellaneous diagrams)

File Description Notes
LDPSUSC.PDF Power supply schematic drawing  
LDPSLDPC.PDF Printed circuit boards for PSU and LED control  
LDPSLDOL.PDF PSU & LED PCB Component overlay  
     
LDReadMe.TXT Important information about the project Please read!
LDBLOCK.PDF System block diagram Just for reference
     



Drum Sound Mapping

The following table shows which notes trigger each of the instruments.

Instrument
Note
Dec
Hex
Bass Drum
C2
36
24
Snare Drum
D2
38
26
Alt. Snare Drum
E2
40
28
Sidestick
C#2
37
25
Low Tom
F2
41
29
Mid Tom
G2
43
2B
High Tom
A2
45
2D
Alt. Low Tom
B2
47
2F
Alt. Mid Tom
C3
48
30
Alt. High Tom
D3
50
32
Low Conga
E4
64
40
High Conga
D#4
63
3F
Tambourine
F#3
54
36
Cabasa
A4
69
45
Claps
D#2
39
27
Cowbell
G#3
56
38
Hi-Hat Open
A#2
46
2E
Hi-Hat Closed
F#2
42
2A
Ride Cymbal
D#3
51
33
Crash Cymbal
C#3
49
31

 

MIDI System Exclusive Commands

The SysEx commands used to set the "division value" for the DIN sync output are the same ones used by Marc Bareille's MC628 MIDI clock converter project. Marc has written a nice configuration program for the PC which sends the correct MIDI SysEx messages for the division value you have selected - much easier than working out the hex values yourself!

The structure of the SysEx messages is as follows:

F0 Start of system exclusive
71 Papareil Inc
00 Machine ID
24 Function code
0x Division value (low nibble)
0y Division value (high nibble)
F7 End of system exclusive

For example, let's suppose you want to generate a DIN sync output pulse for every sixteenth note.

MIDI clock runs at a rate of 24 clocks per quarter note, therefore there must be 96 clocks per whole note. To work out the correct division value, take the number of clocks per whole note and divide it by the number of DIN sync output pulses you require PER WHOLE NOTE.

96 MIDI clocks per whole note / 16 (for sixteenth notes) = 6 (this is the division value to use).

So by setting the division value to 6, the DIN sync output will go high at the start of every sixteenth note. To work out the correct SysEx messages:

Take the division value in decimal (6) and convert it to HEX (06)

Now simply insert the HEX values (in the right order) into the SysEx message string:

F0
71
00
24
06 < Right hand digit of HEX value comes first, with a leading ZERO in front of it.
00 < Left hand digit of HEX value is next, again with a leading ZERO in front of it.
F7

The table below shows the SysEx messages to use for some common sync settings.

Note
Length
Division Value
(decimal)
Division Value
( hex)
             
1 96 60 F0 71 00 24 00 06 F7
1/2 48 30 F0 71 00 24 00 03 F7
1/4 24 18 F0 71 00 24 08 01 F7
1/8 12 0C F0 71 00 24 0C 00 F7
1/16 6 06 F0 71 00 24 06 00 F7
1/32 3 03 F0 71 00 24 03 00 F7


References/Acknowledgments

LinnDrum LM-2 service manual & schematics.
Microchip PIC18FXXXX data sheets.
Bergfotron LM13600 VCA2 by Jorgen Bergfors - (Hi-hat VCA circuits).
9090 MIDI Interface by Trevor Page - (DIN Sync output circuits).
MC628 MIDI Clock converter by Marc Bareille - (System Exclusive data format).
http://www.electrongate.com/dmxfiles/linn/index.html - (Linn EPROM data files).