From:
                                                            8/15/97 11:00 PM
Subject: MAX Digest - 14 Aug 1997 to 15 Aug
1997To: Recipients of MAX digests 

There are 7 messages totalling 287 lines in this issue.

Topics of the day:

  1. Mac OS 8
  2. MAC World Expo Report: BeOS DSP Audio
  3. Can large numbers be worked with?
  4. Can large numbers be worked with (2)?
  5. Jean-Louis and Steve
  6. nonlinear equations
  7. ____HELP: How to pad/un-pad/edit text strings?? ____

----------------------------------------------------------------------

Date:    Thu, 14 Aug 1997 23:41:55 -0400
From:    Stephen Kay 
Subject: Mac OS 8

>PS The largest number I seem to be able to calculate in MAX seems to
>be in the billions.  An inherent feature of the software?

Correct. I'll repeat it again.

The limit for an integer in MAX is determined by the fact that ints are
passed as type "long" which is a 32-bit signed long integer having
(therefore) a range of 2 to the 32nd power, centered around 0, which
translates as -2,147,483,647 to 2,147,483,647.  When you exceed the
positive value, it wraps around into the negative range, which is why you=

are seeing negative numbers (which is expected behavior for computers, an=
d
NOT an error).

Stephen Kay

------- The MegaMAX Application Developer's Collection --------
Full color 3D UI Objects for creating professional looking apps,
     Macintosh Interface objects, and other Max helpers.
-----------check out the demo on the MAX 3.5 CD----------------

------------------------------

Date:    Thu, 14 Aug 1997 23:25:16 -0700
From:    Richard Zvonar 
Subject: Re: MAC World Expo Report: BeOS DSP Audio

On Thu, 14 Aug 1997 00:44:08 -0400 Nick Longo :

>I get it.  Only it's a little more complex, and maybe a little more
nefarious
>than that...software
>requires a CPU to fuel it.  DOS without the IBM CPU would have been
>worthless.  The Be, without the Power Mac CPU is also worthless.   So the
>inventors of the Be, by making it widely available are hoping to displace
the
>Apple OS.

It is Be's intention to be "processor agnostic" and they are well on the
way to that goal.  BeOS now runs on both PPC and Intel processors.  It is
also Be's intention to focus on the interactive multimedia market.  Having
worked with the OS for a year now, having subscribed to the Be mailing
lists, and having attended a Be Developers Conference, I don't get any
sense of Be wanting (or trying) to supplant anybody.  They may see
themselves as being like Apple circa 1984, offering an operating system
"for the rest of us."

______________________________________________________________________________
Richard Zvonar, PhD                              zvonar@LCSaudio.com
(818) 760-8055 voice/fax

                          http://www.well.com/~zvonar

------------------------------

Date:    Fri, 15 Aug 1997 09:31:27 +0200
From:    Peter Castine 
Subject: Re: Can large numbers be worked with?

 Keay Edwards asked:
>      Is it possible to do math in Max resulting in sums that total
>more than a billion or trillion?  I tried a simple multiplication patch
>and ended up with what can only be somekind of error.  (-negative
>numbers etc.)  I could make a program to accomplish the same thing in
>basic or something, but I want to customize the interface.  Also, Max
>is the only programming language I've used in years.  Please let me
>know what you think.

The friendly manual states that integer arithmetic in Max is done with
32-bit signed integers, so the range is -(2^31) to 2^31 - 1. That gets you
just past 2 thousand million (Americans call that two billion, but a
billion costs a bit more in most of the rest of the world;-)

This is not an inherent feature of the software, it's inherent in the way
the vast majority of CPU processors have been built since the mid-70s, was
quite common long before that, and is called ``32-bit data registers.''

If you want to do integer arithmetic with high numbers than that, say
64-bit arithmetic, you'll have to split the values into two 32-bit values
(highlong and lowlong) and do a lot of housekeeping yourself. To add two
numbers, you'd add the highlong components, add the lowlong components,
check if the lowlong result needs to carry and increment/decrement the
highlong result accordingly. This is already tricky with Max, since you
need to treat the lowlong component as unsigned. Converting to text in
decimal representation is left as an exercise for the reader.

It's all doable, either with a set of Patchers or with a set of external
objects. A good book on algorithms can help you further.

OTOH, whaddya want to do it for? MIDI only goes up to 127...

Cheers,

Peter

PS: Yes, I know that Max is used for things other than calculating MIDI
data bytes, but 32-bit integers are accurate enough for a hell of a lot of
things.

-------------------- http://www.prz.tu-berlin.de/~pcastine/
-------------------
Dr. Peter Castine          | 'Just the place for a Snark!' I have said it
twice
pcastine@prz.tu-berlin.de  |   That alone should encourage the crew.
                           | Just the place for a Snark! I have said it
thrice
Have Mac, Will Travel      |   What I tell you three times is true.'

------------------------------

Date:    Fri, 15 Aug 1997 08:39:59 -0000
From:    Nick Rothwell 
Subject: Re: Can large numbers be worked with (2)?

> >of 2 to the 32nd power, centered around 0, which translates as
> >-2,147,483,647 to 2,147,483,648.
>
> Sorry, correction:
> -2,147,483,647 to 2,147,483,647

Two's complement? That'll be -2,147,483,648 to 2,147,483,647.

--
         Nick Rothwell, CASSIEL        contemporary dance projects
         http://www.cassiel.com        music synthesis and control

             years, passing by, VCO, VCF, and again, and again

------------------------------

Date:    Fri, 15 Aug 1997 10:09:45 -0700
From:    Edward Spiegel 
Subject: Re: Jean-Louis and Steve

re the BeOS/J-L G discussion. I was working at Apple when Steve Jobs
left. Gassee had been a bigwig at Apple France before coming to the U.S.
He came over shortly before Jobs was ousted. It has often been rumoured
that J-L Gassee played a behind the scenes role in the ousting of Steve
Jobs though I can't recall what he did other than throwing his support
behind Sculley.

------------------------------

Date:    Fri, 15 Aug 1997 13:15:44 -0700
From:    peter elsea 
Subject: nonlinear equations

cw4t7abs  asks:

>would anyone happen to know of a good way to
>iterate nonlinear equations and import the results into max to
>convert the results to midi.
>thanks.

The trick is to put the equation in an expr object and feed the result back
to the expr by way of the right inlet of a float object. Use a metro to
bang the left inlet of the float to produce the iterations. Beware! If you
accidently feed back to the left inlet of the float, you will get stack
overrun.

 Here's an example that iterates a famous nonlinear and changes the result
into notes.

max v2;
#N vpatcher 172 93 572 436;
#P flonum 144 76 45 9 0 0 0 3;
#P newex 29 278 41 196617 noteout;
#P newex 29 223 29 196617 + 60;
#P newex 29 246 85 196617 makenote 90 170;
#P flonum 90 76 50 9 0 0 0 3;
#P toggle 29 49 15 0;
#P newex 144 21 46 196617 loadbang;
#P newex 29 76 56 196617 metro 200;
#P message 144 48 29 196617 3.45;
#P flonum 90 173 85 9 0 0 0 3;
#P newex 29 195 32 196617 % 12;
#P newex 29 148 125 196617 expr $f2 * $f1 * (1-$f1);
#P newex 29 172 57 196617 * 100000.;
#P newex 29 120 53 196617 float 0.48;
#P number 75 47 52 9 0 0 0 3;
#P comment 158 150 145 196617 X[1] = Y * X[0] * (1-X[0]);
#P comment 105 96 28 196617 X[0];
#P comment 154 97 14 196617 Y;
#P comment 104 193 28 196617 X[1];
#P connect 13 0 11 0;
#P fasten 12 0 10 0 149 41 149 41;
#P connect 11 0 5 0;
#P connect 10 0 18 0;
#P connect 8 0 16 0;
#P connect 7 0 6 0;
#P fasten 7 0 5 1 34 168 25 168 25 106 77 106;
#P connect 7 0 9 0;
#P connect 6 0 8 0;
#P connect 5 0 7 0;
#P connect 4 0 11 1;
#P fasten 14 0 5 1 95 112 77 112;
#P connect 15 0 17 0;
#P connect 15 1 17 1;
#P connect 16 0 15 0;
#P connect 18 0 7 1;
#P pop;

Peter Elsea
Director of Electronic Music Studios
University of California, Santa Cruz
elsea@cats.ucsc.edu

------------------------------

Date:    Fri, 15 Aug 1997 16:16:26 -0700
From:    ai 
Subject: ____HELP: How to pad/un-pad/edit text strings?? ____

Aug 15, 1997

Greetings:

I need to create the following functionality in Max:

1. receive a list or stream of bytes (say 16)
   that are ASCII character equivalents; the
   'string' is fixed length and right padded with
   space characters

2. convert the incoming bytes to their ASCII values
   and display the ASCII chars in a message box;
   no need to display the right-most padding space chars

3. have the message box be editable, with a maximum
   up to 16 chars; with Mac text editing capability
   (if possible); or certainly at least backspace delete

4. upon receipt of the incoming ASCII, or when the
   user edits the text in the message box, the msg
   box outputs a list of the byte values of the
   ASCII chars currently being displayed

I have this sortof working using a message box object,
whereby the text can be edited by sending the box
an "open 1" string msg.

I'm a bit stuck however on how to:

a. not have the text msg display single
   quote marks ('Hello Test   ') and not
   display the trailing space chars

   So for example, if the incoming string is:

   "Hello Test      "

   the message box currently displays this as:

   'Hello Test      '

   What I want the text editable box to display is:

   "Hello Test"

   (without displaying the "'s of course).

b. Also - when the user somehow opens a dialog
   box to edit this text string, if they change
   the text to:

   "Hello"

   (w/o the "'s), I want this object to put back
   right-most space padding out to the fixed
   16-character length:

   "Hello           "

Does anyone know how this functionality can be
achieved?  (For example, thru some 3rd party
text edit objects? or w/in Max?)

Thanks in advance for any info/fb to me at:

    ai@wco.com

------------------------------

End of MAX Digest - 14 Aug 1997 to 15 Aug 1997
**********************************************