[comp.sys.mac.programmer] The Sound Manager -- spec. the syncCmd

regis@athena.mit.edu (Christopher Cotton) (04/10/91)

Hello.

I have just recently been mucking around with the Sound Manager...  and
I was wondering if anyone could tell me exactly how to use the  syncCmd
with 4 channels using the waveTableSynth.

I know that you are supposed to send each one a decementing value (i.e.
send the first channel a 4, the next a 3, etc.)   But when exactly
should I send the syncCmd...

Basically I want to play a music score with 4 voices and I want them all
to start at the same time (since a 4 part harmony does not sound good
when it the notes are a 1/2 beat off).

-Should I send the syncCmd's first?  And then all of my play noteCmd's
(Yes, I already installed a waveTable as an instrument).
-Should I send just some of syncCmd's? Then later send the final
syncCmd?
-Should I send a waitCmd, then send the syncCmd's with SndDoImmediate?
Then send all of the noteCmd.

Right now  (and in many of the combinations that I have tried..) it
either does not stop playing the chord (which is interesting since you
can only stop it by rebooting.  Non-protected systems are nice are they :-)
or it plays the supposed chord one note at a time, when you dispose of
the channels.

Any help, and any sample code would be very cool.   Or even some
direction of where to go.  I already have the Ch. 22 (Interim IM) on
Sound Manager.   And a bunch of other things, but they have not helped
too much.

Thanks again....

Chris Cotton
o Kiwi Sadist
o RaNNdoM ThiNNker!.

REEKES@applelink.apple.com (Jim Reekes - Sound Mgr Engineer) (04/11/91)

One thing to do is get ahold of SoundApp which is sample code 
available from MacDTS.  I wrote it to demonstrate all the features 
of the Sound Manager I could think of.  It does show the use of the 
syncCmd with the waveTableSynth playing a 4 part song from Bach.  
You first send the syncCmd using SndDoImmediate to all the 
channels.  Then send your commands.  After this is done, then send 
the final syncCmd again with SndDoImmediate that starts all the 
channels playing.


Jim Reekes E.O., Macintosh Toolbox Engineering