TweetFollow Us on Twitter

Aug 89 Letters
Volume Number:5
Issue Number:8
Column Tag:Letters

Letters

By David E. Smith, Editor & Publisher, MacTutor

Font Tool

Fabien Samuel

Paris, France

As always I read the March issue of your magazine with pleasure and interest. I would like to share a comment about Randy Leonard’s article, “How To Write a Font Tool for MPW”. To start with, all my congratulations for giving a very clear presentation of the matter. I think anybody who reads the article now has all the material to easily start writing his own MPW tools. I just have a comment about the use of SetResLoad(false): as stated in IM, you should SetResLoad(true) as soon as possible after calling SetResLoad(false), or you may be asking for trouble. Although there is no problem in Randy’s program if it has a normal exit, it seems SetResLoad(true) will not be called when the program terminates on an error condition, and this might be a problem.

It appears the only call in the program that might trigger Resource loading is GetFNum, so I would personally bracket this call with SetResLoad(false) and SetResLoad(true). In that case SetResLoad(true) isn’t even needed, because GetFNum automatically calls it before returning (IM I - 223).

Resource Fork Problem

Paul Onstad

St. Paul, MN

I enjoy your articles of Pascal code but have never come across an example which would lead me out of the problem that has stopped my application dead in its tracks.

1. I wish to maintain data in both forks of an applications HFS data file.

2. HFS provides only one Resource Manager call which considers the location of the file for subsequent resource calls, i.e., OpenRFPerm.

3. However, when the user performs a “Save” or “Save as ” the existing file must be erased with FSDelete. Create then follows to create both forks of the file and the revised data is written to the data fork. The previous resource fork data is temporarily saved in memory by the application. The resource fork of the new file is now empty.

4. After the new data fork has been filled. A call to OpenRFPerm is made to open the empty resource fork with the intention of using AddResource to place the memory-saved resource data back into the revised file. But, OpenRFPerm returns an unsuccessful “-1” because of ResError -39 (logical eof encountered on the empty resource fork).

Without a valid refNum from OpenRFPerm there appears to be no way to communicate back to the application the location (folder, etc.) in which the resource data should be restored on disk. The existing refNum was lost because the resource fork had to be closed before FSDelete--otherwise the file was “busy” and could not be deleted.

Additional (if of some use): DetachResource was used just before the file was erased in order to hold the resource data in memory while the actual resource (and data) file was deleted.

If you can provide any examples or information, it would greatly be appreciated.

MIDI Problems

John Kaplan

Chicago, IL

I have been following your articles in MacTutor for some time, but have only recently been able to try your MIDI routines. I was hoping you wouldn’t mind a few comments and questions that came up for me as I worked.

First, I know your code was meant for the MDS assembler and LSP version 1, but I was using MPW for assembly, and had to use LSP version 2. (Version 1 cannot link MPW object files.) I found that LSP v2 would not accept an MPW object file with DC’s in it so I declared all the variables as IMPORT’s in the assembler, and as variables of corresponding types in the LSP interface file. I didn’t really understand why people objected to the use of A5 variables in the first place (since if your going to use MIDI in an application you’re going to have to have space for your data somewhere anyway ) but that’s not the point. The point is that after framing everything in PROC and ENDPROC directives for MPW and moving the blocks around to avoid forward references, the whole thing compiled and linked fine. The only other thing worth mentioning is that MPW assumes when a variable is imported that it is referenced through A5, so there are no explicit A5 references for the variables. (You probably know all this already, but I mentioned it just in case.)

The next snag I ran into was in testing the routines in LSP I wrote a little program that writes incoming MIDI information in the LSP text window. This was a big mistake, as LSP v2 seems to reserve the right to move your code around in memory as it calls graphic operations to update it’s text window. After the ten or fifteen crashes it took me to figure this out, I rewrote my code so I made my own window, and drew the MIDI information in with drawstring. (And locked the CODE resource for the LSP project in ResEdit, just to be on the safe side.) Finally RxMIDIA worked like a charm.

Then I wrote a simple sequence in my test program that sends a note on, then a note off for the same note. This just doesn’t work, and try as I might, I can’t find what’s wrong. I’ve been over my code 5 times and can’t find a typing mistake, and I don’t have the expertise in interrupts or serial chips to know exactly what’s going on to debug it. I was thinking there might be another compatibility problem with LSP v2, or a problem with porting the assembly code from MDS to MPS that I don’t know about. I was hoping you could provide some guidance. I am including all relevant code I used. Of course, if it’s too much trouble to slog through all my code to find bugs, any hint you could give me would be greatly appreciated--even so basic as how to start figuring out what’s wrong myself (chip manuals and the like?). (By the way, the hardware I used was a Mac Plus with both a Southworth Jambox 4 and an Assimitation MIDI Conductor. When I tried TxMIDIA, I got no light on the Jambox panel, no response from my synthesizer, and no message on my Yamaha MEP4 MIDI monitor--meaning either no recognizable message was sent or no message at all.)

Offending code:

 
outmidi := $0092;
txmidia(outmidi);
outmidi := $003C;
txmidia(outmidi);
outmidi := $0040;
txmidia(outmidi);

while button do
 ;
while not button do
 ;
while button do
 ;

outmidi := $0082;
txmidia(outmidi);
outmidi := $003C;
txmidia(outmidi);
outmidi := $0040;
txmidia(outmidi);

[Not being a MIDI expert myself, I’ll leave this up to any MIDI experts out there. But Kirk Austin did an update to his MIDI routines for an article in May 1989. After a quick look, I did notice a couple differences between the code you sent in and Kirk’s latest version. Kirk’s latest MIDI code wasn’t published due to space limitations. The code is on the source code disk (#44) if you wish to order it. --Ed.]

Powerful Math Libraries Available With Language Systems FORTRAN

Drew Steis

Herndon, VA

Language Systems Corporation announced that powerful math libraries from the Numerical Algorithms Group, Inc. (NAG) are now available for use with Language Systems FORTRAN. The mathematical library of scientific and engineering subroutines has not been available on the Macintosh until now.

“NAG is a well-known international producer of scientific and engineering subroutines for supercomputers, mainframes and high-end workstations,” said Rich Norling, chairman of Language Systems Corporation. “Now, for the first time, Macintosh II users will be able to access the same algorithms used on supercomputers. NAG has made 172 of the most frequently used subroutines available in one package for the Macintosh II. This is a substantial portion of the NAG FORTRAN Library and provides broad coverage of the principal areas of mathematics and statistics.

Karl Knapp, Technical Manager of NAG, called the availability of the NAG Workstation Library for Language Systems FORTRAN on the Macintosh II “a significant development, particularly for engineers who find themselves coding mathematical formulas over and over again from scratch. The library should free them up to get on with their real work.

The NAG Workstation Library offers subroutines for a wide range of mathematical applications including matrix operations, optimization, linear algebra, time series analysis and many others. The software is of particular value in projects for aerospace, energy production, chemical manufacturing, electronic design, and other areas where advanced mathematics are required.

Language Systems FORTRAN was the first FORTRAN compiler to be based in the Macintosh Programmers Workshop (MPW). The compiler is full ANSI Standard FORTRAN 77 and has the most VAX-compatible extensions on the Macintosh. It has the full capabilities of the Standard Apple Numeric Environment (SANE™), Apple Computer’s implementation of IEEE Standard 754 for Binary Floating-Point Arithmetic.

Language Systems FORTRAN Version 1.2.1 can be acquired from APDA. The NAG Workstation Library can be obtained from Numerical Algorithms Group, Inc. 1400 Opus Place Suite 200, Downers Grove, IL 60515 (312) 971-2337.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »

Price Scanner via MacPrices.net

13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more

Jobs Board

Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.