From:
                                                             2/5/97 12:00 AM
Subject: MAX Digest - 3 Feb 1997 to 4 Feb
1997To: Recipients of MAX digests 

There are 3 messages totalling 207 lines in this issue.

Topics of the day:

  1. ircam ftp
  2. Laserdisk
  3. MMC installment 1

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

Date:    Tue, 4 Feb 1997 10:14:29 +0100
From:    Tom Mays 
Subject: ircam ftp

The sys admin here just lifted the selective ftp block that's been in place
since 30 Dec after Ircam received a bombardment of rock&roll uploads to its
incoming. He was on vacation and another root access person put up the block
and didn't tell him... Hence the delay.

Would the so called "abusers" with suspect suffixes like .com and .net to
name
two (please note the irony in my tone) try and connect to ftp.ircam.fr and
let
me know if you now can?

Richard Dudas and I will soon be updating the max ftp, and paths will likely
change as the entire ircam ftp is moving to a new server and being
somewhat re-organized.

We'll keep you posted, of course.

Tom Mays
  tmays@ircam.fr

  ftp://ftp.ircam.fr
  http://www.ircam.fr

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

Date:    Tue, 4 Feb 1997 14:02:46 +0000
From:    sven erga 
Subject: Laserdisk

Are there anyone out there who knows where (preferrable in Europe) a
Laserdisk production facility is located? I would very much get in
touch with these people. I am also interested in approx. prices for a
master-disk and a handful of copies.
Bye!
Sven.

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

Date:    Tue, 4 Feb 1997 16:10:37 -0800
From:    Peter Elsea 
Subject: MMC installment 1

A surprising number of folks were interested in a micro tutorial on using
Max for Midi Machine control, so here it comes.  As MMC is complex, even a
micro tutorial is going to be big, hence the installment plan. I'm going to
break the subject up into 5 or 6 chunks, and they will probably appear
every other day. The MMC standard covers a wide range of gear, and each
company seems to have come up with an individual way of following the
specs. As a practical expedient, I'll limit my discussion to the actual
implementation of two systems I know reasonably well- ADAT (as interpreted
by Cooper or Fostex) and Darwin.

The first issue I'll cover is MIDI Time Code. That is not exactly part of
MMC, but they are usually used together, and several MMC commands contain
MTC type information. I have appended a text format patcher to illustrate
how to gather and display MTC time.

MTC comes in two forms. Full Frame Messages convey the position of a tape
in a single message, which is generally transmitted after a device has
executed a locate or a stop. Quarter Frame messages are transmitted
contiunously as tape is moving. Each QFM has a single byte of data, and it
takes eight of them to covey a complete location.

The FFM is transmitted via my favorite oxymoron, a universal system
exclusive message. The format of the message is {240 127 127 1 1 hours
minutes seconds frames 247}. That's a total of 10 bytes.
[match 240 127 127 1 1 nn nn nn nn 247] does a good job of trapping that
string out of [sysexin] and unpack will take it apart for us. We are
interested in what unpack calls elements 6 - 9. Minutes, seconds and frames
can be displayed directly.

The hours value contains a code for the frame rate in bits 5 and 6 (the
least significant bit is bit 0) and the hour is 0-5. To extract the hour,
use  [& 31] to mask off the unwanted bits. To read the format ( usually
unnecessary) use the right shift object [>> 5] The rate codes are:
0 = 24 frames a second
1 = 25 fps
2 = 30 fps drop frame encoded
4 = 30 fps normal encoding

(Drop frame encoding is a scheme to make the numbers look right when the
code is actually running at the color video frame rate 29.97 fps. This is
slower than the clock on the wall, so 2 frame numbers are skipped at the
beginning of each minute, except minutes 00, 10, 20, 30, 40, and 50. This
makes the tape and the clock come out even. I think this is misnamed
because no frames are dropped, only numbers.)

Quarter Frame messages are only a little more complex to handle. A QFM has
the format {241 data}. These are system common, not a real time, so they
should never turn up in the middle of another message the way Clock
messages can. [match 241 nn] will snag them for us, and [unpack] will shoot
the desired numbers from the right outlet.

The data byte of the QFM is encoded like this:  (0 x x x y y y y) the x
bits indicate which part of the message you are looking at, and the y bits
are either the low four or upper three bits of the numbers we want. The
coding is like this:
xxx     yyyy
0         Least significant 4 bits of frame number
1          Most Significant bits of frame
2         LSb of seconds
3          MSb of seconds
4         LSb of minutes
5          MSb of minutes
6         LSb of hours
7          MSb of hours

To decode this, break the data byte with [/ 16] and [& 15]. Pack these two
into a list, and run it through a
[ route 7 6 5 4 3 2 1 0]. The outlets for 7 5 3 and 1 get multiplied by 16
and added to the outlet on their right. Frames, seconds and minutes are
ready to display, but the hours value includes frame format just like the
full frame message.

Actually, synchronizing things to Quarter frame mesages is a bit tricky.
The number you are decoding is the number of the frame that started at the
same time the first part of the frame number was sent. That means by the
time you have received the entire location, it's almost two frames later.
Also, you only get every other number, and there's no guarantee that the
even or odd frames numbers are being sent (it depends on where the tape
stopped), so if you use an equality on the frame numbers rather than >, you
may miss the cue. Dealing with that is beyond the scope of this tutorial,
since all we usually want to do in a MMC controller is display the time.

Of course, there are objects that do all this for you, (timein, xtimein)
but now that you know how it's done, you are ready to tackle MIDI Machine
Control proper.

Here's the example:
max v2;
#N vpatcher 22 41 629 472;
#P newex 133 242 30 196617 * 16;
#P newex 103 264 27 196617 + 0;
#P newex 176 242 30 196617 * 16;
#P newex 47 242 30 196617 * 16;
#P newex 91 242 30 196617 * 16;
#P newex 81 204 118 196617 route 7 6 5 4 3 2 1 0;
#P newex 115 147 31 196617 & 15;
#P newex 81 147 29 196617 / 16;
#P newex 81 179 28 196617 pack;
#P number 103 338 35 9 0 0 0 3;
#P newex 47 61 35 196617 midiin;
#P number 190 337 35 9 0 0 0 3;
#P newex 190 264 27 196617 + 0;
#P number 148 338 35 9 0 0 0 3;
#P newex 148 264 27 196617 + 0;
#P newex 62 317 31 196617 & 31;
#P number 62 338 35 9 0 0 0 3;
#P newex 62 264 27 196617 + 0;
#P newex 80 89 69 196617 match 241 nn;
#P newex 80 118 38 196617 unpack;
#P comment 79 361 120 196617 Quarter Frame Messages;
#P comment 219 182 100 196617 Full Frame Messages;
#P number 327 158 35 9 0 0 0 3;
#P number 289 158 35 9 0 0 0 3;
#P number 251 158 35 9 0 0 0 3;
#P number 214 158 35 9 0 0 0 3;
#P newex 214 137 31 196617 & 31;
#P newex 216 58 43 196617 sysexin;
#P newex 216 81 189 196617 match 240 127 127 1 1 nn nn nn nn 247;
#P newex 216 105 119 196617 unpack 0 1 2 3 4 5 6 7 8;
#P connect 29 0 15 0;
#P connect 28 0 20 0;
#P connect 27 0 17 0;
#P connect 26 0 12 0;
#P connect 25 0 28 0;
#P fasten 24 0 26 0 86 225 52 225;
#P fasten 24 1 12 1 99 230 84 230;
#P fasten 24 2 25 0 112 238 96 238;
#P connect 24 3 28 1;
#P connect 24 4 29 0;
#P fasten 24 5 15 1 151 237 170 237;
#P fasten 24 6 27 0 164 235 181 235;
#P fasten 24 7 17 1 177 233 212 233;
#P fasten 23 0 21 1 120 171 104 171;
#P connect 22 0 21 0;
#P connect 21 0 24 0;
#P fasten 19 0 11 0 52 80 85 80;
#P connect 3 0 4 0;
#P connect 17 0 18 0;
#P connect 2 0 1 0;
#P connect 15 0 16 0;
#P connect 14 0 13 0;
#P connect 12 0 14 0;
#P connect 11 0 10 0;
#P fasten 10 1 22 0 110 139 86 139;
#P connect 10 1 23 0;
#P fasten 0 5 3 0 286 127 219 127;
#P fasten 0 6 5 0 299 136 256 136;
#P fasten 0 7 6 0 312 143 294 143;
#P fasten 0 8 7 0 325 139 332 139;
#P connect 1 0 0 0;
#P pop;

Peter Elsea
Electronic Music Studios
University of California, Santa Cruz
http://arts.ucsc.edu/EMS/Music/index.html
 elsea@cats.ucsc.edu

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

End of MAX Digest - 3 Feb 1997 to 4 Feb 1997
********************************************