Xref: utzoo rec.music.synth:13680 comp.music:1353 Path: utzoo!attcan!uunet!clyde.concordia.ca!mcgill-vision!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!jhunix!barrett From: barrett@jhunix.HCF.JHU.EDU (Dan Barrett) Newsgroups: rec.music.synth,comp.music Subject: Re: How to download DX7 patches from 'uscd.edu' ???? Keywords: DX7, patch, header, Personal Composer librarian Message-ID: <5415@jhunix.HCF.JHU.EDU> Date: 1 Jun 90 19:41:39 GMT References: <3758@milton.acs.washington.edu> Reply-To: barrett@jhunix.UUCP (Dan Barrett) Followup-To: rec.music.synth Organization: The Johns Hopkins University - HCF Lines: 148 In article <3758@milton.acs.washington.edu> aesop@milton.u.washington.edu (Jeff Boscole) writes: >------------- >We have downloaded the patches from ucsd.edu , presumably for the DX7. >The README file present at that 'ftp' site mentions that they can't >be loaded via the Personal Composer librarian, because the headers have >been "stripped off." We sent mail to the fellow mentioned in the README >file who had made this comment, but have received no reply. > >I therefore pose the question to the net: How might we try out these >patches? The README file you saw was probably mine, since I submitted those patches to ucsd.edu. (I DID NOT MAKE THE PATCHES, NOR DID I COLLECT THEM ORIGINALLY.) In response to your question, I've whipped up a little program that adds the DX7 system exclusive headers and the checksum back to the file. The syntax is (assuming the program is named "addit"): addit oldfile newfile "newfile" gets the contents of "oldfile", plus the headers and checksum. "oldfile" itself is UNCHANGED. I have not tested this program extensively -- I just wrote it 5 minutes ago. But that's what you get for free. :-) You will need to compile this program on your favorite computer before you can use it. It is written in C. The important information is really contained in the variable header[] (the 6 missing header bytes) and the function MakeChecksum() that calculates the checksum. Any C programmer should be able to take this code and spruce it up to make it friendlier. Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Johns Hopkins University | | INTERNET: barrett@cs.jhu.edu | | | COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////////////////// ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- /* Here's a little program to take a DX7 patch file whose header and checksum * have been stripped off, and replace them. * * This program has NOT been tested extensively and is NOT robust. * It works ONLY if the original file size is 4096 bytes. * It is specifically written for files in the ucsd.edu DX7 patch archive. * * You might need to change the "r" and "w" in the fopen() calls in AddIt() * to "rb" and "wb" for computers (like the IBM PC) that need special * handling for binary vs. text files. * * Dan Barrett, barrett@cs.jhu.edu, Public Domain. * * Usage: addit oldfile newfile */ #include typedef unsigned char UBYTE; #define DX_FILESIZE 4096L /* Size of the patch file. */ #define EOX 0xF7 /* End of system exclusive. */ #define HEADER_SIZE 6 /* Size of system exclusive header. */ UBYTE header[HEADER_SIZE] = { 0xF0, 67, 0, 9, 16, 0 }; UBYTE MakeChecksum(); void AddIt(), Update(); main(argc,argv) int argc; char *argv[]; { if (argc != 3) { fprintf(stderr, "Syntax: %s oldfile newfile\n", argv[0]); exit(1); } else AddIt(argv[1], argv[2]); exit(0); } UBYTE MakeChecksum(patchData) /* Given your array of patch data, compute and return the checksum. */ UBYTE patchData[]; { UBYTE sum; int i; sum = 0; for (i=0; i