Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!uakari.primate.wisc.edu!uflorida!haven!decuac!decatl!shlump.nac.dec.com!ketje.enet.dec.com!vandevyver From: vandevyver@ketje.enet.dec.com (Luc Van de Vyver) Newsgroups: comp.sys.mac.programmer Subject: Sound Manager problem Message-ID: <17982@shlump.nac.dec.com> Date: 9 Dec 90 20:17:34 GMT Sender: newsdaemon@shlump.nac.dec.com Organization: Digital Equipment Corporation Lines: 98 I am writing a program, to control 2 slide-projectors with the MAC. The projectors can be controlled by sound. Every frequency has a meaning (ex. advance A, advance B, %light for projectore A ...); Everything works fine, except a fluent dissolve from one projector to the other. The reason for this is that I am using NOTES to send the a sound with the right frequency to the projector. For one reason or another exact FREQUENCY output seems not to work as indicated in the INSIDE MACINTOSH IV. I included the some test code which explains exactly what is not working. btw, I am using a MAC SE, THINK C 3.0, finder 6.0.4 All help is appreciated very much. Luc. CODE EXTRACT : #include "SoundMgr.h" #include "stdio.h" #define NIL 0 #define NIL_POINTER 0L SndChannelPtr chanPtr = NIL; SndCommand sndCmd; long status, currNote; long note = 80L; long freq1 = 0x000F5DDE; long freq2 = 0xEE0F5DDE; Frequency() { /* Assign a channel to the Notesynthesizer */ chanPtr = NIL; status = SndNewChannel(&chanPtr, 1, NIL, NIL_POINTER); /* set the default timbre */ sndCmd.cmd = timbreCmd; sndCmd.param1 = 1; sndCmd.param2 = NIL; status = SndDoImmediate(chanPtr, &sndCmd); sndCmd.cmd = ampCmd; sndCmd.param1 = 100; sndCmd.param2 = NIL; status = SndDoImmediate(chanPtr, &sndCmd); /* this says piep */ sndCmd.cmd = freqCmd; sndCmd.param1 = NIL; sndCmd.param2 = note; status = SndDoImmediate(chanPtr, &sndCmd); printf("\n Status = %ld - freq = %ld", status, sndCmd.param2, sndCmd.param2); Wait(30); /* this is silence WHY?????? */ sndCmd.cmd = freqCmd; sndCmd.param1 = NIL; sndCmd.param2 = freq1; status = SndDoImmediate(chanPtr, &sndCmd); printf("\n Status = %ld - freq = %ld (%lX)", status, sndCmd.param2, sndCmd.param2); Wait(30); /* this is silence WHY???????*/ sndCmd.cmd = freqCmd; sndCmd.param1 = NIL; sndCmd.param2 = freq2; status = SndDoImmediate(chanPtr, &sndCmd); printf("\n Status = %ld - freq = %ld (%lX)", status, sndCmd.param2, sndCmd.param2); Wait(30); /* this says piep */ sndCmd.cmd = freqCmd; sndCmd.param1 = NIL; sndCmd.param2 = note; status = SndDoImmediate(chanPtr, &sndCmd); printf("\n Status = %ld - freq = %ld (%lX)", status, sndCmd.param2, sndCmd.param2); Wait (30); status = SndDisposeChannel (chanPtr, FALSE); chanPtr = NIL; }