From: "Andrew Davidson" Newsgroups: comp.os.msdos.djgpp Subject: Re: Fast reading of multiple keypresses in Allegro Date: Fri, 19 Feb 1999 00:29:08 -0000 Organization: Customer of Planet Online Lines: 44 Message-ID: <7aibkp$3m4$1@news7.svr.pol.co.uk> References: <8D53104ECD0CD211AF4000A0C9D60AE353FA26 AT probe-2 DOT acclaim-euro DOT net> <7aenjo$mmm$1 AT news5 DOT svr DOT pol DOT co DOT uk> <201zjovrum DOT fsf AT Sky DOT inp DOT nsk DOT su> <7afuu7$j1n$1 AT news6 DOT svr DOT pol DOT co DOT uk> <20zp6bu74w DOT fsf AT Sky DOT inp DOT nsk DOT su> NNTP-Posting-Host: modem-79.lidocaine.dialup.pol.co.uk X-Trace: news7.svr.pol.co.uk 919384537 3780 62.136.60.79 (19 Feb 1999 00:35:37 GMT) NNTP-Posting-Date: 19 Feb 1999 00:35:37 GMT X-Complaints-To: abuse AT theplanet DOT net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com wrote in message news:20zp6bu74w DOT fsf AT Sky DOT inp DOT nsk DOT su... >"Andrew Davidson" writes: > >> I think I'm approaching this problem from the wrong angle. Rather than play >> a sample through allegro's functions is there any way I can simply flex or >> relax the speakers a single time? Is there an ultra low-level allegro >> function I can get at to do this? This would be a similar function to >> writing to port 61h on a pc, but would affect the speakers wired up to the >> sound card, rather than the pc speaker. > >You can try MIDI, but I doubt that you can find really good notes for >noise. But why do you need it this way at all? Samples played with >play_sample are mixed together, and one buffer is sent to sound card, >when sound card finishes playing this buffer, it generates interrupt >and mixer prepares next buffer (or program is polling the state of >sound card in timer interrupts at intervals of some milliseconds and >detects when it is time to prepare next buffer). Overhead is not >large (it is small) and you can use play_sample for playing noise. Yeah sorry, I should have explained this better. I'm trying to emulate a simple speaker like that connected to the pc or spectrum which is activated by flipping a single bit in a port somewhere. This would obviously be emulated rather well by doing much the same thing but with the speakers connected to a sound card (as pc speakers just don't have the omph necessary really). I've had some interesting posts about the physics behind sound generation and how I can't expect to get identical sound without putting in appropriate pauses before changing the state of the speakers and such but that's all for later. Really I just want to know if such a simple function is available on todays flashy soundcards. I have a nasty feeling it wouldn't be as there is no real need to flex or relax a speaker these days when the sound card can do all that for you. Nevertheless, if it is still doable I'd really appreciate a description of how and if it can be done with allegro's sound functions that would be even better as it would allow support for more than one type of sound card without having to learn how to program them myself. Thus MIDI isn't really what I want here, I think, as it's far too high-level.