From:
                                                                Thu 12:01 AM
Subject: MAX Digest - 4 Nov 1997 to 5 Nov
1997To: Recipients of MAX digests 

There are 4 messages totalling 167 lines in this issue.

Topics of the day:

  1. mouseloc with an external
  2. Movie Object
  3. MAX Digest - 3 Nov 1997
  4. mouseloc in external

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

Date:    Tue, 4 Nov 1997 23:03:49 -0800
From:    David Zicarelli 
Subject: Re: mouseloc with an external

Jean Favory  writes:

>I need making an external object wich will output the cursor
>coordinates when it is over it, even if there is no mouse click, and
>only when it is over it. The graphique interface of this object is a
>resizable rectangle.

You need to use a qelem. I would do something like this,
assuming the object has two outlets m_xout and m_yout:

void myobj_qfn(t_myobj *x)
{
        GrafPtr *gp;
        Point pt;
        char savelock;

        EnterCallback(); // SetUpA4();
        if (gp = patcher_setport(x->m_box.b_patcher)) { // is window
visible?
                if (!box_nodraw((t_box *)x)) {  // is box visible?
                        GetMouse(&pt);
                        if (PtInRect(pt,&x->m_box.b_rect)) {
                                savelock = lockout_set(1);
                                outlet_int(x->m_yout,pt.v);
                                outlet_int(x->m_xout,pt.h);
                                lockout_set(savelock);
                        }
                }
                SetPort(gp);
        }
        qelem_set(x->m_qelem);  // check again in a little while
        ExitCallback(); // RestoreA4();
}

You could start the qelem (by calling qelem_set) from a message
or within your instance creation routine. Hogging the event
level with a continuous while loop looking for the mouse
position will make it impossible to operate Max (and quit the program).

You could use a clock too if you want some control over the rate
at which the mouse location is checked. Rather than call qelem_set
directly in myobj_qfn() as above, call clock_delay with the desired
interval in milliseconds, then have the clock routine call qelem_set.
Or have the clock routine call clock_delay after it calls qelem_set
and don't do anything in the queue routine. That's probably the best
come to think of it. But any of these strategies will work.

David Z.

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

Date:    Thu, 6 Nov 1997 11:27:15 +1100
From:    Garth Paine 
Subject: Movie Object

Dear David Z,

Thanks for the new version of the Movie object, It's just wat I needed.
David Rokeby was kind enough to share his additions but they are more than
I need.

One question I have is:  How do I get the Movie object to play between two
points - say frame 2000 and frame 16450 and then stop?  I am sure I've read
of others doing this, but can't seem to work it out. Perhaps I should try
sleeping some time to clear the mind - too many projects on.

Thanks for your help. And for the new Movie object.

Garth

>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<
Garth Paine
Composer, Sound Designer,
Museums, Dance, Film, Theatre
Interactive Immersive Environments
Phone 61 3 95259844 (W)
Fax 61 3 95275549

"Immersive Virtual Environments - A Social Perspective"
http://www.creativeaccess.com.au/~garth
<<>><<>><<>><<>><<>><<>><<>><<>><<>><<>>

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

Date:    Wed, 5 Nov 1997 09:44:31 -0800
From:    Steve Anderson 
Subject: Re: MAX Digest - 3 Nov 1997

         Reply to:   RE>MAX Digest - 3 Nov 1997 to 4 Nov 1997

    "Dr. K@rlheinz Essl"  wrote;
    Subject: Re: QTMA

Does anybody out there know whether there are other sets of sounds (like
the well-known "Quicktime Musical Instruments") available. I am especially
interested in a good piano sound (which the Yamaha MIDIPlug provides -
unfortunately it does only work as a Netscape-PlugIn). And I am also
interested in percussion sounds.

I have purchased and used the Cybersynth sound library. They now include a
mini-keyboard and 1-3 midi interface in their package for $100. I don't have
their information in front of me, but they are advertised in the mail order
magazines. Their sample quality is quite good, i have heard they did the
piano
samples for the Alesis Q6 Quadrasynth, et al. There is a nice world
percussion
bank i use with my midi drum kit. It is just a control panel you open up and
then trigger by sequencer or whatever via IAC or external midi.

On another subject, SMPTE & the Studio 4 midi interface, we run computer
generated laser animation, analog music & midi control for sound & lites
from
a SMPTE-striped ADAT tape. We have to switch from OMS to midi-manager
whenever
we use the program that came with the S4 to stripe a tape, then switch back
to
OMS to do the cueing and midi stuff. Once the time stripe is on the tape
(the
cabling must be solid), the computer reads SMPTE and records all the real
time
midi performance just fine over one serial port (printer port with Appletalk
OFF) on a Quadra 650 (with 64 Mb ram). The S4 has its own, live SMPTE
"flywheel" sync that screws things up when you rewind, or the computer
hiccups
during file access or something. i don't rely on the S4 for live generation
of
timing pulses for performance.
s.anderson

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

Date:    Wed, 5 Nov 1997 10:16:57 -0800
From:    Peter Elsea 
Subject: mouseloc in external

Jean Favory asks:
>If instead of "wind_drag" I use a loop like:
>
>do{
>        GetMouse(&point);
>        /* all I have to do:=20
>                                Check if the mouse is inside my object.
>                                If it is inside, output the coordinates of
>the location=20
>                                of the mouse=8A
>                                etc=8A
>*/
>} while(something());
>
>do I monopolize the processor making impossible to do something else=20
>in my patcher? How works the scheduler in this case?

Yes, nothing else will get done except interrupt stuff, and whatever is
connected to your outlets. I suspect graphics would freeze, for instance.
>Should I use a Qelem routine?
>And a clock routine?
You could use either. A Qelem would poll faster, but for mouse movements
polling every 5ms ought to be enough, so a clock might be more appropriate.
In fact, you might want to make reporting dependent on getting two
consecutive "in the box" hits, since you probably don't want extra messages
if the mouse just passes by on the way somewhere else.
Also, be sure to check the box coordnates each time you do this.

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 - 4 Nov 1997 to 5 Nov 1997
********************************************