PDA

View Full Version : DOTT Midi playback questions


NovaCoder
10-14-2009, 09:16 PM
Hiya,

In my quick & dirty Amiga port I'm having trouble getting the longer running background type music to loop (re-start), apparently this happens through the soundKludge do_command code?

Can anyone see why music is not restarted?

This do_command code is just for DOTT BTW, I know SAM & MAX etc uses some of those 'stubbed out' commands.


int AmigaSoundEngine::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) {
byte cmd = a&0xFF;
byte param = a>>8;

if (param==0) {
switch(cmd)
{ case 6: return 1;
case 7: return 1;
case 8: startMusic(b); return 1;
case 9: stopMusic(b); return 0;
//case 10: stopAllSounds(); return 0;
case 11: stopAllSounds(); return 0;
case 13: return isMusicPlaying(b);
case 16: return 1;
case 17: return 1;
case 18: return 1;
default: warning("SoundEngine::do_command invalid command %d", cmd);
}
} else if (param==1) {

switch(cmd) {
case 0: return 1;
case 1: return 0;
case 2: return 1;
case 3: return 0;
case 4: return 1;
case 5: return 0;
case 6: return 0;
case 7: return 1;
case 8: return 1;
case 9: return 1;
case 10: return 0;
case 11: return 0;
case 12: return 1;
case 13: return 1;
case 14: return 1;
case 15: return 1;
case 16: return 1;
case 19: return 1;
case 20: return 1;
case 21: return -1;
case 22: return 0;
case 23: return 1;
case 24: return 0;
default: warning("SoundEngine::do_command default midi command %d", cmd);
return -1;
}
}

return -1;
}


Thanks :)

jestar_jokin
10-15-2009, 05:37 AM
Hiya,

In my quick & dirty Amiga port I'm having trouble getting the longer running background type music to loop (re-start), apparently this happens through the soundKludge do_command code?

Can anyone see why music is not restarted?

This do_command code is just for DOTT BTW, I know SAM & MAX etc uses some of those 'stubbed out' commands.


int AmigaSoundEngine::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) {
byte cmd = a&0xFF;
byte param = a>>8;

if (param==0) {
switch(cmd)
{ case 6: return 1;
case 7: return 1;
case 8: startMusic(b); return 1;
case 9: stopMusic(b); return 0;
//case 10: stopAllSounds(); return 0;
case 11: stopAllSounds(); return 0;
case 13: return isMusicPlaying(b);
case 16: return 1;
case 17: return 1;
case 18: return 1;
default: warning("SoundEngine::do_command invalid command %d", cmd);
}
} else if (param==1) {

switch(cmd) {
case 0: return 1;
case 1: return 0;
case 2: return 1;
case 3: return 0;
case 4: return 1;
case 5: return 0;
case 6: return 0;
case 7: return 1;
case 8: return 1;
case 9: return 1;
case 10: return 0;
case 11: return 0;
case 12: return 1;
case 13: return 1;
case 14: return 1;
case 15: return 1;
case 16: return 1;
case 19: return 1;
case 20: return 1;
case 21: return -1;
case 22: return 0;
case 23: return 1;
case 24: return 0;
default: warning("SoundEngine::do_command default midi command %d", cmd);
return -1;
}
}

return -1;
}


Thanks :)

soundKludge is basically the interface to iMUSE through SCUMM scripts. I don't know iMUSE intimately enough to help, but I believe all looping information is contained as SysEx messages in the MIDI stream.

The ScummC documentation on iMUSE might help:
http://alban.dotsec.net/15.html

NovaCoder
10-15-2009, 07:38 PM
Hiya,

Thanks for that link, very helpful :)

I found out the answer on another forum, cmnd 15 (when param == 1) sets up a 'hook jump' which means that the track is looped.