Japanese
SGL User's ManualData exchange
BackForward
Passing data

2.Sound data


This chapter explains the minimum data format and operations that must be known when passing sound data created by a sound designer to a programmer in order to incorporate it into software using SGL.

2-1. Types of data

All sound data created on Macintosh is a binary file and is divided into the following files.

BGM, sequence data

1) Tone bank data
Tone data used for songs and sound effects.
Created using Sega Sound Tools Tone Editor.

Figure 2-1 Example of tone bank data file


You need as many files as you want to use for the map.
Tell the programmer the order in the map.

2) Sequence data
Song and sound effect data.
Created using the Sega Sound Tools sound simulator.

Figure 2-2 Example of sequence data file


You need as many files as you want to use for the map.
Tell the programmer the order in the map.

3) DSP program
This is a program for effect modules.
Created using Sega Sound Tool's DSP Linker.

Figure 2-3 DSP program file example


It is not necessary if you do not use effects.
Tell the programmer the order in the map.

4) Map binary file
Instruct the memory of the 68000 sound CPU to the load address of the files 1) to 3) above and the work area used for the DSP program.
This file will be loaded into A000h of the 68000 memory.

The maximum size of a map is 4096 bytes, and you can have up to 128 area maps, and one area map can have up to 32 bytes of map information.

Figure 2-4 Map binary file structure


The bit images of each map (Map1 to 4) are shown below.

Figure 2-5 MAP bit image


Figure 2-6 Map binary file example


5) Sound driver
It is better to give the programmer the one that comes with the Macintosh sound tool to ensure that the versions are consistent.

Figure 2-7 Sound driver


6) Dump data file
This is a dump of the memory from B000h to the last map data with the files 1) to 3) above loaded into the 68000's memory.
(However, if the last data was in the DSP work RAM, the previous data will be dumped.) There is no need to partially load and use only the necessary banks, and all map data can be dumped at once. If you use this dump data file, you can avoid loading the files 1) to 3) above one by one. This eliminates the possibility of loading data in the wrong order and saves time on the programmer's part. Dump data files are created using the SEGA Sound Tools sound simulator.

Figure 2-8 Dump data file example


The figure below shows the BGM and sequence files that need to be passed to the programmer.
Give the programmer one of the following files:

  1. Sound driver, map binary, dump data (includes tone bank data, sequence data, DSP program)
  2. Sound driver, map binary, tone bank data, sequence data, DSP program

Figure 2-9 BGM and sequence files passed to the programmer


●Notification of sound control number

Programmers use "sound control numbers" to play songs and sound effects on SGL.
The combination of the sequence data number on the sound simulator and the song number becomes the "sound control number," so when the sound designer hands over the file, the sound designer tells the programmer which number to use and what kind of sound will be produced. Please tell.

Figure 2-10 Sound control number passed to the programmer


PCM stream playback data

This is PCM data for use with SGL.

Figure 2-11 PCM data file example

Created using the Sega Sound Tools sound simulator.

Sound designers should convey the following information to programmers when passing files:

Table 2-1 PCM data file information to be passed to the programmer

file name sound stereo bit pitch comment
stereo.8 “It’s 10 years early.” stereo 8 7800 It is shifted left and right
mono.16 "Yes." monaural 16 7180
stereo.16 "Aww" stereo 16 7F00 Voices flow from right to left

2-2. Incorporating data

In order to incorporate the sound data files explained in the previous section into software using SGL, it is necessary to convert each binary data file to array data so that it can be read by C language.

Below is an example script that performs this task on UNIX.
Here I am using GNU's sed.

Script file name [binary file name] [array name]> [Output file name]

#!/bin/csh -f echo "char$2[]={" od -hv$1|cut -s -d ""-f2-|gsed's/\(..\)\(..\)*/0x\1,0x\2,/g' echo"};"

This can be easily done in C language using ANSI functions, so if your development environment is a PC, please create it in C language.

Now you have sound data that can be incorporated into your software. All you have to do is treat it like any other data.


BackForward
SGL User's ManualData exchange
Copyright SEGA ENTERPRISES, LTD., 1997