HDTenEightyP/NetNews huggingface dataset:
From: trgibney@phoenix.Princeton.EDU (Thomas R. Gibney)
Subject: Using the new Sound Manager
Originator: news@nimaster
Organization: Princeton University
Distribution: na
Date: Wed, 27 Jan 1993 15:36:02 GMT

It appears that the "Enhanced Sound Manager" (Sys 6.0.7 and later) supports
only an equal-tempered scale when using the waveTable synthesizer.
Is it still possible to specify exact frequencies with the new Sound Manager,
as could be done with "noteCmd" described in IM vol5 ?

Also, I'd welcome ideas on how to cause the amplitude of a note to decay,
since the Sound Manager's "tickleCmd" seems to have disappeared between
IM vol5 and IM vol6.

Thanks,   Tom Gibney			trgibney@phoenix.princeton.edu
Newsgroups: comp.sys.mac.programmer
From: resnick@cogsci.uiuc.edu (Pete Resnick)
Subject: Re: MacTCP: MPW C and Think C
Organization: University of Illinois at Urbana
Date: Tue, 26 Jan 1993 23:07:52 GMT

rsanb@ctp.com (Randall Sanborn) writes:

>I am having a problem with the MacTCP TCPSend() function in MPW C 3.2, 
>but not in Think C 5.0.  The code I had previously written and compiled 
>in Think now compiles and links under MPW, but returns an invalidLength 
>error on the TCPSend() function.  The MacTCP manual states "the total 
>amount of data described by the WDS was either 0 or greater than 65,535 
>bytes."  I have checked the length member of the wdsEntry structure, and 
>it is between 0 and 64K bytes.  My function is as follows (with some code
>extracted):

>	TCPiopb 	*tbp;		// Both pointers are malloc'd
>	wdsEntry	*pWds;		// and cleared with 0's

>	pWds->length	=len;
>	pWds->ptr	=mesg;

It looks like you calloc'ed just enough room for 1 wdsEntry. You have
no 0 terminator.  I'll make a bet you are just getting lucky in THINK C
because there is a word of 0 after pWds in memory. You need to say:

	pWds = NewPtrClear(sizeof(wdsEntry) + sizeof(short));

		or

	pWds = calloc(sizeof(wdsEntry) + sizeof(short));

That will give you a 0 terminator at the end of your wdsEntry.

pr
-- 
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Using the new Sound Manager
Organization: Kalamazoo College
Distribution: na
Date: Thu, 28 Jan 1993 03:03:24 GMT

trgibney@phoenix.Princeton.EDU (Thomas R. Gibney) writes:
>It appears that the "Enhanced Sound Manager" (Sys 6.0.7 and later) supports
>only an equal-tempered scale when using the waveTable synthesizer.
>Is it still possible to specify exact frequencies with the new Sound Manager,
>as could be done with "noteCmd" described in IM vol5 ?

No;  in fact, you never could.  That feature describe in IM V was never
implemented.

You can either cobble up twelve sounds in the frequencies you want (a
pain in the butt, and wasteful), or you can manually tweak the
sampleRate field (squirrely and weird;  may have problems if the current
or a future Sound Manager depends on that value remaining constant for a
sound in progress).

If this is a serious application, i.e. not for fun or for in-house use,
I'd recommend the second method.  If you go that way, try keeping one
copy of the 'snd ' for each channel (voice) you're playing.  (If you're
only playing one voice, ignore previous sentence.  :-)  Write in the
sampleRate you want--if you want C-sharp, multiply the "natural" rate by
1+(the twelfth root of two).  Then do your soundCmd to set the channel
up for that sound, and your freqDurationCmd (aka noteCmd) to play it.
For the next note, do it again.  You _don't_ want to write in the next
note's sampleRate until the previous note has started playing.  The
easiest way to arbitrate this is to drop a callBackCmd in after each
freqDurationCmd, and have your callback routine figure out which value
to write in next.  "Easy" here is a relative term;  it sounds like quite
a headache and I'm glad I don't have to write it.  :-/

If this will be used in a controlled environment--and anything that
requires a non-well-tempered scale will probably be a pretty vertical
market--you might just want to put together twelve notes in the
frequencies you want.  Going up or down octaves, of course, can be done
with the freqDurationCmd.  It'll cost you RAM, but that's the breaks...
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "A degree in Computer Science from Berkeley didn't much qualify me to uphold
  the banner of Chaos against the forces of Order."              - R. Zelazny
Newsgroups: comp.sys.mac.programmer
From: urban@yoda.fsl.noaa.gov (Art Urban)
Subject: TCL: Bit Off More Than I Can Chew...
Organization: Forecast Systems Lab, NOAA, Boulder CO, USA
Date: Tue, 26 Jan 1993 19:13:52 GMT

Up until recently, I was very pleased with my DragOutlineTask object. I had
successfully called DragGrayRgn() in the KeepTracking() method, and went
about my business. But then I thought, I want this to AutoScroll() should I
need it to. Okay, so I hunkered down and wrote a sly little dragHook
actionProc which in turn called a DoWhileDragging() method of
DragOutlineTask (I didn't even think this would work, but it does. I
defined my *own* this pointer, and lo and behold, it correctly pointed to
the current object! This is almost scary...)

So, back in DoWhileDragging() method, I get the current mouse location and
massage it to work with AutoScroll(). The strange thing is, the scrolling
does take place, but now drawing is occuring all over the grafPort, and I
suspect it has something to do with AutoScroll changing the Origin while
DragGrayRgn() is trying to do its work, but I really don't know.

I couldn't help notice that CMouseTask is set up to repeatedly receive
KeepTraking() calls. So to really pull off AutoScroll() it seems that I
need to do it here, not via the dragHook proc. But since, DragGrayRgn()
won't release events until the mouse is up, I can't usefully call
AutoScroll() with the current mouseLoc. 

So my quandry is this: Should I try to fix the implementation which uses
the call to DragGrayRgn() (and how do I do this?), or should I try to write
my own region dragging code so I can benefit from the utility of the
KeepTracking() method?

Now it seems to me, that somebody has probably done one or the other
already. So, if you have code you can share, I'd appreciate it. I really
don't want' to get into GWorlds at this point in my learning curve...

Thanx!!!
-- 
Art Urban 					        urban@yoda.fsl.noaa.gov
===============================================================================
 "Look, he's being attacked by creamy nugget centers."		 	 -Joel
===============================================================================
From: ksuiter@acpub.duke.edu (Karl A. Suiter)
Newsgroups: comp.sys.mac.programmer
Subject: SANE num2str problem
Date: 25 Jan 93 16:46:40 GMT
Followup-To: comp.sys.mac.programmer
Organization: Duke University

Hi,

  After dutifully searching through my copies of Inside Mac, Spinside Mac,
Macintosh Programming Secrets, etc., I have to admit that I am stuck on
this one (probably trivial) programming problem.  It has to do with using
the SANE num2str routine in Think C 5.04.  The prototype for num2str is
defined as 

      void num2str(decform *, extended, void *);

thus, I have the following snippet of code that should (I think) work

void convertNum()
 {
  decform  extStuff;
  Str255   tempStr;
  extended theNum;
  
  extStuff.style = FIXEDDECIMAL;
  extStuff.digits = 2;
  theNum = 1.00;
  num2str(&extStuff, theNum &tempStr);
  printf("%s", tempStr);
 }

Well, when I try to compile this, I get the error message:

      "Illegal operation on struct"

when if reaches the 'theNum = 1.00' line.

  The Think C manual states that extended values are actually doubles.  So
when I define the variable 'theNum' as double, I get the following error
message:

      "Second arguement of function 'num2str' dows not match the prototype"

when it tries to compile 'num2str(&extStuff, theNum &tempStr)'.

  What am I doing wrong?  I'm sure this problem is easy to solve, but I'm
stuck on it. Thanks in advance for any help.

                                                                 Karl

---

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Karl A. Suiter, Duke University, Zoology Dept., Durham, NC   27706    |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| Voice: (919) 684-2251      |   INTERNET:  ksuiter@acpub.duke.edu      |
| FAX:   (919) 684-6168      |   COMPUSERV: 72701,3543@compserv.com     |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Newsgroups: comp.sys.mac.programmer
From: cmumford@iat.holonet.net (Chris Mumford)
Subject: Re: I've got a handle, now I want a PICT.
Organization: HoloNet National Internet Access BBS: 510-704-1058/modem
Date: Sat, 23 Jan 1993 16:50:13 GMT

Newsgroups: comp.sys.mac.programmer
From: mark@pokey.jsc.nasa.gov (Mark Manning)
Subject: Re: Geneva 9 Radio Buttons, Checkboxes, etc...
Organization: NASA
Date: Thu, 28 Jan 1993 22:36:23 GMT

That sounds a lot like what I've finally been forced into doing.  I went
back over the IM manuals and found out that Static Text simply does a
call to TextBox.  So that is what I am doing.  But I haven't redefined the
fields to be UserItems.  This is because there are seventy-two of the things
and I'm not all that gung-ho about redefining them all. ;)

Thanks for the response!
From: evans@Apple.COM (John Evans)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Keeping a resource file open forever from an INIT
Date: 25 Jan 93 01:13:51 GMT
Organization: Apple Computer Inc, Cupertino, CA

The way I did this years ago (when I wrote Polly MacBeep) was something like
this:

1) open the file you want to keep around
2) use the TopMapHndl variable to get the resource map of the file
3) change TopMapHndl to point at the next resource map in the chain
   (usually the resource map of the init)  This eliminates that file
   from the resource chain.
4) use SysMapHndl to find the resource map of the system.
5) follow the NextMap links (described on page 129 of IM-1) until
   you find the LAST resource map in the chain.
6) add your resource map beyond the last map.

You may also (before re-adding your map to the resource chain) have to
copy the resource map into the system heap.  (I don't have the code with me.)

This should add you to the resource chain, and make you system 7.1
friendly.

Good luck.

-- 
+========================+===============================================+
| John S. Evans          | These opinions are mine. Apple's opinions are |
| Collaborative Systems  | Apple's.  Any similarity is coincidental.     |
| Apple Computer, Inc    | "They've given you a number, and taken away   |
| evans@apple.com        |  your name."                  -Johnny Rivers  | 
+========================+===============================================+
From: paul@taniwha.UUCP (Paul Campbell)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Morph Alogrithm ??
Date: 18 Jan 93 16:38:17 GMT
Organization: Taniwha Systems Design

In article <eaeu209-150193173343@714-725-3176.nts.uci.edu> eaeu209@orion.oac.uci.edu (Rodney G. Ramos) writes:
>> kai@concannon.llnl.gov (Kai Yung) writes:
 
>>can anyone tell me where I can dig up an efficient algorithm to do the
>>transformation effect that's used by the program Morph?
 
>A friend of mine told me that the algorithm is published in some
>programmer association (the name eludes me right now) that's the
>equivalent of IEEE for engineers.

There's lots of morph algorithms .... in the past year or so every man and
and his dog has come up with one .... some are better than others, some are
faster than others ... the one that's in Morph is much faster than any others
I've seen (even running on much faster platforms) and produces a great result
I doubt Duane has published it.

The IEEE IS for engineers ...

	Paul

-- 
Paul Campbell    UUCP: ..!mtxinu!taniwha!paul     AppleLink: CAMPBELL.P
"Finally after much thought he tied a dollar bill to the top of the tree, it
seemed to fit - after all it was the premier capitalist holiday, besides after
the 'fall' of communism a star didn't seem appropriate anymore ..."
Newsgroups: comp.sys.mac.programmer
From: piovanel@ghost.dsi.unimi.it (marco piovanelli)
Subject: Re: Saving window position
Organization: Computer Science Dep. - Milan University
Date: Wed, 27 Jan 1993 12:05:20 GMT

k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:

>nerm@apple.com (Dean Yu) writes:
>>piovanel@ghost.dsi.unimi.it (marco piovanelli) wrote:
>>> 
>>>    The function returns TRUE if windowFrame is COMPLETELY ENCLOSED
>>>    in the Gray Region.  But other applications (e.g. the Finder and
>>>    StuffIt Lite) restore the window position even if the window frame
>>>    is mostly offscreen.  What is the correct algorithm?
>>
>>  The currently favored method is if the user can still get to the title
>>bar from where the window currently is, leave it alone.

>How about modifying that to:  can still _easily_see_ the title bar from
>where the window currently is.  The title bar might only have one pixel
>on the screen...

OK, but HOW easily?  What the Finder seems to do is:

1. Calculate the title bar rect from the saved window position.

2. Inset the rect a little (4 pixels, I think).

3. Restore the saved position if this rect intersects the Gray Region.

But now suppose a user zooms a window to full screen on a 21" monitor,
then reopens the document at home on his 9" classic monitor.  The above
algorithm would choose to restore the saved window rect.  But the user
would find it pretty difficult to reach the offscreen zoom box or grow box.

Maybe a better algorithm is to save the GDRect of the original screen
and resize the window if that GDRect doesn't belong to one of the
available devices.

Anyway, thanks for the suggestions.

					-- marco
From: udmorrow@mcs.drexel.edu (Daniel Morrow)
Newsgroups: comp.sys.mac.programmer
Subject: how to use AutoGuest under Think C 5?
Date: 27 Jan 93 17:37:51 GMT
Organization: Drexel University

I recently pulled down AutoGuest from AppleLink and it came
with an MPW-esque '.o' file. I am using Think C 5.0.2

Anyway, how do I add it into my project?

I tried converting it with the .o converter that comes with
Think C, but when it gets to the 'InstallPPCAutoguest' call
it bombs horribly on my machine?

If anyone has successfully used AutoGuest with Think C I would
be appreciative to know how you did it. 

Thanks.
-Dan.
udmorrow@mcs.drexel.edu
Newsgroups: comp.sys.mac.programmer
From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
Subject: Re: Dynamic Link Libraries ..
Organization: MIND LINK! - British Columbia, Canada
Date: Wed, 27 Jan 1993 00:43:50 GMT

> >o here's the question: is it a good idea to simply take an MPW .o file and
> >pass it through some kind of "linker" which would simply calculate some
> >offsets for exported functions which could then be accessed "on call" so
> >to speak. I know about "Dinker" and some other library that is supposed to
> >do this for "classes" but what about plain functions?
>
> Have you looked at the Shared Library Manager stuff that's on ETO 9? It
> sounds like that would be a good fit for your needs.

Or how about the Component Manager?  It was originally part of QuickTime, but
is now part of System 7.1.  It's a very sophisticated way to have DLL's.
(AppleScript uses it.)  There's an article about it in the latest
d e v e l o p.


--
-------------------------------------------------------------------
 Daryl_Spitzer@mindlink.bc.ca     "Life isn't just, life just is."
         a2251@mindlink.bc.ca              -- Me  (I think.)
-------------------------------------------------------------------
From: tom_klein@magic-bbs.corp.apple.com
Newsgroups: comp.sys.mac.programmer
Subject: trapping system events
Date: 23 Jan 93 17:12:55 GMT
Article-I.D.: magic-bb.1993Jan23.121255.446196
Distribution: na
Organization: Macintosh Awareness Group In Canada

i need some tips on how to intercept certain system events. in order to keep
track of documents, i want to know when:

1) an existing document is opened
2) a new, untitled document is created
3) a document's window is brought to the foreground (which implies that
everybody else isn't)
4) a document is closed.

and all of this from *other* applications than my own (my stuff "lives" in
a system extension).

...... tom

ps.  references to published examples would be simply TERRIFIC.
***********************************************************
The views expressed in this posting are those of the individual author
only.
***********************************************************
From: gjw2824@hertz.njit.edu (Greg Weston)
Newsgroups: comp.sys.mac.programmer
Subject: 3 bits of info requested
Date: 22 Jan 93 18:24:12 GMT
Organization: New Jersey Institute of Technology, Newark, N.J.

Howdy, folks. I'm looking for three little things:

1) Where can I get a copy of BalloonWriter or another thing that
allows relatively easy creation of Help resources?

2) Does anyone know of sources for alternate script systems to work
with 7.1?

3) Is there any documentation on the new elements of 7.1 from a
programming standpoint?

	Thanks for impending help
	Greg
Newsgroups: comp.sys.mac.programmer
From: Dmitry Boldyrev <dmitry@chemistry.chem.utah.edu>
Subject: I hate THINK Pascal...
X-Xxmessage-Id: <A5A4B32EBF01C4C9@quadra.chem.utah.edu>
X-Xxdate: Thu, 23 Jan 92 15:00:14 GMT
Organization: University of Utah
X-Useragent: Nuntius v1.1.1d17
Date: Sun, 24 Jan 93 00:57:29 GMT

Hello,
I really hate THINK Pascal now!! :( Because, whatever I do,
all couse problems..
I'm working on Molecular Designer package and would like to write Floating
palettes. Problem with Events, partcicularly with App4Evt, made me CRAZY!!
If you have enought time, please take a look on this fragment of my code:

	procedure DoEvent (theEvent: EventRecord);
	begin
		case theEvent.what of
			mouseDown: 
				DoMouseDown(theEvent);
			activateEvt: 
				if BITAND(theEvent.modifiers, activeFlag) <> 0 then
					DoActivate(theEvent)
				else
					DoDeactivate(theEvent);
			updateEvt: 
				DoUpDate(theEvent);
			app4Evt: 
(****)		case BITAND(theEvent.message, TypeMask) of
					suspendResumeEvt: 
						if BITAND(theEvent.message, SuspendResumeBit) <> 0 then
							DoResume(theEvent)
						else
							DoSuspend(theEvent);
				end;
		end;
	end;
	procedure EventLoop;
		var
			theEvent: EventRecord;
	begin
		while running do
			begin
				if WNEImplemented then
					begin
						if WaitNextEvent(everyEvent, theEvent, 0, nil) then
							DoEvent(theEvent);
					end
				else
					begin
						if GetNextEvent(everyEvent, theEvent) then
							DoEvent(theEvent);
						SystemTask;
					end;
			end;
	end;
	
	++++++++++++++++
	I set up "Break point" to (****) and I figured out that it NEVER EVER
	comes to this point!!! -In other words, EVENT.
	I thought, what can be wrong here!? Code seems absoulutely right!
	Even, it works in THINK C!
	Please, if anyone know what's the problem, HELP!	
	
	THANKS! :)
	o=======================================o
	I Dmitry Boldyrev.                      I
	I Department of Chemistry,              I
	I University of Utah SLC Utah.          I
	I Inter. dmitry@chemistry.chem.utah.edu I
	o=======================================o
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.system
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Apple events/AppleScript/Toy Surprise - Applications Wanted
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Tue, 26 Jan 1993 15:56:00 GMT

In <1993Jan25.181240.2047@Princeton.EDU> jdunning@phoenix.Princeton.EDU (John Alan Dunning) writes:

>I think PageMaker 4.2 has a fairly complete set of AppleEvents, though
>it's not recordable.  I haven't tried it myself, but I've seen some
>Frontier scripts that call its events.

PageMaker 4.2 has six events I know of:
- open doc, open app, print doc, quit (the standard 4)
- do script, eval script

I think all of the rest are "emulated" through do script.
(Don't have my developers docs here, though, so I am not
completely certain)

Cheers,

						/ h+
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

   This article printed on 100% recycled electrons.
Newsgroups: comp.sys.mac.programmer
From: sholden@cod.nosc.mil (Steve Holden)
Subject: Neural Networking?
Followup-To: comp.sys.mac.programmer
Organization: SAIC->NRaD->Project ICER
Date: Thu, 28 Jan 1993 18:02:33 GMT

Hello!

I'm taking a Neural Networking class this semester for my
grad program and was curious of what information, products,
envirnments, etc. ... are available for Neural Networking
on the Mac (freeware, shareware, commercial). I looked
at the neural networking newsgroup FAQ and they didn't
have much Mac info.

There is a semster project required and I'd really like to
do all my programming on the Mac. Unfortunately, the Prof is a 
real PC guy (who tolerates Suns), but doesn't think the Mac
has the ability to do anything in this area.  So, I can
use all the help I can get to prove him wrong!

Thanks!

Steve

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-      Steven D. Holden +++ SAIC -> NRaD -> Project ICER      -=-
=-=       Mac Consultant / 4D Developer / Occasional Hack       =-=   
-=-   Email: sholden@cod.nosc.mil  +++  Phone: (619) 553-6750   -=-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=- ** Opinions expressed are my own and do not necessarily  ** -=-
=-= **    reflect those of my employer or the government.    ** =-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Newsgroups: comp.sys.mac.programmer