Pausing songs and sound effects
- P1
- Pronunciation control number (0-7)
List ▲ ▼
- ●03H PAUSE Pause of songs and sound effects
- P1
- Pronunciation control number (0-7)
List ▲ ▼
- ●04H PAUSE OFF Cancels the pause of songs and sound effects.
- P1
- Pronunciation control number (0-7)
List ▲ ▼
- ●05H SEQUENCE VOLUME Volume adjustment or fade in/out
- P1
- Pronunciation control number (0-7)
- P2
- Volume (0-255) Around 128, the higher the value, the louder the volume. Previously, the default was 127, and the volume could only be lowered, but from Ver-2.00 onwards, it is possible to increase the volume higher than the sampled volume. However, be careful as setting an extremely large value may cause distortion.
- P3
- Fade Rate (0-255) Specify the time it takes for the current sequence volume to reach the specified sequence volume as a rate (0-255). The larger the value, the slower the change, with 255 being the longest and 1 being the shortest. (If it is 0, there will be no fade and only the sequence volume will be set.) The fade will be performed from the current sequence volume to the specified sequence volume. Fade-in or fade-out is determined by whether the specified sequence volume is larger or smaller than the current sequence volume.
List ▲ ▼
- ●06H STOP ALLStop all performances
- No parameters
List ▲ ▼
- ●07H TEMPO CHANGE Change the tempo of songs and sound effects
- P1
- Pronunciation control number (0-7)
- P2
- dummy (exists to place P3 and P4 at even addresses)
- P3-P4
- Tempo value (+32767 --> -32768) Relative tempo value to the standard tempo value (0000h). The tempo will double every 1000h (4096), and if it is negative, the tempo will be halved. In other words, you can control the time until the tempo doubles (or halves) with 4096 steps of precision. Since 0 is the standard tempo, you can return to the original tempo at any time by specifying 0000h.
List ▲ ▼
- ●08H MAP CHANGE Perform a map change
- P1
- Area map number (0-255) This is a sequential area map number that specifies the number of area maps from the beginning within the sound area map.
There are many scenes in the game, and the area maps are usually different from each other. Therefore, you must specify an area map before playing a sequence. Select the desired area map from the sound area maps and change the map. After the map change is completed, the sound data will be transferred according to the map. Preparations for sequence playback are now complete. Be sure to change the map at least once after starting the sound driver. From now on, you will have to do this every time the area map changes. Please follow steps 1 to 6 below to change the map.
How to change map
order | Processing content | explanation |
1 | stop all pronunciations | Issue the “Sound Initial (10h)” command. Specify all sound stops and all initializations with parameters. |
2 | Switch area map | Issue the "Map Change (08h)" command. In the parameter, specify the number of the area map you want to switch to. |
3 | Transfer sound data | Transfer sound data from SH address 25A0B000. If you have sound data divided into multiple files, transfer each data according to the area map. |
4 | Notify transfer completion | Set all the transferred bits of the sound area map CRNT work (from SH address 25A00500h) to "1" for the amount of data that has been transferred. |
5 | Set DSP | Issue the "Effect Change (83h)" command if necessary. |
6 | Set up the mixer | Issue the "Mixer Change (87h)" command. Be sure to set the mixer even if you are not using DSP. |
As long as the map change is complete, you can play the sequence at any time. To play a sequence, issue a sound control command (sequence start, sequence stop, etc.) to control sequence playback.
Note 1: If you switch the area map or replace the sound data in use while the sound is still playing, the system may go out of control.
Note 2: The DSP work RAM is used for internal processing of the DSP, so the contents of this area are constantly being rewritten by the DSP while the DSP is operating. Care must be taken when changing the area map, such as changing the size or address of the DSP work RAM. If the DSP is running, the sound data transferred to the location previously used as DSP work RAM will be destroyed.
List ▲ ▼
- ●09H DIRECT MIDI CONTROL Send MIDI events as commands
- P1
- MIDI command word (00h-FFh)
- P2
- MIDI channel word (00h-FFh)
- P3
- MIDI data 1 (00h-7Fh)
- P4
- MIDI data 2 (00h-7Fh)
The sound driver is a sound source that generates sounds using MIDI messages, so you can generate sounds by directly giving MIDI messages without creating sequence data. This command is an interface for that purpose, and has a message block to be given to the sound driver as a parameter.
The message block is a 4-byte data block consisting of a MIDI message with parameters for starting the sound, and is structured as shown below.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | Priority level | CMD |
1 | KNo | MIDI Ch |
2 | MIDI Data #1 |
3 | MIDI Data #2 |
Priority level | 0-31 | Pronunciation priority at Sequence Start |
CMD | 0-7 | MIDI command |
KNo | 0-7 | Pronunciation control number |
MIDII Ch | 0-31 | MIDI channel |
MIDI data #1 | 0-127 | MIDI data byte #1 |
MIDI data #2 | 0-127 | MIDI data byte #2 |
Correspondence with actual MIDI Event
CMD value | Corresponding MIDI Event |
0 | (80h-8Fh) Note Off Event |
1 | (90h-9Fh) Note On Event |
2 | (A0h-AFh) After Touch |
3 | (B0h-BFh) Control Change |
4 | (C0h-CFh) Program Change |
5 | (D0h-DFh) Channel Pressure |
6 | (E0h-EFh) Pitch Wheel |
7 | (F0h-FFh) System Massage |
Issue the "MIDI Direct Control (09h)" command using the 4 bytes of the message block as parameters P1, P2, P3, P4. However, there are advantages and disadvantages as listed below, so please consult with your sound creator before choosing the best method.
Strong Points
- Real-time control that is not possible with sequence data in advance is possible.
- There is no need to create data, such as creating a sequence or compressing it.
- Since compression and decompression processing can be omitted, no additional processing is required.
Cons
- Although you can do everything, in some cases you may have to understand a lot of the content and create advanced programs. (It cannot be used correctly unless you know the relationship between MIDI channels and corresponding tones, DSP programs and mixer specifications, etc., so coordination with the sound creator is necessary.)
List ▲ ▼
- ●0AH START VOLUME ANALYZER Start input level analysis of Digital Audio In
- no parameters
List ▲ ▼
- ●0BH STOP VOLUME ANALYZER Digital Audio In input level analysis completed
- no parameters
List ▲ ▼
- ●0CH DSP STOP Stopping and initializing DSP
- no parameters
List ▲ ▼
- ●0DH ALL NOTE OFF All sound stops
- no parameters
Note: This is for emergency situations, so please do not use it normally.
List ▲ ▼
- ●0EH SEQUENCE PAN Control PANPOT from the game
- P1
- Pronunciation control number (0-7)
- P2
- The 7th bit is a switch. This bit instructs whether to control the sequence PAN. 0 controls the sequence PAN. If it is 1, no control will be performed. Bits 6 to 0 are the PAN data values that MIDI can take (0 to 7FH).
Details of MIDI PAN data (correspondence with SCSP PAN)
MIDI PAN | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
00h - 0Fh | 1Fh | 1Fh | 1Fh | 1Fh | 1Eh | 1Eh | 1Eh | 1Eh | 1Dh | 1Dh | 1Dh | 1Dh | 1Ch | 1Ch | 1Ch | 1Ch |
10h - 1Fh | 1Bh | 1Bh | 1Bh | 1Bh | 1Ah | 1Ah | 1Ah | 1Ah | 19h | 19h | 19h | 19h | 18h | 18h | 18h | 18h |
20h - 2Fh | 17h | 17h | 17h | 17h | 16h | 16h | 16h | 16h | 15h | 15h | 15h | 15h | 14h | 14h | 14h | 14h |
30h - 3Fh | 13h | 13h | 13h | 13h | 12h | 12h | 12h | 12h | 11h | 11h | 11h | 11h | 10h | 10h | 10h | 10h |
40h - 4Fh | 00h | 00h | 00h | 00h | 01h | 01h | 01h | 01h | 02h | 02h | 02h | 02h | 03h | 03h | 03h | 03h |
50h - 5Fh | 04h | 04h | 04h | 04h | 05h | 05h | 05h | 05h | 06h | 06h | 06h | 06h | 07h | 07h | 07h | 07h |
60h - 6Fh | 08h | 08h | 08h | 08h | 09h | 09h | 09h | 09h | 0Ah | 0Ah | 0Ah | 0Ah | 0Bh | 0Bh | 0Bh | 0Bh |
70h - 7Fh | 0Ch | 0Ch | 0Ch | 0Ch | 0Dh | 0Dh | 0Dh | 0Dh | 0Eh | 0Eh | 0Eh | 0Eh | 0Fh | 0Fh | 0Fh | 0Fh |
○ The values in the table are SCSP PAN data (00h-1Fh: 32 steps).
○ Since MIDI PAN data has 128 levels, the lower 2 bits are ignored when converting to SCSP PAN data.
Left Center Right
00h ←−−−−−−−→ 40h ←−−−−−−−→ 7Fh
|
Correspondence table between SCSP PAN and MIDI PAN
PAN | L (db) | R (db) | Localization | | PAN | L (db) | R (db) | Localization |
00h | -00.0 | -00.0 | C | | 10h | -00.0 | -00.0 | C |
01h | -03.0 | -00.0 | R1 | | 11h | -00.0 | -03.0 | L1 |
02h | -06.0 | -00.0 | R2 | | 12h | -00.0 | -06.0 | L2 |
03h | -09.0 | -00.0 | R3 | | 13h | -00.0 | -09.0 | L3 |
04h | -12.0 | -00.0 | R4 | | 14h | -00.0 | -12.0 | L4 |
05h | -15.0 | -00.0 | R5 | | 15h | -00.0 | -15.0 | L5 |
06h | -18.0 | -00.0 | R6 | | 16h | -00.0 | -18.0 | L6 |
07h | -21.0 | -00.0 | R7 | | 17h | -00.0 | -21.0 | L7 |
08h | -24.0 | -00.0 | R8 | | 18h | -00.0 | -24.0 | L8 |
09h | -27.0 | -00.0 | R9 | | 19h | -00.0 | -27.0 | L9 |
0Ah | -30.0 | -00.0 | R10 | | 1Ah | -00.0 | -30.0 | L10 |
0Bh | -33.0 | -00.0 | R11 | | 1Bh | -00.0 | -33.0 | L11 |
0Ch | -36.0 | -00.0 | R12 | | 1Ch | -00.0 | -36.0 | L12 |
0Dh | -39.0 | -00.0 | R13 | | 1Dh | -00.0 | -39.0 | L13 |
0Eh | -42.0 | -00.0 | R14 | | 1Eh | -00.0 | -42.0 | L14 |
0Fh | - ∞ | -00.0 | R15 | | 1Fh | -00.0 | - ∞ | L15 |
List ▲ ▼
- ●10H SOUND INITIALIZE Initialize the sound driver
- P1
- Stop all sequence playback (0-1)
- P2
- Stop all PCM stream playback (0-1)
- P3
- Stopping CD-DA playback (0-1)
- P4
- DSP initialization (0-1)
- P5
- Mixer initialization (0-1)
* P1 to P5 are all execution instructions at 01h. Nothing is done at 00h. The values of P1 to P5 of the Sound Initial (10h) command execute the corresponding process when it is 01H, and are ignored when it is any other value. This command is mainly intended to be set just before issuing a MAP change.
Details of P1 to P5
- The P1 execution instruction (01h) will stop all currently sounding sequences. This does not affect other sounds (PCM stream playback, CD-DA playback).
- The P2 execution instruction (01h) will stop all PCM stream playback currently in progress. This does not affect other sounds (sequence playback, CD-DA playback).
- According to the P3 execution instruction (01h), the direct components [EFSDL] and [EFPAN] of the CD-DA input components [EXTS0] and [EXTS1] are set to "00H" to turn off their output. Masu. Therefore, if the CD-DA input is processed and output using an effect, the volume will not be turned off. This does not affect other sounds (sequence playback, PCM stream playback).
Sound address | 100217H.b ← 00H |
| 100237H.b ← 00H |
- The P4 execution instruction (01h) initializes the DSP section built in the sound source. Actually, set the following data in the DSP register to turn off the output of the effect component and prohibit the DSP from accessing (R/W) the D-RAM. The mixer will also be initialized at this time, but it will be restored. This does not affect other sounds (sequence playback, CD-DA playback, direct components of PCM stream).
[IMXL] | ← 00H |
[EFSDL],[EFPAN] | ← 00H |
[MPRO] | ← 00000000H |
[COEF] | ← 000H |
[TEMP] | ← 000000H |
- According to the execution instruction (01h) of P5, write [EFSDL]=[EFPAN]=0 to all [EFREG] in the mixer section so that the effect components will not be output. This does not affect other sounds (sequence playback, CD-DA playback, direct components of PCM stream).
List ▲ ▼
- ●11H YAMAHA 3D CONTROL YAMAHA 3D sound control
- P1
- Distance (0-127) The distance from the listening point to the virtual sound source for YAMAHA3D sound.
If the value is 0, the distance is 0, and the larger the value, the farther away it is. - P2
- Direction (0-127) This is the direction of the virtual sound source of YAMAHA3D Sound as seen from the listening point.
A value of 0 means 0 degrees to the right, 32 means 90 degrees to the right, 64 means 180 degrees to the right, and 96 means 270 degrees to the right. - P3
- Height (0-127) The height of the virtual sound source of YAMAHA3D Sound as seen from the listening point.
A value of 0 is directly below, 32 is at eye level, 64 is directly above, and 96 is at eye level behind.
List ▲ ▼
- ●12H QSOUND CONTROL Qsound control
- P1
- Channel number (0-7) This is the number of the channel that controls the Q sound.
The maximum number of channels is 8, so specify 0 to 7. - P2
- PAN Position (0-30) Specifies the PAN position of the Q sound. There are 15 steps to the left and right: 0 is 90 degrees to the left, 15 is to the center, and 30 is 90 degrees to the right.
List ▲ ▼
- ●13H YAMAHA 3D INITIALIZE YAMAHA 3D, Qsound localization initialization
- no parameters
List ▲ ▼
- ●14H TEMPO MODE
- P1
- Tempo mode (0/plus/minus) If you change the tempo during sequence playback, conventionally the original tempo will be returned to when the sequence loops. In this version, we have prepared several tempo modes to avoid this.
- 0: Normal mode
- Performs tempo processing as before.
- 1 - 127: ignore mode
- Ignores tempo changes during the sequence. Tempo control is possible using only host commands.
- 128 - 255: Relative tempo mode
- All tempo changes during the sequence will take effect. On the host side, set the relative value for it using the TEMPO RATIO command. The result is just like shifting the tempo changes caused by the sequence using the TEMPO RATIO command.
List ▲ ▼
- ●15H TEMPO RATIO Relative tempo value setting
- P1-P2
- Relative tempo value (+32767 --> -32768) Relative tempo value to the standard tempo value (0000h). The tempo will double every 1000h (4096), and if it is negative, the tempo will be halved. In other words, you can control the time until the tempo doubles (or halves) with 4096 steps of precision. Since 0 is the standard tempo, you can return to the original tempo at any time by specifying 0000h.
List ▲ ▼
- ●80H CD-DA LEVEL Adjust the CD-DA level.
- P1
- CD-DA Level Left 8 levels (00h-E0h) CD-DA output level setting. There are 8 levels, with 00h being the lowest volume (=Off) and E0h being the highest volume.
Off ←−−−−−−−−→ Max
00h,20h,40h,60h,80h,A0h,C0h,E0h |
- P2
- CD-DA Level Right 8 levels (00h-E0h) CD-DA output PAN setting.
Details of 8 stages: (off) 00h,20h,40h,60h,80h,A0h,C0h,E0h (MAX)
CD-DA playback is a method of directly outputting audio data from CD audio tracks using hardware. This is the same principle as a tape recorder, which plays back the recorded audio as it is. The audio data read from the CD is automatically transferred to the SCSP, so all you have to do is set the CD-DA level of the SCSP to start outputting audio.
CD-DA flow
CD-DA playback is performed by reading audio data from the CD drive and setting audio output from SCSP.
To read audio data, use the "CDC library" of the system library. Audio data can be read by calling the following two functions. For details on the CDC library, refer to the CDC library user's manual. To set the audio output from SCSP, use the "CD-DA Level (80h)" and "CD-DA Pan (81h)" commands of the sound control commands. Audio data is transferred directly from the CD interface to SCSP and output as audio. Therefore, the main system only issues a playback request to the CD interface, and there is no need to read data or transfer it to sound memory. This is the least demanding playback method for the main system and sound system, but it will occupy the CD continuously during playback. In other words, you will not be able to access the CD for anything other than producing sound. However, if this is allowed, it will be possible to achieve the maximum quality with this sound system.
The frequency and data width are fixed at 44.1KHz, 16 bits, which is equivalent to the CD standard, and pitch and tempo cannot be changed during playback. At the same time, achieving this quality requires an extremely large amount of audio data, so one CD can only hold about 10 to 20 songs, just like a regular music CD. In reality, it contains game programs, image data, etc., so it can only contain about 5-6 songs.
CD-DA data is PCM audio waveform data itself. Therefore, CD-DA data has the recorded PCM waveform data as it is as a data file. Although it is very large data, it is the simplest audio data that does not require any processing or modification.
CD-DA data can be created using the sound tool waveform editor provided by SEGA or commercially available waveform editing tools. Any tool will do as long as it can output 16-bit stereo PCM data at 44.1KHz. There are two methods: directly digitally recording songs and sound effects, and converting analog audio to digital. In the case of monaural, the same data is entered in Lch and Rch.
CD-DA data format
Data 1 | Lch low(8bit) |
Lch high(8bit) |
Rch low(8bit) |
Rch high(8bit) |
Data 2 | Lch low(8bit) |
Lch high(8bit) |
Rch low(8bit) |
Rch high(8bit) |
: : : : : | : : : : : |
Data n | Lch low(8bit) |
Lch high(8bit) |
Rch low(8bit) |
Rch high(8bit) |
Note 1: The PCM waveform data output by various tools may have the 16-bit Low/High relationship reversed depending on the tool. Generally, it is Low/High for Intel-based CPUs and High/Low for Motorola-based CPUs, so if you are using Motorola-based format, please convert to Intel-based format. It is useful to have a tool that can reverse the low/high data as needed. Note 2: When using DSP (effects) for CD-DA, mixer settings are required. When using DSP, prepare the necessary mixer data and issue the "Mixer Change (87h)" command. Even if there is no sequence playback, tone data is required for mixer settings.
List ▲ ▼
- ●81H CD-DA PAN CD-DA output Panpot settings
- P1
- CD-DA PAN Left 32 levels (0-31)
- P2
- CD-DA PAN Right 32 steps (0-31)
List ▲ ▼
- ●82H TOTAL VOLUME Total volume setting
- P1
- Total Volume 16 levels (0-15) This is the setting for the SCSP's total volume (overall volume for all playbacks). There are 16 levels, with 0 being the lowest volume (=Off) and 15 being the highest volume.
List ▲ ▼
- ●83H EFFECT CHANGE Effect switching
- P1
- Effect bank number (0-15) If there are multiple DSP banks (DSP microprogram storage areas) in the current area map, specify the number of DSP banks from the beginning. One area map can have up to 16 DSP banks, so the value will be between 0 and 15. Always 0 if there is only one DSP bank.
List ▲ ▼
- ●85H START PCM STREAM PCM stream playback starts
- P1
- bit7
0:mono 1:stereo - bit6-5
unused - bit4
0: 16bitPCM 1: 8bitPCM - bit3-0
Start playback PCM stream playback number (0-7) Up to 8 streams can be played at the same time, so specify the PCM stream playback number from 0 to 7. Please note that when playing in stereo, one playback number plays two streams, Lch/Rch. There is a maximum of 8 streams in total for monaural and stereo, so commands will be ignored if there are more than 8 streams. - P2
- bit7-5
Direct sound output level 8 levels (0-7) Direct sound output level setting. There are 8 levels, with 0 being the lowest volume (=Off) and 7 being the highest volume. - bit4-0
Direct sound output PAN 32 levels (0-31) Direct sound output PAN setting. See SEQUENC PAN section on page 13 for details. - P3-P4
- PCM stream buffer start address (0000h-FFFFh) This is the start address of the PCM stream buffer. Specify the upper 16 bits of the 20-bit address.
- P5-P6
- PCM stream buffer size (0000h-FFFFh) Size of PCM stream buffer. Since it is the number of samples for 1 channel, the same value will be entered whether it is MONO, STEREO, 16bit or 8bit.
- P7-P8
- pitch word (0000h-7FFFh) Specify the SCSP pitch register value (16 bits) as is.
Pitch word (16bit) configuration
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|
0 | OCT | 0 | FNS |
OCT: Specify the octave as a two's complement number. You can specify from -8 octave to +7 octave.
FNS: Specify in 1024 steps from the standard pitch (0) to one octave above (1023).
Bit 15 and bit 10 are always 0. - P9
- bit7-3
Effect Input Channel (0-15) [P9=Rch] DSP 16ch Effect In selection. There are 16 channels of DSP effect input, so specify 0 to 15. Please refer to "Chapter 6 Supplementary Information 6-7 DSP and Mixer" for a detailed explanation. - bit2-0
Effect Input Level 8 levels (0-7) Specify the level of the direct sound sent to the effect input channel from 0 to 7. There are 8 levels, with 0 being the lowest level (=Off) and 7 being the highest level. - P10
- bit7-3
Effect input channel (0-15) [P10=Lch] - bit2-0
Effect input level 8 levels (0-7) - P11
- Total level 256 levels (max:00h-FFh:min) This is the total level of the slot used for stream playback. Direct sound You can adjust the volume more finely than the output level.
PCM stream playback is a method of playing back long PCM waveform data by continuously performing the process of playing the PCM waveform data in a loop and writing the next waveform data at the end of the playback. You can play back long PCM waveform data that cannot fit into the sound memory, such as speaking voices, long sound effects, and recorded BGM. You can see which part of the waveform data is currently being played, so you can write the next waveform data to the part that has finished playing. In a case like the one shown below, write the next waveform data in the waveform data A section after waveform data A has finished playing and while waveform data B is being played back. By repeating this process, any long waveform data can be continuously played back.
A, B, A, B, A, B.... will be played in a continuous loop.
Please follow the steps below to play the PCM stream. Also, when stereo, the following processing must be performed for two channels, the left channel and the right channel.
order | process |
---|
1 | Transfer the first waveform data to the waveform data A and waveform data B areas. |
2 | Issue the sound control command "PCM start (85h)". |
3 | After playing waveform data A, transfer the next waveform data to the waveform data A area. |
4 | After playing waveform data B, transfer the next waveform data to the waveform data B area. |
5 | Repeat steps 3 and 4 above |
6 | To terminate, issue the "PCM stop (86h)" sound control command. |
Note: The buffer size, transfer method, transfer timing, etc. are at the discretion of the main system, so please choose the most suitable method according to the situation without being bound by the above steps.
How to hold the data area
To play PCM stream, a data area (PCM stream buffer) is required to play PCM waveform data. The PCM stream buffer can be specified anywhere in sound memory. Normally, areas not used for tone data, song data, etc. are used, but if there is a tone bank etc. that is not used at the same time as PCM stream playback, that area can also be used.
You can know the current playback position in 4K sample units. Therefore, PCM stream playback can be performed by having at least two 4K sample buffers. The PCM stream buffer size can be up to 64K samples per channel, so it can be set freely within this range. Buffer rewriting timing
When PCM stream playback starts, the current waveform playback position is written to the host interface work. The playback position is a number from 0 to 15. The value is 0 at the start of playback, and counts up by 1 each time the 4K sample plays. When playback reaches the end of the buffer, playback starts again from the beginning of the buffer, so the playback position value returns to 0 at this point.
Example of how to hold a buffer | Play position value |
If you have two 4K sample buffers | 0, 1, 0, 1, 0, 1 ... |
If you have three 4K sample buffers | 0, 1, 2, 0, 1, 2, 0, 1, 2 ... |
If you have 16 4K sample buffers | 0, 1, 2, 3 - - - - 12, 13, 14, 15, 0, 1, 2, 3 ... |
The main system should monitor this playback position and transfer the next waveform data. The PCM stream buffer can take up to 64K samples, so you can select from a minimum of 2 sides to a maximum of 16 sides.
It is also possible to generate an interrupt to the main system when the playback position is updated, so please use this if necessary. The control information for this interrupt is included in the system interface work, so please refer to section ``7 System Interface Work'' for the setting details.
Transfer load
Since the PCM playback slot is fixed at 44.1KHz in terms of hardware, one sample will be played every 22.68usec from the start of playback. In other words, once playback begins, each channel must continue to receive 44,100 samples of waveform data per second. 8-bit PCM is 44,100 bytes, 16-bit PCM is 88,200 bytes.
The time required for this transfer, including reading from the CD and transferring to sound memory, is the load on the main system. The transfer time depends on the main system hardware, so it can be calculated using the CD rotation wait, seek time, SH (or DMA) transfer clock, and number of transferred bytes.
However, the above number of bytes is the amount of data at 44.1KHz, so if, for example, you can use half that, 22KHz, the amount of data will be half that, and the transfer load will also be halved. Conversely, when playing stereo or playing multiple channels simultaneously, the load becomes heavier. stereo playback
PCM stream playback can be performed in stereo. Please note that stereo playback uses twice as much memory as monaural playback, as shown below. The buffer size specified in the playback start command parameter is the number of samples for one channel, so actually prepare an area that is twice that size.
Supports playback frequencies other than 44.1KHz
SCSP always plays waveform data at a frequency of 44.1KHz, so if you want to play waveform data at a frequency other than this, use the pitch parameter. For example, if you want to play back half the 22KHz signal, it will be played back at twice the pitch, so if you cut the playback pitch in half and play it back, it will play back at the original pitch. The pitch range is up to ±8 octaves (OCT), and one octave can be further divided into 1024 steps (FNS), so it is possible to correspond to any frequency within this precision range, but in reality, Since no irregular settings are made, they are listed in the correspondence table.
sampling rate | OCT | FNS | Setting value |
44.1kHz | 00 | 0000 | 0000 |
32kHz | 0F | 01CE | 79CE |
22kHz | 0F | 0000 | 7800 |
16kHz | 0E | 01CE | 71CE |
11kHz | 0E | 0000 | 7000 |
8kHz | 0D | 01CE | 69CE |
5.5kHz | 0D | 0000 | 6800 |
4kHz | 0C | 01CE | 61CE |
- Notes on continuous transfer
When transferring waveform data, avoid continuous transfer for a long time to allow the sound CPU to operate. Please note that while the main system is accessing the sound memory, this will take priority and the sound CPU will not be able to operate. If continuous transfer is required, divide it into transfers of about 1 msec at most. By leaving a gap, the sound CPU will be able to operate.
- Precautions when using DSP
Mixer settings are required when using DSP (effects) for PCM stream playback. When using DSP, prepare the necessary mixer data and issue the mixer setting command. Even if there is no sequence playback, tone data is required for mixer settings.
Note: 1 sample is the smallest unit of PCM waveform data, and its size depends on the data width. For 8 bits it is 1 byte, for 16 bits it is 2 bytes. Therefore, a 4K sample would require 4096 bytes for 8-bit PCM and 8192 bytes for 16-bit PCM. Although it is functionally possible to play up to 8 PCM streams, it is practically impossible due to processing power. Stream playback does not run on the sound CPU alone, so we recommend taking the game's processing speed into consideration and experimenting from the early stages of development. Please be especially careful in games that heavily use SH2 for calculations using polygons, as this may cause a frame over.
List ▲ ▼
- ●86H STOP PCM STREAM PCM stream playback stop
- P1
- Stop playback PCM stream playback number (0-7)
List ▲ ▼
- ●87H MIXER CHANGE Switching the mixer
- P1
- Tone data bank number (0-15) If there are multiple tone banks (tone data storage areas) in the current area map, this is a number to distinguish between them. One area map can have up to 16 tone banks, so the value will be anywhere from 0 to 15. (Refer to 5-1-4 Sound Area Map CRNT Work Map Information).
- P2
- Mixer number in tone data (0-127) Multiple mixer data can be stored in one tone data, so specify the number of mixer data from the beginning of the tone data. One tone data can store up to 128 mixers, so the value will be any value from 0 to 127. Always 0 if there is only one mixer data.
What is a mixer?
A mixer is a piece of hardware that balances the volume and localization (distribution to left and right) of an SCSP sound source. There are only two types of sound sources: sound generation slots and digital audio input, but each can be passed through DSP, so the mixer can be divided into the following four types of mixer blocks. Mixer configuration
- Slot Direct mixer
- : Direct (does not pass through DSP) output level and PAN from sound slot
- CD-DA Direct mixer
- : Direct (does not pass through DSP) output level and PAN from CD-DA
- Effect In mixer
- : Input level to DSP
- Effect Out mixer
- : Effects from DSP (through DSP) output level and PAN
Of these, the "Slot Direct mixer" and "Effect In mixer" are already set in the tone data, so there is no need to control them specially. Also, for the "CD-DA Direct mixer", dedicated "CD-DA Level (80h)" and "CD-DA Pan (81h)" commands are available, so you can control them using them.
Therefore, when we say "mixer" in this manual, we specifically mean the "Effect Out mixer" mentioned above. In this manual, the mixer refers to the 16ch effect level and PAN settings output from the DSP.
DSP and mixer
The mixer is the output setting for the sound from the DSP. Therefore, even if the effect processing is working properly and the effect is applied correctly, the effect sound will not be output unless the correct mixer is set. The mixer is data that sets the volume and localization for 16 DSP output channels, and is created by the sound creator as part of the tone data. In addition, since all sounds from sequence playback, PCM stream playback, and CD-DA playback are input to the DSP, it is important to correctly understand which sound is going into which channel and which channel is going out in which situation. must be controlled above. When switching effects, check in advance which mixer is compatible and what the mixer specifications are.
Note that bank selection is not possible when using MIDI control changes to make mixer settings. This is because, due to the MIDI format, two arguments, the bank and mixer number, cannot be sent at the same time. Therefore, only the mixer number will be sent, but the bank at that time will be the bank selected by bank change.
List ▲ ▼
- ●88H MIXER PARAMETER CHANGE Switching mixer parameters
- P1
- Effect Output Channel (0-17) DSP 16ch Effect Out selection. There are 16 channels of DSP effect output, so specify 0 to 15. Also, when selecting CD-DA, specify 16 (Lch) or 17 (Rch).
- P2
- bit7-5
Effect Output Level 8 levels (0-7) Specify the level of the effect sound output from the effect output channel from 0 to 7. There are 8 levels, with 0 being the lowest level (=Off) and 7 being the highest level. - bit4-0
Effect Output PAN 32 levels (0-31) Specify the PAN of the effect sound output from the effect output channel from 0 to 31. For details, refer to "Chapter 7 Appendix 7-2 Details of SCSP PAN (32 levels)".
List ▲ ▼
- ●89H HARDWARE CHECKHardware check
- P1
- Check item
- 00h: DRAM 4Mbit read/write
- 01h: DRAM 8Mbit read/write
- 02h: SCSP MIDI
- 03h: Sound source output (L/R)
- 04h: Sound source output (L)
- 05h: Sound source output (R)
The details of the check performed by the hard check (89h) command are as follows. When checking, specify a value from 0 to 5 in command parameter P1, and the following checks will be performed depending on that value. The following values for all check results are stored in the system interface table (address 418h: word).
7FFFH:Memory check Error
8000H: Memory check OK
00h | Executes read/write check of sound D-RAM (4M bits). Please note that at this time, the DSP will be initialized to prohibit internal memory access.
The check will write & read & compare all bits low/high, and the result will be stored in the system interface table. |
01h | Executes read/write check of sound D-RAM (8M bits). Others are as above. |
02h | Executes an operation check of the SCSP built-in MIDI. At this time, short-circuit the external MIDI input/output terminals. The check results are as above. |
03h | A square wave is output from LR. Please note that SCSP slot 025B00000H will be forcibly used at this time. This sound will also turn off automatically in a few seconds. Also, no map data, song data, or tone data is required when issuing this command. |
04h | A square wave is output only from the L side. Others are as above. |
05h | Value of P1 |
List ▲ ▼
- ●8AH PCM PARAMETER CHANGE Parameter switching for PCM stream during playback
- P1
- PCM stream playback number (0-7)
- P2
- bit7-5
Direct sound output level 8 levels (0-7) - bit4-0
Direct sound output PAN 32 levels (0-31) - P3-P4
- pitch word(0000h-FFFFh)
- P5
- bit7-3
Effect input channel (0-15) [P5=Rch] - bit2-0
Effect input level 8 levels (0-7) - P6
- bit7-3
Effect input channel (0-15) [P6=Lch] - bit2-0
Effect input level 8 levels (0-7) - P7
- Total level 256 levels (max:00h-FFh:min)
List ▲ ▼
- ●8BH PCM SLOT ALLOCATION Secure slot for PCM stream
- P1
- PCM stream playback number (0-7)
PCM streams use fixed slots, but those slots may be in use during sequence playback, and if you start a PCM stream, part of the sequence will be forcibly turned off. If you reserve a PCM slot in advance using this command, the above problem will be resolved.
List ▲ ■
- ●8CH PCM SLOT RELEASE Release slot for PCM stream
- P1
- PCM stream playback number (0-7)
Frees the reserved slot so that it can be used for sequence playback.
▲ Back | Forward ▼
★ SOUND Manual ★ Sound Driver Programmer's Guide
Copyright SEGA ENTERPRISES, LTD., 1997