We are trying to simulate Imuse on AGS.
Imuse is, for example, what happens on Monkey Island 2 while you´re walking by the wharf (and then you go to see the carpenter, Wally, etc.) where the game starts. The theme changes without altering the main melody.
As, actually, it´s not able to reproduce more than one midi at the same time. What we do is to use several midis at same times, and change from one to another using getmidiposition and seekmidi.
The problem is that during that change, the instruments´ volumes are badly heard, they doesn´t load on time, and then the change isn´t good.
I wonder if, maybe, on the next version or in a nearby future, you can fix that error or make AGS able to reproduce more than one midi at the same time.
www.groggames.com.ar/proyecto/imuse.zip
In this exaple, the same midi is used for the 3 areas. But that is of no interest, what matters is how the instument's sound changes. If you go to the white area the sound stops and when going to the colour area the sounds will start fine. Then when going to another area the instuments will be heard with other volumes.
used in Repetaedly Execute of Room:
Region *reg= Region.GetAtRoomXY(player.x, player.y);
if(GetCurrentMusic() != reg.ID)
if((GetMIDIPosition()%4 == 0)||(GetCurrentMusic()==-1))//only change when a compass ends
{
int pos = GetMIDIPosition();
StopMusic();
PlayMusic(reg.ID);
SeekMIDIPosition(pos);
}
Thank you, Nahuel36
Its not a bug. Most programs can't do more than one midi at once.
There's an AGSMuse module that emulates Imuse, the module is made by Monkey0506
Linky:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28933.0
There are currently no plans to add support for playing multiple MIDI tracks. Since MIDI is generally a dying format these days with people moving to digital audio such as OGG, unless there are a large number of requests for this feature I don't think it would be a worthwhile effort to implement such a thing.
Ok, thanks for the answer. But I think that something is not clear. The bug is not that there isn't a multi track support, it's the instruments' volume change. That's why I uploaded the demo.
Quote
There's an AGSMuse module that emulates Imuse, the module is made by Monkey0506
Linky:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28933.0
I know, that plugin does exactly what I am doing, and the mistake I'm explaining also happens.
Thanks guys
Ok sorry for the misunderstanding, I'll look into it. I should however warn you that AGS uses a 3rd-party MIDI playing library and therefore I may not be in a position to fix any problems with it.
I was just about to look into this, but the zip file seems to be corrupt. Could you try uploading it again?
We don't know why, but the uploaded files only work if you download them from other browsers rather than Internet Explorer.
By the way, here is a mirror
http://www.megaupload.com/?d=JY9MV0BZ
Thanks. I tried walking between the coloured areas, but didn't notice anything strange with the volume.
What exactly is the problem?
ups, sorry
in that version we are trying to use ogg
this is the original version made in midi, with the bug
http://www.megaupload.com/?d=OTU7NS87
Hmm, I don't hear any volume spikes ... the current instruments do glitch slightly but that's probably because of the inaccuracy of the beat number leading to some of the beat getting played in both tracks. Is this the problem you're referring to?
Hmmm, no, that's not the problem I'm referring to.
You have to listen exactly the first time that changes. It's when the instruments' volume changes, once it changes it stays like that.
Mainly, at least in this case, the percussion's volume change is noticed, it's louder than the others. It wasn't like that originally.
If you still can't hear it, I can send you a wav with the exact moment recorded, but that's the idea; listening carefully during the beginning of the midi, and then go to the other area and listen.
I don't know if you can fix this or if it is a library problem, but I hope it's possible.
Thanks
Nahuel36
Your right actually. The percussion suddenly seems to get louder when I walk onto the green region. Perhaps theres something in the code that is causing this behavior. It appears to carry the symptoms of a scripting bug rather than a low-level bug with the midi handler. Thats only my opinion however but I urge you double check your coding there. :)
Cheers,
Sparky.