Archived

This topic is now archived and is closed to further replies.

Beginner troubles with DirectMusic

This topic is 6382 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...??

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites