Info-Mac-Request@SUMEX-AIM.STANFORD.EDU (The Moderators) (11/20/89)
Info-Mac Digest Sun, 19 Nov 89 Volume 7 : Issue 205 Today's Topics: 3D graph source [DCJCON]FLASH!Spellswell 2.2 Corrupts WriteNow & Acta Receipt Color of a pixel compilers: lisp,prolog,ada dashed line object in MacDraw II Flight simulator source IBM PC lookalike screen font wanted I can't get the map cdev to work Kermit/LSC/variant records Mac PROLOG info request mail systems for mac/tcp multiscreen screensavers? PICTs and Drawing them PopChar Problems Procedure type in LS Pascal Sound files format White Knight/Red Ryder Your Info-Mac Moderators are Bill Lipa, Lance Nakata, and Jon Pugh. The Info-Mac archives are available (by using FTP, account anonymous, any password) in the info-mac directory on sumex-aim.stanford.edu [36.44.0.6]. Help files are in /info-mac/help. Indicies are in /info-mac/help/recent-files.txt and /info-mac/help/all-files.txt. Please send articles and binaries to info-mac@sumex-aim.stanford.edu. Send administrative mail to info-mac-request@sumex-aim.stanford.edu. ---------------------------------------------------------------------- Date: Wed, 8 Nov 89 23:03:36 PST From: light@ux3.lbl.gov (Francis Rubinstein) Subject: 3D graph source Herein find the C source for a 3D graphing program I wrote some time ago. The program demostrates how to do non-perspective 3D plotting and mathematical expression parsing. All math is floating point, though some of the code for fixed point math remains. It is not particularly well commented, since I never wrote it for other eyes; in most cases I was interested soley in speed, not readability. Feel free to send me any questions, though I don't guaruntee useful answers. Since this program was mostly an experiment, it is guilty of some unfortunate behavior, such as writing directly to the screen buffer; I don't nescessarily encourage anyone to emulate my examples in this regard. (Though if you're really determined to draw lines very quickly...) I've retained the copyright; feel free to steal ideas at whim. If you extract significant sections of code unchanged, copy the copyright message at the top of each file. This version incorporates the ability to read the files generated by Dave Platt's MandelZot program and plot them as landscapes, which the executable version I posted did not. Once I've gotten ThinkC4.0 to its knees I'll post an executable version of this. (The project included with the source is ThinkC vers. 3.0) If you're trying to do perspective 3D plotting, I plan to post an example of code that shows how to do this (actually a sort of poor man's flight simulator). Chris Moll chris@hobbes.lbl.gov (415)843-2437 [Archived as /info-mac/source/c/three-d-graphics.hqx; 108K] ------------------------------ Date: Wed, 15 Nov 89 20:32:02 PST From: "[DCJCON]FLASH" <XB.DAS@forsythe.stanford.edu> Subject: [DCJCON]FLASH!Spellswell 2.2 Corrupts WriteNow & Acta Receipt Date: November 14, 1989 6:00 pm PT Item: 3281791 >From: FLASH Flash (K.J.) Sheridan To: DASNET @CONNECT-DASNET Mail Gateway cc: WORKINGSW Working Software, Inc. Subj: Spellswell 2.2 Corrupts WriteNow & Acta Files Spellswell 2.2 advertises that it now checks WriteNow and Acta Application files; it does, but it corrupts them: Acta files merely cosmetically, WriteNow files fatally. The two bugs seem unrelated, to each other or to older, more tolerable bugs which are still around. Spellswell reset my second WriteNow footnote to 381, then to 81. I viewed footnote 81, scrolled *backwards* to later feetnote, tried to view the page, and was rewarded with "A non-existent file-path was specified." This is only my second crash in two years with WriteNow; merely the latest of many with Spellswell. The file seems unopenable. In Acta font or size changes within a word cause get lost, but words nearby acquire similar changes. I reported this bug in the last version, but nothing's happened. Flash@DCJCON.DAS.NET (preferred)(MacNet) FlashsMom@cup.portal.com ------------------------------ Date: Wed, 15 Nov 89 16:16:10 -0500 From: demarsee@icarus.cns.syr.edu (Darryl E. Marsee) Subject: Color of a pixel How does one go about finding out the color mixture information for a pixel on the screen? I need to get the Hue/Saturation/Brightness (HSB) or Red/Green/Blue (RGB) values of a pixel that is currently visible on the Mac screen. Ideally, I'd like to find something like the FatMouse DA that displays this color information, but in lieu of that, anything that doesn't require some big bucks package like PixelPaint will do. Any clues out there on how to do this? Regards, Darryl Marsee Syracuse University ------------------------------ Date: Thu, 16 Nov 89 10:36:26 +0100 From: Pottie Karl <GHGAQBA%BLEKUL11.BITNET@forsythe.stanford.edu> Subject: compilers: lisp,prolog,ada I would like to get into contact with people who use a Lisp interpreter or Ada or Prolog compiler on their mac (not xlisp or mini-ada but the real thing). drop me a mail on GHGAQBA@BLEKUL11.BITNET ------------------------------ Date: Wed, 15 Nov 89 19:02:39 CST From: kc_yeo@sngsf1.sinet.slb.com (KC Yeo*Sedco Forex S'pore*Tel-65-345-9944*Fax-65-344-2655) Subject: dashed line object in MacDraw II I use MacDraw II 1.0v2 - June 1988 with LaserWriter Plus and Mac II. I cannot draw dashed object like rectangle, oval, circle though I checked Dashed line under the Pen menu. Drawing dashed line, e.g. straight, slanted or horizontal lines has no problem. I wonder what's wrong. Can some of the knowledgeable MacDraw II users out there enlighten me ? I don't have the manual. Any help will be very much appreciated. Thank you Arthur Yeo SINet : KC_YEO@SNGSF1.SINET.SLB.COM ------------------------------ Date: Thu, 9 Nov 89 13:02:38 PST From: light@ux3.lbl.gov (Francis Rubinstein) Subject: Flight simulator source This is the source code for a program to demonstrate how to do 3D perspective drawing and clipping. It's written as a sort of crude flight simulator - you "fly" through a rather simple world. It also shows how to do simple animation. All math is fixed-point to make the speed tolerable on feebler Macs. On a II the speed would be roughly the same using floating point. If some would prefer to see a floating point version, that could be done. The package contains the source code, a ThinkC vers.4.0 project, and an executable version compiled for any Mac. Comments etc. to Chris Moll chris@hobbes.lbl.gov (415)843-2437 [Archived as /info-mac/source/c/flight-simulator.hqx; 28K] ------------------------------ Date: Wed, 15 Nov 89 21:51:11 DNT From: Jakob Nielsen <DATJN%NEUVM1.bitnet@forsythe.stanford.edu> Subject: IBM PC lookalike screen font wanted I want to be able to generate illustrations *on my Mac* which look as if they are screendumps from an IBM PC. For this purpose I need a font which looks like the monospaced characters on a standard IBM PC screen. Could somebody please point me to such a font (if it were ftp'able, it would best, but anything would help). Jakob Nielsen, Technical University of Denmark Department of Computer Science, DK-2800 Lyngby Copenhagen, DENMARK Tel: +45-31-38 23 20 or +45-42-88 15 66. Fax: +45-42-88 22 39 Email: datJN@NEUVM1.bitnet OR jn@iddth.dk OR nielsen.chi@xerox.com ------------------------------ Date: Wed, 15 Nov 89 21:54:44 PST From: clancy@janus.berkeley.edu (Mike Clancy) Subject: I can't get the map cdev to work The symptom is that all my cdevs except Map appear when I select Control Panel. However, the BUNDLE, SYSTEM, INITED, and CACHED bit are set in the Map file (according to DiskTop). I'm running System 6.0.2, Finder 6.0, and a bunch of inits on a 512KE with a 2M Monster Mac upgrade. Renaming Map doesn't help, and copying Map from the original disk doesn't either. Any suggestions as to what could be causing the problem, or what I should be doing to try to track it down? ------------------------------ Date: Thu, 16 Nov 89 10:34:56 CST From: Michael Hanrahan <C09615MH%WUVMD.BITNET@forsythe.stanford.edu> Subject: Kermit/LSC/variant records Hi, I have a question regarding Kermit/LSC/variant forms of Pascal records. Yes, all three of these in one integrated question :-) In an attempt to imbed Kermit's file transfer protocol within an electronic mail bridge we are writing, I am first trying to simply port the C source to MacKermit to Lightspeed C (oh, excuse me -- Think's C). The ckmfio.c source file (which handles all file io) uses the CInfoPBRec data structure described in Inside Mac Volume IV on page 186. Unfortunately, LSC's FileMgr.h header file which declares some of the File Manager data structures DOESN'T define this data type. The Pascal declaration for the types involved with CInfoPBRec looks something like: CInfoType = (hfileInfo,dirInfo); CInfoPBPtr = ~CInfoPBRec; CInfoPBRec = RECORD qLink: QElemPtr; . . . filler2: SignedByte; CASE CInfoType OF hfileInfo: (ioFlFndrInfo: FInfo; . . . ioFlClpSiz: LONGINT); dirInfo: (ioDrUsrWds: DInfo; . . . ioDrParID: LONGINT); END; When used, you can always use the fields such as qLink, and you can use either the fields defined under hfileInfo or those under dirInfo. The compiler figures out how what to pass by looking at the field names you use. *********************************************************************** * The question: How do you declare these variant records in C? * *********************************************************************** I know how to use typedef struct { and typedef union but anything beyond that is beyond me at this point. What I find particularly confusing is that when my source code uses this record and uses one of the fields contained in one of the two variant portions, it references it as info.hfileinfo.ioFDirIndex = fileindex; which (to me) seems like it's trying to tell the compiler to use the hfileinfo variant form of the record CInfoPBRec. However, LSC seems to be interpreting it as a Pascal compiler would: it says ioFDirIndex is an unknown struct/union member because it's thinking ioFDirIndex is a field within the variant part of the record. It's not. It's part of the "main" record which is the same for both variant forms. Any help you could provide would be greatly appreciated. Also, any other hints for converting MPW C programs to Think C would also be quite welcome. Michael Hanrahan Educational Computing Services Washington University St. Louis, MO 63130 ------------------------------ Date: Thu, 16 Nov 89 10:06 CST From: "tony bible, iowa state university" <GVAEB@ccvax.iastate.edu> Subject: Mac PROLOG info request I need to find a Macintosh PROLOG for use in a class this coming Spring term. It would be nice if the supplier also had a version for IBM/Compatible PC's and/or VAX's, but that is not a requirement. Any information including recommendations/warnings would be appreciated. BTW, if, like me, you thought Borland had a Mac version they don't. Thanks in advance for your help. Tony ------------------------------ Date: Thu, 16 Nov 89 09:35:55 PST From: meldal@anna.stanford.edu Subject: mail systems for mac/tcp Stanford University has developed two packages addressing the need for TCP/IP connectivity. One named Su-MacIP, which does telnet and ftp, and the other named MacMH which does mail processing. Both use an ethernet connection (either directly or through an appletalk-ethernet gateway). MacMH needs a POP-server (or some such, I do not remember the name) running on a host on the ethernet. Such server software exists in the public domain, I believe. The price is around $100 for academic institutions. With MacMH you keep all your mail on the mac, and allows folder based organization of messages. Contact Academic Information Resources Stanford University Stanford CA 94305 for further information. -- Sigurd ------------------------------ Date: Wed, 15 Nov 89 12:22:37 EST From: George McKee <mckee@corwin.ccs.northeastern.edu> Subject: multiscreen screensavers? Are there any screen savers available that can blank multiple screens? Due to one of Apple's rare cases of generosity, I have both a 4-bit grayscale monitor and an 8-bit color one on my Mac II. I've tried six or eight different screensavers, and they generally darken only the screen with the menubar. Since I like to have the menubar on the grayscale screen, this leaves my expensive monitor in burn-in mode. The only one I've found that ever darkens both screens calls itself "blackout". It tries to cover the darkened screen with zooming circles, but in the only arrangement of pixel depth, startup order, menubar location, and screen arrangement that works at all (no, I haven't tried all 16 combinations :-), these "stars" pile up on the left-hand edge of the right hand display without making it all the way across. Other arrangements only darken one screen. Now that the IIci comes with built-in display hardware, I'd expect people who want more advanced graphics to start using two displays, rather than waste the built-in one, and my situation will become more widespread. - George McKee College of Computer Science Northeastern University, Boston 02115 Internet: mckee@Corwin.CCS.Northeastern.EDU Phone: (617) 437-5204 uucp: ...purdue!iuvax!corwin!mckee (don't ask why) ------------------------------ Date: Wed, 15 Nov 89 22:19 CST From: <BPB9204%TAMSTAR.BITNET@forsythe.stanford.edu> Subject: PICTs and Drawing them I'm having a problem that's not so obvious to me. What I'm doing seems simple enough, but it doesn't work. Here it is: setPort(@myWindow); For i := 0 To 11 Do Begin myPic[i] := Nil; myPic[i] := getPicture(i * 30); { ID #s are 0,30,60...33 0} If myPic[i] = Nil Then Begin sysbeep(4); moveto(20, 20 * i + 20); numtoString(i * 30, numberStr); drawString(concat('PICT id# not found: ' , numberStr)); End; myPicR[i] := myPic[i]~~.picFrame; End; {drawing starts here in a repeat .. until loop to 'animate'} I know it's reading the resources OK because I have never had it beep, but when I call drawPicture(myPic[x],destinationRectangle); nothing happens. I also have recently been getting an 'Address Error' message in Think Pascal 2.0 on the drawPicture procedure. Can someone send me an example of how to display many PICTs (for cheap animation) ? If not, can someone tell me what I am not doing correctly? Any and all suggestions are appreciated. Brent Burton BPB9204@TAMSTAR.BITNET -=-=-=-=-=-=-=-=-=-=-= ------------------------------ Date: Thu, 16 Nov 89 09:01:59 MST From: Bruce Long <ICBAL%ASUACAD.BITNET@forsythe.stanford.edu> Subject: PopChar Problems In I-M Digest 191 there was a message about a problem with PopChar INIT when used with two monitors, where one monitor is left of the apple (in other words, one monitor has negative horizontal coordinates). Clicking almost anywhere in the left monitor will activate PopChar. A partial solution may be found in the fact that PopChar INIT will not activate if the option or command key is pressed when clicking. This solution will be inadequate if your main monitor is left of the apple, but if your secondary monitor is left of the apple this workaround may be acceptable (for example if your left monitor has your communication program which remains on-line while you work under multifinder in the right monitor). Bruce Long Department of Mathematics Arizona State University BITNET: ICBAL@ASUACAD ------------------------------ Date: Thu, 16 Nov 89 08:09:42 EST From: chris@adms-rad.unisys.com (Chris Sterritt) Subject: Procedure type in LS Pascal Craig Cottingham writes: >Date: Wed, 08 Nov 89 10:47:09 CST >From: "Lovely Angels Fanatic Cult" <UC528665%UMCVMB.BITNET@ricevm1.rice.edu> >Subject: Is there a procedure type in LS Pascal 1.1? > >I've seen the procPtr type, but so far that's only been useful for >passing procedure addresses to system routines. What I really >need is the ability to "late-bind" a procedure call, so that I can >change the actual procedure called on the fly. Does LightSpeed >Pascal 1.1 support this feature, or should I go looking elsewhere? >(I suppose I could hack it together in assembly language, but that's >not a desired option at this time.) > >Thanks in advance, > >craig s. cottingham > -- "Remember to be wary of wizards, > for to them, thou art crispy, > and go well with strawberry jam...." Try examining the source of the TransSkel application skeleton. They do a 'late bind' to allow you to tell TransSkel what function to call when a menu item is chosen, etc. I'm pretty sure TransSkel is in the archives. --chris sterritt chris@adms-rad.unisys.com ------------------------------ Date: Wed, 15 Nov 89 21:11:23 EST From: Damian%UMass.BITNET@forsythe.stanford.edu Subject: Sound files format Wow, I wasn't expecting such an outpouring of responses from the net regarding sound file formats. I have received so many requests for forwarding of information that I decided to post a summary (my first one!). Thanks to everyone who responded...it was a great help. Damian Roskill damian@mars.ucc.umass.edu ========================================================================= Eric Keller writes: ========================================================================= Here is the info on SoundEdit files right out of the Manual for Signalyze(TM), my speech analysis program. Signalyze does all the conversions between ASCII, MacAdios, SoundEdit, snd resource, plus a ton of other things. Good luck. Eric Keller File type: FSSD, Creator: SFX! SoundEdit files maintain a 64-byte resource called TINFOU (u. c.) and numbered 1000. Sampling rate information is given according to recording frequencies available through Farallon A/D converters. Although FarallonUs own documentation gives the frequen- cies as 22, 11, 7, and 5 kHz, the actual frequencies appear to be 1 = 22.256 kHz, 2 = 11.128 kHz, 3 = 7.418 kHz, 4 = 5.564 kHz, as in SoundWave format. SoundEdit files have separate recording and playback frequency parameters. Both soundEditHdr.relRecFreq and soundEditHdr.relPlaybackFreq are set to 65536 when recording and playback speed are normal, >65536 when the speeds are greater and <65536 when they are less. Signalyze calculates a multiplication factor on the basis of the ratio between relPlaybackFreq and relRecFreq, and adjusts the sampling frequency accordingly on input. For file length information, Signalyze does not use the soundEditHdr.lftChnnlLength parameter, but instead obtains sound data length directly through the Toolbox command GetEOF(refnum, &SoundLength) to guard against failures >From truncated files. The right channel stereo information and the compression ratio parameters are ignored by Signalyze version 1.0. Stereo will be supported at some future point in time. typedef struct soundEditHdr { long res0; reserved by Farallon long res1; reserved by Farallon Fixed relRecFreq; relative recording frequency in fixed point format Fixed relPlaybackFreq; relative playback frequency in fixed point format long compression; set to 0 by Signalyze in save long mode; 0 for mono, 1 for stereo long windowPos; set to standard size window by Signalyze in save long sRate; 1 for 22kHz, 2 for 11kHz, 3 for 7kHz, 4 for 5kHz long lftChnnlLength; number of samples for mono or left stereo channel long rghtChnnlLength; number of samples for right stereo channel long res10; reserved by Farallon long res11; reserved by Farallon long res12; reserved by Farallon long res13; reserved by Farallon long res14; reserved by Farallon long res15; reserved by Farallon } soundEditHdr ; This is the file format for the MacRecorder program SoundEdit. This is the one that comes from Farallon, not the old do-it-yourselfer (don't know about that one :-) ========================================================================= Myron-Meier@Sun.COM writes: ========================================================================= SOUNDEDIT FILE FORMAT Tech Note - Revision 1 Copyright ) 2/24/88 Farallon Computing, Inc. All rights reserved. The SoundEdit file format is a standard Macintosh file which contains both a data fork and a resource fork. The data fork is used to store the actual sound samples, while the resource fork contains a series of resources describing various parameters of the sound and the way it is displayed on the screen. The file type is 'FSSD' and the file creator is 'SFX!'. DATA FORK The data fork contains 8-bit linear sound samples, where each byte is a single sample which can have a value between 0 and 255. The amplitude of a sample is obtained by subtracting 128 from this value. In other words, 0 corresponds to the minimum amplitude of -128, while 255 corresponds to the maximum amplitude of 127. Note that this conversion does not need to(and in fact should not) be done before "playing" the sound. The Macintosh system hardware and software expects to see the sound samples in this offset format. This conversion is only nec essary if you are somehow manipulating the sound wave, such as amplification, or spectrum analysis. Also note that there is no header of any kind preceding the sound samples. In the case of a stereo sound, the left channel sound samples appear first, followed immediately by the right channel sound samples. There is no gap and no odd-byte filler. RESOURCE FORK The resource fork contains four resource types: CLRS, INFO, LABS, and REPT. There is a single resource of each type with a resource ID of 1000. The CLRS an d LABS resources contain the colors and labels, if any, that have been applied to selected portions of the sound wave. Since these are not pertinent to the sound characteristics themselves, nothing more will be said about them. The REPT resource contains 6 long-word (32-bit) values which correspond to the "report" boxes in the lower right-hand corner of the SoundEdit window. These 6 values are defined as follows: Longword 0 Mouse position. (Not really meaningful) Longword 1 Length of sound in samples. For stereo, this value is not the sum of the 2 channels, but rather the length of a single channel or the longer of the 2, in case they're uneven. Longword 2 Sample number of the selection beginning, if there was a selection when the file was saved; or the cursor position otherwise. Longword 3 Sample number of the selection end, if there was a selection when the file was saved; or the cursor position otherwise. Longword 4 Sample number of the loop beginning if a loop was defined. Longword 5 Sample number of the loop end if a loop was defined. The INFO resource contains 16 long-word values, of which only the first 10 are currently used. These define various characteristics of the sound as follows: Longword 0 (used internally) Longword 1 (used internally) Longword 2 Fixed point value defining the relative record frequency selected with the "Set Pitches..." menu item. Longword 3 Fixed point value defining the relative playback frequency selected with the "Set Pitches..." menu item. Longword 4 Compression mode. 0 for none; 1 for 8:1 compression Longword 5 Mode. 0 for mono; 1 for stereo. Longword 6 Window position. Vertical and horizontal coordinates of the window when the file was saved. Longword 7 Sample rate. 1 - 22 KHz; 2 - 11 KHz; 3 - 7 KHz; 4 -5 KHz Longword 8 Length of left (or mono) channel in samples. Longword 9 Length of right channel in samples if stereo. ========================================================================= And last, but certainly not least, Margot Flowers writes: ========================================================================= There is a two or three page document you can get them to send you if you call them up and ask nicely. At least they did when I asked them, but that was about 2 years ago, so things may have changed. Margot Flowers Flowers@CS.UCLA.EDU ========================================================================= Disclaimer: those opinions expressed in this letter are thoses of the individual authors...blah...blah...blah.... ------------------------------ Date: Wed, 15 Nov 89 22:44:58 -0600 From: dnewman@emx.utexas.edu (David Newman) Subject: White Knight/Red Ryder Has anyone heard what the deal is with the new version of Red Ryder? I am told that the program has been renamed "White Knight", and that it will be released soon. I am also told that it has lots of new features. Question: will upgrade notices be sent out? How do we upgrade otherwise? Any information will be apprecciated. >>Dave ------------------------------ End of Info-Mac Digest ******************************