Thursday 16 January 2014

Milestag UMT audio



Visit Tagbits to see the full range of tagger products described in this blog.

I'm being asked to do several Milestag projects that use my Tagbits UMT boards, but they need audio resources that are not supported by the standard UMT audio tool.

Jim at Lasertagparts kindly supplies his sample programming utility and audio samples without licence.



However, it only supports 15 sounds, and none are allowed to be longer than the standard samples that Jim provides.

I did a project that shoehorned alternative samples into the lengths available here. But it was a pain.

So I finally got around to writing a utility that allows me to point the PC at a directory with some .WAV files in it.

It reads them all in and works out the lengths, then allocates these to 'sectors' within the ISD1790 playback chip.

This device has analogue memory, with each sector having a timespan of 0.125 seconds.

My program loads the samples up, allocates them sectors, programs them into the the UMT board ISD1790 (combined with custom PIC software to do this), plays the sample from the PC, plays the sample from the UMT board and finally generates a 'C' structure with all the correct addresses in.

Here is a screenshot of the program:



And here is the 'C' output it produces:

 
typedef enum
{
 e01_shot_umt,
 e02_empty_umt,
 e03_clip_umt,
 e04_action_umt,
 e05_miss_umt,
 e06_hit_umt,
 e07_kill_umt,
 e08_power_umt,
 e09_beep_umt,
 e10_buzz_umt,
 e11_medic_umt,
 e12_gameover_umt,
 e13_critical_umt,
 e14_beep2_umt,
 e15_disarm_umt,
} ESoundId;

#define LOWBYTE(value) (value & 0xff)
#define HIGHBYTE(value) (value / 0x100)

typedef struct
{
byte byStartLowByte;
byte byStartHighByte;
byte byEndLowByte;
byte byEndHighByte;
}SSound;

SSound sounds[] =
{
 {LOWBYTE(0x0010),HIGHBYTE(0x0010),LOWBYTE(0x0018),HIGHBYTE(0x0018),},
 {LOWBYTE(0x0019),HIGHBYTE(0x0019),LOWBYTE(0x001A),HIGHBYTE(0x001A),},
 {LOWBYTE(0x001B),HIGHBYTE(0x001B),LOWBYTE(0x001D),HIGHBYTE(0x001D),},
 {LOWBYTE(0x001E),HIGHBYTE(0x001E),LOWBYTE(0x0023),HIGHBYTE(0x0023),},
 {LOWBYTE(0x0024),HIGHBYTE(0x0024),LOWBYTE(0x002A),HIGHBYTE(0x002A),},
 {LOWBYTE(0x002B),HIGHBYTE(0x002B),LOWBYTE(0x002F),HIGHBYTE(0x002F),},
 {LOWBYTE(0x0030),HIGHBYTE(0x0030),LOWBYTE(0x003D),HIGHBYTE(0x003D),},
 {LOWBYTE(0x003E),HIGHBYTE(0x003E),LOWBYTE(0x0048),HIGHBYTE(0x0048),},
 {LOWBYTE(0x0049),HIGHBYTE(0x0049),LOWBYTE(0x004C),HIGHBYTE(0x004C),},
 {LOWBYTE(0x004D),HIGHBYTE(0x004D),LOWBYTE(0x004F),HIGHBYTE(0x004F),},
 {LOWBYTE(0x0050),HIGHBYTE(0x0050),LOWBYTE(0x0056),HIGHBYTE(0x0056),},
 {LOWBYTE(0x0057),HIGHBYTE(0x0057),LOWBYTE(0x005F),HIGHBYTE(0x005F),},
 {LOWBYTE(0x0060),HIGHBYTE(0x0060),LOWBYTE(0x0063),HIGHBYTE(0x0063),},
 {LOWBYTE(0x0064),HIGHBYTE(0x0064),LOWBYTE(0x0067),HIGHBYTE(0x0067),},
 {LOWBYTE(0x0068),HIGHBYTE(0x0068),LOWBYTE(0x006D),HIGHBYTE(0x006D),},
};



It will not work with Jim's standard Milestag UMT software, and I initially thought it could be patched into the existing Milestag code by putting in the new ISD addresses, however, a quick look at a disassembly of Jim's code shows that this will not be possible. However, it could easily be used with my open source UMT code on Github.

No comments: