🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2236

Re: Music Kit Question

#2236
From: Don Yacktman
Date: Fri, 22 Jan 1993 03:59
52 lines
3053 bytes
In article <1993Jan21.231029.3409@leland.Stanford.EDU>, daj@ccrma.stanford.edu writes:
>In article <aw#@byu.edu>  writes:
>> 
>> 
>> I've been playing around a lot with getting background scores
>> playing in my games, and have run up against a couple of problems.
>> 
>> I can get either sound effects _or_ music to work quite well alone,
>> but getting both simultaneously from the same app does not work.
>> I have a few theories about why this is, and how to fix it...but
>> if someone else has got sound playback and music working simultaneously
>> from the same app already, I'd be interested in a few tips.  I
>> looked at the latest Ensemble, and it too can only do sound _or_
>> DSP synthesis, but not both together.  Ack!  Of course, if I spin
>> off a separate process to play the scorefile and do the sounds from
>> the game itself, everything works fine.  This is easy with distributed
>> objects, but I'd rather have my ScorePlayer object reside in the
>> same process, since this is wholly inelegant.  (It works, though.)
>> 
>
>I don't understand the question.  One of the most interesting features of
>the latest Ensemble (3.1 music kit) is the ability to combine playing of
>sound files with DSP synthesis.  This DOES work.  
>
>I suggest looking closely at how Ensemble does it and do the same thing in your
>application.

I answered this is e-mail, but since the replay was posted, too, I
thought I ought to clarify for any confused net readers...

The problem I had was that I couldn't get Ensemble to do sound+music.
Looking at the source, I see it should, and I suspect it's my lack of
knowledge about Ensemble that was the block there.  I wish someone
who knew how to use it would take the time to write decent user docs.

Anyway, sound+music is pretty easy under 3.0, and I did figure it out.
The next release of PacMan will include the necessary source code, so
any of the curious will be able to muck around with it.  It you need the
source before then for any reason, just ask me and I'll send it.  The
basic solution is to create your own sound out device and your own play
stream and then play the sounds by enqueueing the data buffer on the
play stream.  You _cannot_ use the -play* methods in the Sound object,
though, since they do something which conflicts with the music kit.  In
fact, I've found those methods to be very buggy and not worth using,
especially if a sound will be played back repeatedly, such as in a game.

Questions, flames, etc. should be mailed to me...

Later,
-Don Yacktman
yackd@alaska.et.byu.edu
Technical Details
Message-ID: <#0#@byu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!swrinde!gatech!news.byu.edu!news
References: <aw#@byu.edu> <1993Jan21.231029.3409@leland.Stanford.EDU>

Show Full Headers
Complete Article Headers
Nntp-Posting-Host: idaho.et.byu.edu
Lines: 52
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!swrinde!gatech!news.byu.edu!news
Message-ID: <#0#@byu.edu>
Date: Thu, 21 Jan 93 20:59:17 MST
From: yackd@idaho.et.byu.edu (Don Yacktman)
Newsgroups: comp.sys.next.programmer
Distribution: world
References: <aw#@byu.edu> <1993Jan21.231029.3409@leland.Stanford.EDU>
Organization: Brigham Young University, Provo UT USA
Subject: Re: Music Kit Question