PLUGIN: DirectMusic plugin

Started by modgeulator, Wed 28/04/2004 03:15:15

Previous topic - Next topic

modgeulator

Hi, I've completed my DirectMusic plugin for AGS.

System requirements:
Used alone: DirectX 8.0 or higher and Windows 95 or higher
Used in conjunction with AGS audio engine: DirectX 8.0 or higher and Windows 2000 or higher

The demo consists of three bare rooms. A forest, a town and an interior building inside a town. The forest has a simple ambient soundscape consisting of a random bird call, some forest animal/woodpecker kinda sounds (intended to be very similar to many classic Sierra games), and periods of silence. The town is a simple ditty for guitar and flute, entering the house-room it transitions to a similarly arranged piece then back again when you re-enter the town. I've written this music with the intention of using it in KQ 2.5.

In the house-room try INTERACTING with the BLUE CUP, it should trigger a sound effect and a MIDI music of a drum intro - this is being played using the internal AGS engine. I also need to know if this works. It's hard to click on the blue cup, so please try a few times if needed. Thanks.
(I know this will only work with Windows 2000 and XP now.)

You can download the demo here: http://modgeulator.tripod.com/DirectMusic.html

EDIT: If you're using Windows 95 / 98 / ME you need to run winsetup first and turn off the digital sound completely.


Hollister Man

It worked beautifully on my comp, running DX9 and XP.  

I had no problems with the blue cup, the sound overlayed very nicely.

What exactly is the plugin for, dynamic stereo fading or something?
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Joseph DiPerla

WOW, nice job. But to repeat a question, what is this exactly for?


SIDENOTE:
If we could use DX9, then maybe we can use Revolution3d.net to make a 3D plugin... Just a thought.


JD
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

Candle

Everything worked on mine fine , here is my computer info .
------------------
System Information
------------------
Time of this report: 4/27/2004, 23:33:23
      Machine name: CANDLE
  Operating System: Windows XP Home Edition (5.1, Build 2600) Service Pack 1 (2600.xpsp2.030422-1633)
          Language: English (Regional Setting: English)
System Manufacturer: VIA Technologies, Inc.
      System Model: VT8601
              BIOS: Award Modular BIOS v6.00PG
         Processor: Intel Celeron, ~900MHz
            Memory: 512MB RAM
         Page File: 230MB used, 1020MB available
       Windows Dir: C:\WINDOWS
   DirectX Version: DirectX 9.0b (4.09.0000.0902)


strazer

All working as you described.
Win2kPro/DirectX9.0b/SBLive5.1

a-v-o

OK, here is a Win98SE report:

At game start there is a short cracking sound.
All rooms are quiet, so sound.
The sound for "use cup" is ok, though.

Checked with another game: There is no cracking sound at game start.

AMD K6-II 400 MHz
Creative SoundBlaster 128 PCI
Win98SE (german)
DirectX 9.0

Tried it on the other computer with Win98SE but only DirectX 6.1. Also the cracking sound at first, but then crash with an error message. So it is definately not for 6.1. Just wanted to tell you ;-)

modgeulator

#6
Glad to hear it's been working for everyone so far. To answer the question, it's intended for playback of DirectMusic Producer soundtracks. You can create scripted interactive music in DMP and use this plug-in to load your project and call routines from within AGS.
If you've ever paid attention to the music in LucasArts games, from Monkey Island 2 onwards, you should of noticed how the music is constantly changing depending on what you do in the game. Think of the music in Woodtick, or at the swamp/voodoo lady. If you can learn DirectMusic Producer, you can now have music like that in an AGS game.
Another feature is DLS or Downloadble Sounds. This is a system similar to SoundFonts that can be used in DirectMusic Producer, so basically you can set up MIDI music playing back with customized sounds - the small filesize and flexibility of MIDI, but without the restrictions of normal "General MIDI" soundsets as well as music that will sound exactly the same on any computer.

So what this plugin does, exactly:
-Loads a DirectMusic Producer script and AudioPath upon initialization. The script filename currently must be "AGSGame.spt" and the AudioPath must be called "AGSGame.aud".
-Allows you to call routines within that script from an AGS game. You do this with a function:
DMRoutine(string routinename);

Hope that helped to explain things.

EDIT: a-v-o posted while I was posting. So it looks like it doesn't work with win98se then? I'll have to look into that.
a-v-o, could you try running winsetup.exe and disabling digital sound and MIDI music completely and seeing if it works then?

EDIT SOME MORE: Also, a-v-o, how much ram did that first machine have in it?

EDIT #3: I tested it myself on another machine running Windows 98SE, doesn't work with AGS audio system (no sound from DirectMusic and click sound as described by a-v-o). Works fine if i turn off the AGS audio output in winsetup. MIDI playback didn't cause any problems however.


I'm going to list these as the system requirements for now:

DirectMusic plugin, without AGS in-built audio: Direct X 8.1 or higher and Windows 98 or higher.
DirectMusic plugin *with* AGS in-built audio: Direct X 8.1 or higher and Windows 2000 or higher.

Scorpiorus

Nice work with the plugin :)

And yep, it works fine under Win2k/DX9b

~Cheers

a-v-o

I have 128 MB RAM in the computer.

More testing results:
Code: ags

SM|BGD|2
--|+--|-
-+|+-+|-
+-|-+-|+
++|-++|+


Settings (+ enabled  - disabled):
S: sound device
M: music device
Audible (+ ok  - silence):
B: Background music
G: broken glas
D: drum
game start (+ ok  - error):
2: start game for a second time after quit game

When the sound device was disabled then I could hear background music, but after I quit game I couldn't start neither winsetup nor the game again. I had to reboot the computer, then I could start the game again.


modgeulator

Quote from: a-v-o on Wed 28/04/2004 21:34:50
When the sound device was disabled then I could hear background music, but after I quit game I couldn't start neither winsetup nor the game again. I had to reboot the computer, then I could start the game again.
Thanks a-v-o, you're really helping me a lot. I haven't been able to recreate this error on another computer running Windows 98 though. What happens if you start from a fresh boot with sound and music disabled, quit the game, then start it again? Without  testing it with any of the devices turned on in AGS in between.

Also, if anyone's using Windows 95 or Direct X 8.0, I'd be really interested to hear if it works or not (you'll need to run winsetup and disable sound and music first).

a-v-o

With sound and music disabled I can hear the bird in the forest room. Then I quit and start the game again and it doesn't start, but shows the windows error message saying someting like "This application was closed ...".

modgeulator

Damn, this really has me stumped.
a-v-o, if you've got time, could you try downloading this: http://www.lynnemusic.com/gamemusic/dmdemo1.zip (~500kb) and seeing if it causes similar problems on your machine?

Ben

#12
Works perfectly on my computer.. Direcx 8 on Windows 2000.

By the way-- Does this support real-time effects plugins (DX Plugins like Freeverb, etc...)?

Pumaman


Gregjazz

This looks cool -- so what exactly does this plugin support and do? (downloading demo now)

a-v-o

Quote from: modgeulator on Thu 29/04/2004 10:01:27
Damn, this really has me stumped.
a-v-o, if you've got time, could you try downloading this: http://www.lynnemusic.com/gamemusic/dmdemo1.zip (~500kb) and seeing if it causes similar problems on your machine?
No problem with the demo. Level music and jingles, all working. Can start and quit the program for several times without an error message.

I gonna install Win95 on a 486 (100 MHz), then I can test it on that machine, too.

Hollister Man

An earlier thread mentioned that Modgeulator was having problems with the game sound failing to initialize and wanted to make a plugin that would avoid that issue, and probably make some neat stuff with it too.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

modgeulator

Quote from: a-v-o on Thu 29/04/2004 22:33:53
No problem with the demo. Level music and jingles, all working. Can start and quit the program for several times without an error message.
Well, I really don't know what the problem is. I have to admit, I've gone a little out of my depth programming-wise on this project (that's the only way to learn though.) Are there any experienced VC++ programmers that wouldn't mind looking through the source code to see if there's any silly mistakes I've made?

Quote
I gonna install Win95 on a 486 (100 MHz), then I can test it on that machine, too.
Thanks, that should be interesting to see if it works - you'll also need to install DirectX 8.0.

Pumaman, would there be anyway to return the DirectSound interface object in a function call? If I could access that I might be able to make this plugin work perfectly with the DirectSound driver.

Ben, are you running DirctX 8.0 or 8.1? No, you can't use those DX plugins, but there are built-in DirectMusic effects you can use (Chorus, Compressor, Distortion, Echo, Flanger, Gargle, Reverbs and a parametric EQ.)

Geoffkhan, it lets you use a DirectMusic Producer project. I don't really know how to explain it better than that, you might want to check out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dmusprod/htm/overview.asp
If you're interested in working with it you should download DMP and work through the tutorial. Be warned, it isn't the most user-friendly program to work with - but it's not impossible to figure out either.
I'd say this plugin doesn't have a very wide appeal - probably has an interest group consisting of...umm... just me, and that's all at the moment. You have to learn DirectMusic Producer to use this plugin.

No, Hollister Man, it's not to fix a problem with game sound initiliazing. It's for the neat stuff making. I think I'm just managing to confuse people more and more  :-\


a-v-o

I've tried to install DirectX 8, but it told me that it doesn't support this kind of CPU; must be a Pentium or K6 class processor.  

Perhaps CJ can help to get closer to the buggy part, because after first time run neither the game exe nor the winsetup exe can be started. So the problem must be in the common part of the startup code of winsetup and game exe.

Maybe you need some finalization code in your plugin to release reserved ressources. Writing this I got another idea. When I'm back home I test if I can start other AGS games after running your demo game. And I can also test if the demo program is running when AGS isn't.

I'll report the results later.

modgeulator

Quote from: a-v-o on Fri 30/04/2004 10:46:35
I've tried to install DirectX 8, but it told me that it doesn't support this kind of CPU; must be a Pentium or K6 class processor.  

Perhaps CJ can help to get closer to the buggy part, because after first time run neither the game exe nor the winsetup exe can be started. So the problem must be in the common part of the startup code of winsetup and game exe.

Maybe you need some finalization code in your plugin to release reserved ressources. Writing this I got another idea. When I'm back home I test if I can start other AGS games after running your demo game. And I can also test if the demo program is running when AGS isn't.

I'll report the results later.

Thanks again a-v-o. I've already got finalization code in there. The plugin should already be releasing everything  and deleting all the memory pointers when AGS shuts down (called from "void AGS_EngineShutdown()").

I had another idea, how are you quitting the game? Are you quitting thru the menu or are you pressing "alt-x"?

SMF spam blocked by CleanTalk