[directmusic] Re: 3rd Question

  • From: "Scott Morgan" <scott@xxxxxxxxxxxxxxxxx>
  • To: <directmusic@xxxxxxxxxxxxx>
  • Date: Sun, 1 Jun 2003 11:37:07 -0700

Hey Paul,
Two scripts should be fine if the first has a reference to the other.  Well, 
they should be fine UNLESS you are not downloading all content when the script 
loads.  That's a DM bug (not mine).

I sent out a mail to this list a while back complaining about some of these 
issues.  I pasted that mail at the end of this message.  You may be hitting Bug 
#5.

The Don't Pre-Roll option can save a ton of memory if you have a lot of waves.  
It can hurt your performance though.  Try it out and see how it works for your 
project.

Oh, btw Bug#1 below turned out to be an issue where Task Manager misreports RAM 
usage (thanks to JDooley for helping me on that one).

The other thing you should watch out for is glitching in DX9 when you 
dynamically load stuff in.....I have a workaround, but you need a special build 
of DMDemo and you have to replace all script track calls with special lyrics.   
Hmmm, maybe I should release that tweaked version of DMDemo.  So far I didn't 
think anyone but me would care about it.

  I've been doing a lot of work with downloading and unloading sound data 
through scripting lately since I can use a lot more samples if I'm swapping 
instruments out dynamically.  Unfortunately this is yet another buggy area it 
seems.  I'm afraid I'm going to have to abandon it to avoid leaks.

  If a script turns off the option to download all segments when the script 
loads, will the segments leak if the script doesn't unload what it loaded?

  If so I'm in trouble because sometimes things just won't unload no matter how 
many times I call unload on them.

  I've uploaded two projects demonstrating my problems.  There are DMDemo exes 
in the project folders that have buttons and commentaries on the various bugs.

  Sorry its such a large download.  I'm trying to make a point with memory 
usage.

  http://Morganstudios.com/Load&UnloadBugs.zip

  I've listed the bugs in order of priority to me.

  Bug#1 (in LoadScript&UnloadBug2)
  The worst one is one where if you download and unload some segments several 
times, they get to where you can never unload them again.  I don't know what 
the distinguishing thing is that makes a segment do this.  I can't figure it 
out for the life of me.  Oh, the engine behaves like the data was unloaded 
since playback no longer happens, but if you look at task manager the memory is 
still taken.

  Bug#2 (in UnloadBug)
  An instrument will not unload if a note is still playing.  What if a note 
gets stuck?  I actually went in and got rid of all my NoCutoff flags and 
Don'tCuttOff options on all notes in paranoia.  I'm afraid the real source of 
my pain was Bug#1 though.

  Bug#3 (in UnloadBug)
  An instrument can partially load (via a band's instrument's range), but they 
don't seem to partially unload. The engine waits until all segments with that 
instrument have been unloaded before any data is unloaded from that instrument. 
 That really limits the usefulness of the range feature (which I thought was 
such a good idea!)

  Bug#4 (in both projects)
  Once data has been downloaded, it seems a certain percentage of it never goes 
away.  This can be anywhere from 50k to 600k depending on the DLS collection.

  Bug#5 (in LoadScript&UnloadBug2)
  If a script is told not to automatically download all segments when loaded, 
it cannot directly load a second script.  You have to call the 2nd script via a 
segment's script track or something to make it load.  Even script.load doesn't 
work.  Again scripts have no problems loading other scripts if you have the 
first script load everything automatically.

  I know MS is listening, I know I was when I was a bug hunter up there :)  
hehe thanks guys.

  -Scott Morgan
  http://Morganstudios.com

-Scott Morgan
http://Morganstudios.com


----- Original Message ----- 
From: "Paul Stroud" <paul@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: <directmusic@xxxxxxxxxxxxx>
Sent: Sunday, June 01, 2003 4:43 AM
Subject: [directmusic] 3rd Question


> A little addition,
> 
> I can't seem to be able to call into another script using DMDemo - DMP
> manages it OK
> 
> DMDemo is not limited to one script is it? Scott, you seem very thorough,
> I'm sure you would have mentioned this in the DMDemo Readme.
> 
> This is the routine I'm trying to call
> 
> Sub Initialize
> DownloadScript.DownloadIntro
> Ens Sub
> 
> Any ideas why it won't work?
> 
> Paul
> 

Other related posts: