Magazine Archive

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

BeeBMIDI (Part 3)

Article from Electronics & Music Maker, August 1984

Software listings that enable owners of our BBC Micro MIDI interface board to view the internal workings of the Yamaha DX7 on screen, with a cassette available from E&MM for the finger-sore.

Last month's article was intended to set readers building our interface unit for the BBC Micro on the path to writing some software of their own for MIDI. This month Jay Chapman provides a full listing of a comprehensive voice dump program, written in BBC BASIC and 6502 Assembler, for the Yamaha DX7.

Even if you don't have the necessary DX7-BeeBMIDI interface-BBC Micro combination, you should still find that there is something in this article for you. In particular, analysing the programming techniques used to convert the MIDI data from numbers into something readable - for example, the keyboard note numbers into the note name and octave - should be of interest. DX owners will be pleased to find a routine for converting the Fixed Frequency Coarse and Fine parameters into a meaningful frequency value, which is a problem all the other dumps I've seen have ignored! Last but by no means least, the dreaded checksum byte is dealt with. I feel this is much called-for since the checksum idea seems to have foxed quite a few people.

Using the Program

Having typed both the BBC BASIC programs in (cooling your blistered fingertips in a bowl of ice) and checked them carefully, you should then run the 6502 Assembler Source program. Note that I always save such a program before running it, in case the machine code assembles on top of the residence source program (due to one of my fate-tempting typing errors). I strongly suggest you follow my example!

You have now assembled the four assembler routines into the part of RAM usually reserved for the User Defined Character Definitions - since we don't define any characters this area is free.

The point to bear in mind is that we are not in any way interfering with BASIC memory area, and BASIC won't interfere with the machine code either.

You must now save a copy of the assembled code which will be loaded in later by the main program. To do this type in: *SAVE MC CA3 CFF

The significance of the 'CA3' and 'CFF' will become apparent later. If you are working with tape rather than disk, you should do the *SAVE onto tape immediately following the save of the main program.

Next chain 'DX7DUMP' (or whatever name you saved the main program under) which will automatically load the machine code and present you with a menu asking you to make a choice. Have a look at lines 1080 to 1130 for the menu. As you can see, it's possible to receive or send a program to/from the DX7 or disk/tape as well as displaying the voice parameters on the screen or printing them out.

The printout format is intended to mimic that of the 'YAMAHA DX7 VOICE DATA LIST' forms, as shown in the DX7 manual and used by the DX Owners' Club. Analysis of voices is greatly aided by being able to see all the voice parameters at the same time (rather than one at a time as on the DX7 display) and a great deal of time transcribing voice parameters onto paper need no longer be wasted. The ability to save voices on disk effectively extends the number of 'on-line' program memories available in the same way as the Yamaha RAM packs, but is a lot cheaper if you already have a BBC Micro.

The program is more or less self-explanatory in use, but you may well find it worthwhile (re)reading page 22 of your DX7 manual ('Using MIDI') which should explain some of the prompts you get whilst sending to or receiving from the DX7.

It is unfortunate that there is no way of asking the DX7 to transmit data from MIDI. All transfers have to be initiated at the DX7 end, and because of this the Function parameters have not been dealt with as their transfer would be impracticable (unless you want to spend 10 minutes pushing keypads in sequence for each voice transfer!). Also, these parameters are voice-independent - unless you own a DX1 - and will generally not all apply anyway.

I sincerely hope Yamaha are updating the DX7 software to respond to transmission requests over MIDI - it really is an important feature and I for one am rather surprised to find it missing.

Figure 1.

Machine Code

The addresses of the routines below (which are called in the main program) were picked off the assembly listing and set up in line 1000 of the main program. You should also see from the assembly listing that the routines start at &CA3 and finish at &CFF - remember the *SAVE MC?

The rx_midi routine has been discussed in previous articles, so we'll move on. The dx7dmp routine listens on MIDI In and checks whether the streams of bytes it receives correspond to a DX7 voice data transmission on MIDI channel 1. Lines 1200 to 1320 of the Assembler Source program check for the sequence in Table 1. ('&' indicates a HEX number)

If you generally have your DX7 on a different channel, say number 4, then you should alter the check for the third byte (line 1280) to &03 - don't forget that MIDI thinks of external channels 1 to 16 as internal channels 0 to 15.

If the header sequence is OK, then the rest of the 162 bytes are received and stored (by lines 1330 to 1350) in the buffer area called (ie. addressed by) pg0, which is in the machine code RAM area before the actual code. The 162 bytes consist of the four header bytes above, followed by two bytes counting the number of data bytes in the message, followed by the 155 voice data bytes, followed by 1 checksum byte(!)

The dxsnd routine simply sends the current voice's 162 data bytes (ie. the data in pg0) back to the DX7.


This byte seems to be a source of anguish for an awful lot of would be MIDI programmers, but the chksum routine should solve all your problems. All you have to do is add up all the data bytes whilst happily ignoring an overflow. The checksum byte sent over by the DX7 was calculated in the same way and then negated before transmission, so when you add it in, your overall result should be zero if the data (and checksum) made it across OK. Note that since only seven checksum bits were sent across, your result need only be zero in its least significant seven bits - see line 1480, which chops off the unwanted bit.

Conversion Techniques

This is where you have to do some work!

The BBC BASIC functions in lines 2270 onwards of the main program are responsible for the conversion and formatting of MIDI data. The symbol 'par' is used to address the start of the 155 voice data bytes, and these bytes are 'peeked' as required. For example, the main formatting function, FNpg0, line 2290, simply 'peeks' the data byte asked for by the parameter pgn, passed into the function by doing 'par?pgn', and then ensures that the format is always exactly two characters long by using STR$ and RIGHTS.

You should find the methods employed in FNpitch using MID$ and MOD and the predefined strings notes$ and sharps$ particularly edifying, and have a good look also at FNfreq, for the secrets of fixed frequency parameter conversion. In case you're wondering where the magic number 1.023293 comes from, I can tell you it's not given in any of the DX7/MIDI documentation I've seen. It's actually the 99th root of 9.772 to exactly the right degree of accuracy - see if you can work out where it comes from.

(Click image for higher resolution version)

(Click image for higher resolution version)

(Click image for higher resolution version)

(Click image for higher resolution version)

Software on Cassette

For those readers unwilling - or unable - to spend long hours keying in the dump program, E&MM is offering this software on cassette, price £7.95. Send cheques/POs (payable to Music Maker Publications Ltd.) to EmmSoft, (Contact Details). Please allow 28 days for delivery.


DX7DUMP (E&MM August '84)

The *SAVE command for the machine code should have been as follows: *SAVE MC CA3 D00

You can thank an error in the Watford DFS manual for that one - but the rest of the DX7DUMP errors are all the author's (Chapman hangs his head in shame!). He's also set the keyboard links on his BBC Micro so that the beast boots up in screen MODE 3 - if you haven't, you might like to add the following line to DX7DUMP: 10 MODE 3 Finally, alter the lines below to read as shown below:

Series - "BeeBMIDI"

Read the next part in this series:

BeeBMIDI (Part 4)
(EMM Nov 84)

All parts in this series:

Part 1 | Part 2 | Part 3 (Viewing) | Part 4 | Part 5 | Part 6 | Part 7 | Part 8

More with this topic

Browse by Topic:


Also featuring gear in this article

BBC Micro
(ES Feb 84)

BBC Reverb
(ES Feb 84)

Load Baring
(12T May 85)

Load Baring
(12T Aug 85)

Soft Music
(ES Mar 84)

(EMM Feb 84)

(EMM Mar 84)

(EMM Apr 84)

(EMM May 84)

(EMM Jul 84)

(EMM Aug 84)

(EMM Jan 85)

(EMM Feb 85)

(EMM Apr 85)

(EMM Jun 85)

(EMM Jul 85)

(EMM Feb 86)

(EMM Mar 86)

(EMM May 86)

(EMM Jun 86)

(EMM Aug 86)

(EMM Sep 86)

(MT Nov 86)

(MT Dec 86)

(MT Jan 87)

...and 19 more Patchwork articles... (Show these)

Browse category: Computer > Acorn

Browse category: Synthesizer > Yamaha

Featuring related gear

Expand your DX
(SOS Jan 87)

Hi-Tech Xpansion
(EMM Apr 85)

Pandora's Box
(MIC Oct 89)

Russ DX7 AI Editor
(SOS Apr 88)

(MM Apr 87)

(MT Feb 88)

(MT Dec 88)

(MT Nov 89)

...and 2 more Patchwork articles... (Show these)

Browse category: Software: Editor/Librarian > Sound Design Studio

Browse category: Keyboard - Peripheral > ATPL

Browse category: Synthesizer > Yamaha

Browse category: Expansion Board > Grey Matter Response

Browse category: Synthesizer Module > Yamaha

Browse category: Keyboard - Peripheral > Hybrid Technology

Browse category: Software: Editor/Librarian > Joreth Music

Browse category: Software: Editor/Librarian > Pandora

Browse category: Software: Editor/Librarian > - (No Manufacturer)

Browse category: Software: Editor/Librarian > Steinberg

Previous Article in this issue


Next article in this issue

Modular Synthesis

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 - Aug 1984





Part 1 | Part 2 | Part 3 (Viewing) | Part 4 | Part 5 | Part 6 | Part 7 | Part 8

Gear in this article:

Computer > Acorn > BBC Model B

Synthesizer > Yamaha > DX7

Gear Tags:

Digital Synth
FM Synth
FM 6-Operator

Feature by Jay Chapman

Previous article in this issue:

> Stagefright

Next article in this issue:

> Modular Synthesis

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 February 2024
Issues donated this month: 0

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

Funds donated this month: £17.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!

Small Print

Terms of usePrivacy