SSG: Difference between revisions
m (Move from YM2610 page) |
m (Moved registers, note about mixing) |
||
Line 2: | Line 2: | ||
Given its limited capacities, the SSG is more often used for simple sound effects (coin sound, cursors in menus...) rather than music. | Given its limited capacities, the SSG is more often used for simple sound effects (coin sound, cursors in menus...) rather than music. | ||
=Envelope generator= | =Envelope generator= | ||
Line 24: | Line 18: | ||
Envelope frequency = 8M / 2 / (256 * value) | Envelope frequency = 8M / 2 / (256 * value) | ||
Note that each period is | Note that each period is 32 analog steps (5-bit internal counter). | ||
=Synthesis= | =Synthesis= | ||
Line 30: | Line 24: | ||
If the '''Mode''' bit in the volume registers is 1, the EG's output is used instead of the fixed 4 bit value. | If the '''Mode''' bit in the volume registers is 1, the EG's output is used instead of the fixed 4 bit value. | ||
Tone frequency = [[clock|8M]] / 2 / (16 * (Coarse * 256 + Fine)) = | Tone frequency = [[clock|8M]] / 2 / (16 * (Coarse * 256 + Fine)) = 250000 / value | ||
Example: Note A4 (440Hz) would be 250000 / 440 =~ 568 = $238. | |||
Each channel is an AND (?) sum of both the channel's tone generator (if enabled) and the unique noise generator (if enabled). | |||
=Registers= | |||
Note that the YM2149 I/O registers $E and $F were removed in the YM2610. | |||
{| class="regdef" | |||
|'''Address ([[Z80]] port 4)''' | |||
|'''Data ([[Z80]] port 5)''' | |||
| | |||
|- | |||
|$00 | |||
|{{8BitRegister|Fine tune|8}} | |||
|rowspan="2"|Channel A | |||
|- | |||
|$01 | |||
|{{8BitRegister|-|4|Coarse tune|4}} | |||
|- | |||
|$02 | |||
|{{8BitRegister|Fine tune|8}} | |||
|rowspan="2"|Channel B | |||
|- | |||
|$03 | |||
|{{8BitRegister|-|4|Coarse tune|4}} | |||
|- | |||
|$04 | |||
|{{8BitRegister|Fine tune|8}} | |||
|rowspan="2"|Channel C | |||
|- | |||
|$05 | |||
|{{8BitRegister|-|4|Coarse tune|4}} | |||
|- | |||
|$06 | |||
|{{8BitRegister|-|3|Noise tune|5}} | |||
|Noise channel | |||
|- | |||
|$07 | |||
|{{8BitRegister|-|2|/EN noise C|1|/EN noise B|1|/EN noise A|1|/EN tone C|1|/EN tone B|1|/EN tone A|1}} | |||
|Negative enable flags for mixing | |||
|- | |||
|$08 | |||
|{{8BitRegister|-|3|Mode|1|Volume|4}} | |||
|Channel A | |||
|- | |||
|$09 | |||
|{{8BitRegister|-|3|Mode|1|Volume|4}} | |||
|Channel B | |||
|- | |||
|$0A | |||
|{{8BitRegister|-|3|Mode|1|Volume|4}} | |||
|Channel C | |||
|- | |||
|$0B | |||
|{{8BitRegister|Volume envelope period fine tune|8}} | |||
| | |||
|- | |||
|$0C | |||
|{{8BitRegister|Volume envelope period coarse tune|8}} | |||
| | |||
|- | |||
|$0D | |||
|{{8BitRegister|-|4|Volume envelope shape|4}} | |||
|See diagram. | |||
|} | |||
[[Category:Audio system]] | [[Category:Audio system]] |
Latest revision as of 18:47, 11 February 2017
The SSG (Software-controlled Sound Generator as Yamaha calls it) is part of the YM2610 sound chip. It provides 3 square wave channels and 1 LFSR noise channel. It is very closely related to the Atari ST's [YM2149].
Given its limited capacities, the SSG is more often used for simple sound effects (coin sound, cursors in menus...) rather than music.
Envelope generator
The Envelope generator (EG) is an unique low-frequency signal generator which can be used to modulate the output of the tone channels.
Envelope shape register ($0D):
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Def | - | CONT | ATT | ALT | HOLD |
- CONT: Should always be 1 ?
- ATT: Counter direction (0:Down, 1:Up)
- ALT: Alternate direction each period
- HOLD: Hold value after first period (depends on ALT)
Envelope frequency = 8M / 2 / (256 * value)
Note that each period is 32 analog steps (5-bit internal counter).
Synthesis
If the Mode bit in the volume registers is 1, the EG's output is used instead of the fixed 4 bit value.
Tone frequency = 8M / 2 / (16 * (Coarse * 256 + Fine)) = 250000 / value
Example: Note A4 (440Hz) would be 250000 / 440 =~ 568 = $238.
Each channel is an AND (?) sum of both the channel's tone generator (if enabled) and the unique noise generator (if enabled).
Registers
Note that the YM2149 I/O registers $E and $F were removed in the YM2610.
Address (Z80 port 4) | Data (Z80 port 5) | |||||||||||||||||||
$00 |
|
Channel A | ||||||||||||||||||
$01 |
| |||||||||||||||||||
$02 |
|
Channel B | ||||||||||||||||||
$03 |
| |||||||||||||||||||
$04 |
|
Channel C | ||||||||||||||||||
$05 |
| |||||||||||||||||||
$06 |
|
Noise channel | ||||||||||||||||||
$07 |
|
Negative enable flags for mixing | ||||||||||||||||||
$08 |
|
Channel A | ||||||||||||||||||
$09 |
|
Channel B | ||||||||||||||||||
$0A |
|
Channel C | ||||||||||||||||||
$0B |
|
|||||||||||||||||||
$0C |
|
|||||||||||||||||||
$0D |
|
See diagram. |