8/1/97 11:01 PM
Subject: MAX Digest - 31 Jul 1997 to 1 Aug
1997To: Recipients of MAX digests 

There are 8 messages totalling 264 lines in this issue.

Topics of the day:

  1. multitasking
  2. Lighting
  3. Pointer problems (external development) (2)
  4. Lost install
  5. Your application's own Preferences file
  6. Can a window know when it is open?
  7. Max and mtc


Date:    Fri, 1 Aug 1997 01:23:21 -0700
From:    David Zicarelli 
Subject: multitasking

As other people may have implied, there's absolutely no difference
between OS 8 and previous system versions in terms of Max's
ability to "multitask" with other applications. It's still
cooperative multitasking at the event level, and interrupt-level
processing that can happen in the background if you have Overdrive
turned on. Indeed, the "multithreading" that allows the Finder to
copy a file in the background has always been possible; it's called
asynchronous file i/o, and you couldn't do hard-disk recording
without it.

David Z.


Date:    Fri, 1 Aug 1997 12:16:22 +0200
From:    Jeffrey Burns 
Subject: Lighting

>We are building a museum presentation system that will play a sequence
>of controlling MIDI controllable stage lights and an audio track,
>hopefully played from the computer's hard drive.  We hope to train
>one of the museum staff to program shows  Are there show programming
>environments written in Max that would allow a non-programmer to
>program a show?

Hi Tim,

As I wrote in June, I had a public demonstration of a interactive music and
light show, running 36 colored spotlights from Max by means of a LanBox,
developed by Advanced Electronics bv in Holland and supplied with Max
externals. This equipment worked perfectly, and I recommend it. As far as
playing audio is concerned, I did it from the internal CD player, from
which I removed the audio output cord that leads to the computer and
replaced it with a cable that goes directly to the preamp. The internal CD
player isn't of absolutely prefessional audio quality, but I'm satisfied
with it for most purposes, and it leaves the HD free for other things like
playing QT movies. If you want to run theater lighting scenes from the Mac,
I would have a look at a program called LCedit supplied with the LanBox and
available from the manufacturer's website It's certainly
possible to run this program simultaneously with Max, although I would tend
not to clutter the computer with too many other tasks while running
lighting, or, as I did, use 2 Macs - one for stage lighting and one for
graphics. Good luck.



Date:    Fri, 1 Aug 1997 14:39:23 +0200
From:    Mirko Pelgrom 
Subject: Pointer problems (external development)

We're developing an external that needs static data. In order to test
the new and dispose routines we used ZoneRanger (comes with CW) and
noticed some strange behavior. Gradually we got the impression that, at
least not all, the problems we're to be blamed on our external.

Then we ran the following test. (PPC machine, system 7.6.1, MaxFAT).
Startup ZoneRanger, startup MaxFAT, enable "watch for leaks" option in
ZoneRanger. Now open a New Patcher (from MAX) and close it again. You'll
notice that on New a new pointer is created, but on close the pointer is
not disposed (ooops). We've repeated this a couple of times and to be
frank, we hardly saw pointers being disposed, whatever we did. Following
is what we saw.

                      Pointers / Memory use
Open new patcher             3 / 1696
Close patcher                3 / 1996
Open new patcher             4 / 1744
Close patcher                4 / 1744
Open new patcher             5 / 1792
Close patcher                5 / 1792
Open new patcher             6 / 1840

Each open window seems to allocate about 48 bytes and a pointer to it.
Can this be explained? We're a bit worried about this behavior.

Another question. Is it legal, for an external, to allocate a new
pointer (using NewPtrClear()) in the init routine and release it in the
Free routine. We need a piece of static non-relocatable data for
asynchronous PNSendRequest() actions.

Any help, suggestions would be greatly appreciated.

Regards, Mirko Pelgrom

Mirko Pelgrom                                   
CDS advanced technology bv                       

|   LanBox-LC II is the low cost (about $400), AppleTalk based,     |
|   DMX-512 lighting controller/sequencer solution for MacOS(tm).   |
|   Use Hypercard, Director, MAX or LabView to synchronize/control  |
|                           lightshows...                           |
|                                                                   |
|                 Light Magic is just one click away!               |
|                                                                   |


Date:    Fri, 1 Aug 1997 08:03:35 -0600
From:    "M.Herzig" 
Subject: Lost install


I lost my install for Max. Since ten days I keep faxing Opcode and never
get a response. Where do I get my key disk replaced? How can I get in touch
with them? This is absolutely NOT professional. I am losing money because I
can't launch the program.


Check out our Band Homepage and win a free CD:

And Peter's NEW Odd Guitar Jazz Page


Date:    Fri, 1 Aug 1997 06:57:37 -0700
From:    Christopher Dobrian 
Subject: Your application's own Preferences file

ai wrote:

>I haven't been able to find it in the documentation,
>and was wondering how I can have the app be able
>to save out a 'preference' file that will get
>loaded and read whenever the app is started.

Max 3.5 can do this. See p. 62 of the 3.5 Addendum manual.


             Christopher Dobrian / School of the Arts - Music
             University of California / Irvine, CA 92697-2775
                Phone: (714) 824-7288 / Fax: (714) 824-4914


Date:    Fri, 1 Aug 1997 11:01:45 -0400
From:    Stephen Kay 
Subject: Can a window know when it is open?

>What I do now is I use a data structure. I use 'active' to tell me if th=
>has been opened and store a 1. I then use 'closebang' to tell me if it h=
>closed and store a 0. This works fine.

I use this same method, but go 1 step further.  I add 1 to the output of
the active, and use a closebang to send a zero. Therefore, the informatio=
is as follows:

Window status:
2 =3D front window
1 =3D open, but not front
0 =3D closed

Stephen Kay


Date:    Fri, 1 Aug 1997 11:00:31 EDT
From:    Tom Ritchford 
Subject: Re: Pointer problems (external development)

Mirko Pelgrom  writeth:
>Each open window seems to allocate about 48 bytes and a pointer to it.
>Can this be explained? We're a bit worried about this behavior.

While memory leaks are troublesome, languages like C++ and C make it hard
to avoid... and 60 bytes or so per window opening means that you'll lose
1 MB every 15,000 window openings.  If you opened and closed one window
a minute, that would be 10 days worth of continuous activity.

Not that this shouldn't be fixed but it's probably not a big deal
for most applications.

(I spend about 30% of my life right now tracking down memory bugs in
C++ code... but in a week I start a new job programming Java and I won't
have to do that again!)


Tom Ritchford              

    Verge's "Little Idiot" -- Music for the mentally peculiar.


Date:    Fri, 1 Aug 1997 14:03:34 -0700
From:    Peter Elsea 
Subject: Max and mtc

I have been on read only status the last six months, stuck at home and
unable to post because of the list's excellent spam rejection features.
There have been some queries recently about Max and midi time code-

Q. Can Max follow mtc?
A. Sure,  if you write a patch to do so. Getting mtc into your patch varies
according to your setup. If you are still using MIDI manager, you do a
clock patch in Patchbay, and use the timein object. If you are on OMS, you
have to get the raw code from midi-in (that's actually a lot better-MIDI
manager adds a variable delay of up to 15 ms to the timecode stream.) If
you are on a 86k version of max, you can use the xtimein object to assemble
the quarter frame messages into usable form, PPC users will need to put it
together the hard way.

Having done that, you are in a position to trigger events off frame
numbers. There are lots of ways to do this. Past is good, but if the code
is reliable, I feed a running frame count into a coll- events in there are
stored with framecount as address.

Q. No I mean follow, in the sense of slowing down when the timecode slows.
A. If you have 3.0 or newer and OMS you can. What you do is measure the
period of the quarter frame messages, divide that by what it ought to be
(8.33 ms for 30 fps if your Mac clock is accurate ( ha! mine measures 8.6))
and feed the result to a setclock in mul mode. Things will speed up and
slow down, but of course pitches will not change.

Q. Can Max generate time code?
A. Nope. Well you can, but it won't do you any good. You can certainly
generate the right bytes, but you can't set a metro at 8.33 (where is that
float metro?). Yes, you can use setclock to adjust the speed of metro, but
only if you have OMS, and OMS won't let you output that much data that fast
(midiout gives up and starts sending one message per second.) You can get
the data out if you are running 3.0 without OMS, but it's the wrong rate.

MIDI time code really should come from an external device anyway, that's
what it's for.

Q. Say what?
I've just put together a tutorial on mtc for my fall class (geatly expanded
from something I posted here last winter). I will happily send a copy in
Word 5.1 format to the first 5 people who ask. If more than 5 ask, I'll
post it somewhere.

Peter Elsea
Electronic Music Studios
University of California, Santa Cruz


End of MAX Digest - 31 Jul 1997 to 1 Aug 1997