My presentation on a hardware hack project which has been undertaken by my Dad, Geoff King.
Done for BarCampBlackpool initially, and also presented at BarCampLondon7.
Convert to study materialsBETA
Transform any presentation into ready-made study materialselect from outputs like summaries, definitions, and practice questions.
1 of 38
Download to read offline
More Related Content
Ernie The Electronic Organist
1. E R N I E T H E E L E C T R O N O R G A N I S T I C Or - How to make a BBC Micro play a pipe organ
3. ERNIE the Electronic Organist About The Project Engineer I am presenting a hardware hack project which has been undertaken by my Dad, Geoff King He is a closet geek/engineer/tinkerer with many years experience under his belt He spent most of his career before retirement in the Physics Department of the University of Essex He taught the students how to interface lab experiments with KIMs, then BBCs, and later PCs When the BBC Model B arrived, he had an idea to use one to play the organ in his local church, where he has been organist since the mid-1960s
4. But in the early 1980s they were expensive state-of-the-art machines as you may have seen recently on the excellent BBC4 series Electric Dreams! So the idea was put on hold for a while. But you know a geek. An idea never really goes away... Some 20 years later, with his retirement looming, he was able to acquire several Beebs, by then regarded as redundant and heading for the scrap heap The idea was dusted down, and Ernie the Electronic Organist was born ERNIE the Electronic Organist About The Project Engineer
5. The church organ is a modest affair of 6 speaking stops on a single 54-note manual keyboard , with a single stop on an independent 30-note pedal organ ERNIE the Electronic Organist The Organ
6. As small organs go, the instrument is unusual in having electro-pneumatic action This is in contrast to the traditional system of rods and levers, known as trackers , linking the keyboard to the pallet valves which supply air to the pipes Switches beneath the keys supply current to a series of solenoids which operate small valves controlling the air supply to the pneumatic motors attached to the pallet valves ERNIE the Electronic Organist The Organ
7. Here is a part of the wind chest showing the solenoids in action whilst the organ is played: http://cazm.eu/ernie1 ERNIE the Electronic Organist Hardware In Action
8. An unregulated PSU provides up to 10 amps of current at a nominal 14 volts DC to power the action One side of each magnet is connected to the 0 volt rail, with the keyboard switches on the +14 volt side The aim of the project is to simulate a series of computer-controlled switches in parallel with the keyboard switches ERNIE the Electronic Organist The Organ Electro-Pneumatic Action
9. ERNIE the Electronic Organist The Switching Circuit in Parallel The analogue switching circuit for each note looks like this
10. ERNIE the Electronic Organist The Switching Circuit in Parallel A 1-bit data latch stores the state of each note, ON or OFF
11. The LEDs were originally provided to facilitate trouble-shooting at the development stage, but now provide entertainment for interested spectators! ERNIE the Electronic Organist The Manual Switching Circuit Hardware
12. It will be noted that the components are grouped to correspond to the layout of keys on the keyboard ERNIE the Electronic Organist The Pedal Organ Switching Circuit
13. Here is a short video showing the switching boards whilst the organ plays a familiar tune ERNIE the Electronic Organist A Quick Demontration!
14. The diagram of a sample latching circuit is shown below - there are 4 latches per chip, but there are only two clock lines, each one clocking two latches ERNIE the Electronic Organist Addressing The Latches So each latching operation requires two bits distributed via a network of 74LS04 inverting buffers to provide the necessary fan-out
15. A single 1-0-1 clock pulse is then routed to one latch pair only, using a 2-to-4 74LS139 decoder and a series of 1-to-16 74L154 demux chips , as shown -> ERNIE the Electronic Organist Addressing The Latches This arrangement requires 5 address bits as well as the two data bits and one clock bit
16. Each of the 32 5-bit addresses points to a pair of latches, so giving access to a maximum of 64 individual latches ERNIE the Electronic Organist Addressing The Latches There are only 54 notes on the manual organ, but some of the spare latches are used for auxiliary functions , including the operation of the master switching transistors in the 14V supply to upper and lower halves of the analogue switching board
17. This is the address routing circuit board ERNIE the Electronic Organist Opto-Isolators, Decoders and Buffers
18. This is the latch circuit Much of the above hardware is duplicated to provide independent operation of the 30-note pedal organ , but this needs only one additional address line to distinguish between the two sections Thus: Note address bits PB0-4 Manual/Pedal select PB5 Data output bits PB6-7 ERNIE the Electronic Organist Latch & Buffer Circuit Board
19. Operation of the above hardware is controlled by a machine code program running on the BBC Micro A user interface in BBC BASIC , normally running in MODE 6, controls the display, selection and loading of items from the music menu Prior to the transfer of control to the machine code there is provision for setting a number of playing parameters , whose values are passed via the Resident Integer Variables ERNIE the Electronic Organist Machine Control
20. The system can play music in up to 8-part harmony , equivalent to 8 separate parts or voices in a choir, and keeps track of the current status of each part The numerical data for each piece of music are arranged in groups to represent events at successive points in time Each event usually involves changing the note being played by any one or more of the parts, including muting any of the parts Following are some examples of three typical events ERNIE the Electronic Organist Data Format
21. ERNIE the Electronic Organist Data Format Starting at address 193 is the Data Group for a chord, duration 21 time units The Control Byte at 194 has value 180 = &B4, which has 4 bits set (7, 5, 4, 2) The voices corresponding to bits (6, 3, 1, 0) will remain unchanged, whatever their previous states Address 199 holds value 131=&83 which represents a mute of all voices, duration 3 time units Address 200, 201 hold the sequence 00, 08 which represents the bar line at the start of bar 8 Data Group starting at Address 193 199 200 Duration 21 03 00 Control Byte &B4 (180) &83 (131) 08 Notes S X A T Y B P Q bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 A3 (34) -- F#3 (31) C3 (25) -- D2 (15) -- -- Significance Voice 4-note chord Mute Bar No. 8
22. The data group for each event begins with a Duration Parameter , D, a 6-bit number in the range 1 to 63 which defines the length of time that the note or chord in question is to be sustained The default value of D is 24 units for a crotchet, 12 for a quaver, etc., although these values are arbitrary but the inclusion of a factor of 3 facilitates the rendering of triplet rhythms when required Next comes an 8-bit Control Byte which acts as a mask defining which part or parts are to be changed This is followed by a list of N numbers, each in the range 0 to 54, representing the notes to be played ERNIE the Electronic Organist Data Format
23. N is the number of set bits in the mask and the sequence of note-numbers defines to which parts they are allocated The note value zero indicates that the relevant voice is to be silenced A Duration Parameter in the range (1 to 63) + &40 indicates that the previous chord is to be maintained unchanged for a further period of time ( a tie ) A parameter in the range (1 to 63) + &80 heralds a mute , a period in which all parts are to be silenced ERNIE the Electronic Organist Data Format
24. A Duration Parameter of zero represents an Escape Code which is followed by at least one further byte If this next byte is a number in the range 0 to 240 (&F0) it indicates a bar number in the music - this is ignored by the playing program but is an invaluable aid to editing the data Values from &F1 to &FF invoke various special functions and may be followed by additional bytes These functions include setting the Tempo Parameters , marking the beginning and end of repeated passages, implementing octave- and pedal-coupling facilities and marking the end of the piece ERNIE the Electronic Organist Data Format
25. In the early days, the data lists were compiled and entered into memory manually , which was extremely tedious even for short and simple melodies Around the same time, Dad was writing a PC-based program originally designed merely to print music in a legible form, and it occurred that it might be possible to combine these two problems Now, generation of the data begins with a Project in Visual Basic running on a PC under Windows 98 Please stop laughing , there are good reasons for using this ancient machine! ERNIE the Electronic Organist Generating The Data
26. The programme initially displays a pair of blank staves, plus, in the case of organ music, an additional stave to show the pedal part ERNIE the Electronic Organist Generating The Data
27. Notes are inserted by a series of mouse-clicks to build up a single line of music ERNIE the Electronic Organist Generating The Data The information displayed is stored in memory merely as the note-values and their co-ordinates on the staves, and each line of music can be saved as a .DAT file No bit- image files are involved It is important to note that all the notes in a given chord must be vertically aligned at the same X-co-ordinate else they will not be rendered as a single event when played
28. The N lines of music required for a given work can be printed out for future reference ERNIE the Electronic Organist Generating The Data The filename for each line of music is constructed from the file-stem, Bday in the example shown Plus the bar number at the start of that line, thus Bday1.DAT and Bday5.DAT
29. The treble clef (normally played by the right hand) contains the S oprano part (tails up) A lto (tails down) and an extra intermediate part ( X , with no tails) ERNIE the Electronic Organist About The Voices Similarly the next stave down ( bass clef , normally played by the left hand) supports T enor (tails up) B ass (tails down) and an additional part ( Y , no tails) The lower bass clef, where used, is played by the pedals and can contain two parts, tails up ( P ) and down ( Q ) When the music has been compiled the order of parts as shown in the Control Byte is from most to significant bit to least: S, X, A, T, Y, B, P, Q
30. Visual Basic and Windows can now be closed and a compilation program loaded in GWBASIC under MS-DOS Details of the file-stem ( Bday ), bar numbers ( 1, 5 ) and Folder ( Happy ) are entered, together with an estimate of the required metronome value in crotchet beats per minute The compiler then reads each if the .DAT files in turn and processes them into the format required by the BBC program The complete data list is saved as a .BIN file, e.g. 8HBDAY1.BIN , indicating 8 parts (and 7+ext file name) ERNIE the Electronic Organist Compiling The Data
31. Control is now passed to a second program in GWBASIC ERNIE the Electronic Organist Generating The Data This enables the data to be edited and any errors and omissions corrected In this 8-part PC editor two lines of data , comprising 32 columns or events , can be displayed Note that a line of displayed data does not as a rule correspond to a line of the printed music
32. Various features of the data are indicated by their colours: green (decimal) numerals indicate memory addresses at which the data for each event begins ERNIE the Electronic Organist Generating The Data Red (decimal) numerals are the Duration Parameters Pale blue (hexadecimal) numbers are the Control Bytes, and the white characters define the note letters and the octaves in which they are situated The usual range of organ music is from two octaves below middle C (C1-B1, and C2-B2) to two and a half or three octaves above (C3-B3, C4-B4, and C5-F5 in this case)
33. Phrasing in organ music is achieved solely by small adjustments to the duration of selected chords and by short gaps inserted between them ERNIE the Electronic Organist Editing The Data Pressing any key at this stage of the display causes the lower line of 16 columns to be erased and replaced by cues and space for input statements to make any changes The data as initially compiled will often sound rather bland and boring but can be made to sound more realistic by careful editing at this stage In particular it is the custom to increase the length of the first note in each bar by one unit , a process carried out automatic- ally by the compiler
34. A further GWBASIC program is then invoked to transfer the file over a parallel cable to a BBC where it is received and saved by another program ERNIE the Electronic Organist Transferring The Data After the data has been edited it is wise to save it to a different filename, e.g. 8HBDAY2.BIN There is also a BBC data editing program but due to memory space constraints it is very limited in scope compared to the PC version & can display only 10 cols or events at a time The data, now on a BBC floppy disc , can be taken to the church to be tested on the organ If necessary, final adjustments can be made there using the BBC editor
35. In typical geek fashion, the project was originally undertaken to test an idea and see if it could be done After a few teething troubles were ironed out it has proved extremely versatile and reliable and appears to be capable of playing almost any organ music that can be rendered on a single-manual instrument It just requires sufficient time and patience in setting up and editing the data ERNIE the Electronic Organist So Why Bother?
36. It now plays most of the voluntaries in the weekly service and has even been used for an evenings organ recital, raising money for charity With the aid of a computer-literate assistant, it has occasionally been used to accompany the hymn singing when no organist has been available However, setting up the files for 5 hymns is no trivial task since each verse may need to be differently edited for correct phrasing due to different words ERNIE the Electronic Organist What He Can Do
37. And now for a short recital ERNIE the Electronic Organist Ernie Performs!
38. I have often wondered if, instead of spending so much time designing hardware, software and inputting data to the system, Dad had spent the time practicing the organ tunes in the first place, he would be able to play them himself! But that would not have been half the fun ;-) So, any questions ? ERNIE the Electronic Organist Final Thoughts