Beginner troubles with DirectMusic

Started by
4 comments, last by Ironblayde 23 years, 10 months ago
I''ve managed to get the basics of DirectMusic working for a game I''m working on; it sets everything up OK, and loads and plays MIDIs when it should, but I have a few questions. First, when I loop a segment using IDirectMusicSegment::SetRepeats(), there''s a second or two of delay between the time the track ends and the time it begins again. It''s not empty space in the MIDI file. Is there a way to get rid of it. Second, is there a way to control the volume on a segment currently playing? I''d like to use this to fade the music out instead of cutting it off abruptly, when one scene becomes another. Thanks! -Ironblayde Aeon Software
"Your superior intellect is no match for our puny weapons!"
Advertisement
For the 2 second delay, i think it''s probably due because you
use the "MS Software Synthetizer" on Win9x, which is absolutely
not optimized and very slow at loading...

For setting up the volume, you can simply use SetGlobalParam()
function as described below :

...
LONG m_lVolume = x;// <0 for attenuation ; >0 for amplification
(*pPerf) -> SetGlobalParam(GUID_PerfMasterVolume, &m_lVolume, sizeof(LONG));
...
(where pPerf is your IDirectMusicPerformance interface)

I hope it will help you ;-)


BugKiller
www.bugkiller.net
Thanks, that''s just what I needed for the volume control! I don''t think I ever would have found that in this giant DirectMusic document I have -- I suppose I should find a book. But I looked up the function you mentioned, and near it I found some other things about timing that may help eliminate the delay as well. Thanks again!

-Ironblayde
Aeon Software
"Your superior intellect is no match for our puny weapons!"
actually, i''m a beginner on Directmusic.. i can''t even understand the stuff in the samples, so does anyone have a bare, basic, small windowed, with nothing, and play music when it starts.. and stops when you close the window?? the simplest thing possible, thanx

and how do i use waves with midis, both in a game...??
Try the DMusicMidi sample program that came with the SDK.

JoeMont001@aol.com
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
DMusic is basically complicated mod compositions. I played around with it a little bit and it is funny to add your own wav file and add it to the music. It just takes plenty of practice to learn it.

It is good for digital playback of instrument samples and it is almost .wav quality. I am not much into music so whatever I make sounds like #$@#$@#, but I''m learning =).. just do not overwhelm yourself and go in steps.

Good Luck

The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.

?Have a nice day!?

This topic is closed to new replies.

Advertisement