FM: Difference between revisions
Jump to navigation
Jump to search
(Created page with "The FM part has '''4 channels''', each having their own operators, panning and amplitude values. It's the most used way of producing music in games. See YM2610 registers#FM...") |
No edit summary |
||
Line 1: | Line 1: | ||
The FM part | The FM ('''F'''requency '''M'''odulation) is part of the {{Chipname|YM2610}} sound chip. It provides '''4 channels''', each having their own set of 4 operators, panning and amplitude values. It's the most used way of producing music in games. | ||
It's the most used way of producing music in games. | |||
=Common registers= | |||
{|class="wikitable" | |||
!Address (Z80 port 4) | |||
!Data (Z80 port 5) | |||
| | |||
|- | |||
|$22 | |||
|{{8BitRegister|-|4|On|1|Control|3}} | |||
| LFO control and frequency (see below). | |||
|- | |||
|$28 | |||
|{{8BitRegister|Slot|4|-|1|Channel|3|}} | |||
| Key On/Off for each channel. | |||
|} | |||
LFO frequency values are as follows: | |||
*0 – 3.98Hz | |||
*1 – 5.56Hz | |||
*2 – 6.02Hz | |||
*3 – 6.37Hz | |||
*4 – 6.88Hz | |||
*5 – 9.63Hz | |||
*6 – 48.1Hz | |||
*7 – 72.2Hz | |||
Channel numbering: 1, 2, 4, 5 instead of 1, 2, 3, 4 ? | |||
=Channel registers= | |||
Depending on which channel you want to write to, the {{Chipname|Z80}} ports used are different: | |||
* Channels 1 & 2: Ports 4/5 | |||
* Channels 3 & 4: Ports 6/7 | |||
{|class="wikitable" | |||
!colspan=4|Address||colspan=4|Data||rowspan=3| | |||
|- | |||
|CH1||CH2||CH3||CH4||CH1||CH2||CH3||CH4 | |||
|- | |||
|colspan=2|Port 4||colspan=2|Port 6||colspan=2|Port 5||colspan=2|Port 7 | |||
|- | |||
|$A1||$A2||$A1||$A2 | |||
|colspan=4|{{8BitRegister|F-Num 1|8}} | |||
|F-Numbers and Block (1/2) | |||
|- | |||
|$A5||$A6||$A5||$A6 | |||
|colspan=4|{{8BitRegister|-|2|Block|3|F-Num 2|3}} | |||
|F-Numbers and Block (2/2)<br/>(must set this first) | |||
|- | |||
|$A9||$AA||$A9||$AA | |||
|colspan=4|{{8BitRegister|2CH * F-Num 1|8}} | |||
|2CH - 2 Slot F-Numbers/Block (1/2) | |||
|- | |||
|$AD||$AE||$AD||$AE | |||
|colspan=4|{{8BitRegister|-|2|2CH * Block|3|2CH * F-Num 2|3}} | |||
|2CH - 2 Slot F-Numbers/Block (1/2)<br/>(must set this first) | |||
|- | |||
|$B1||$B2||$B1||$B2 | |||
|colspan=4|{{8BitRegister|-|2|FB|3|ALGO|3}} | |||
|Feedback (FB) and Algorithm (ALGO) | |||
|- | |||
|$B5||$B6||$B5||$B6 | |||
|colspan=4|{{8BitRegister|L|1|R|1|AMS|2|-|1|PMS|3}} | |||
|Left (L)/Right (R) output, AM Sense (AMS), and PM Sense (PMS) | |||
|} | |||
=Operator registers= | |||
The ranges given for the address represent all of the parameter values. Each channel's operators are laid out as follows: | |||
{|class="wikitable" | |||
! Operator || 1 || 2 || 3 || 4 | |||
|- | |||
! Channels 1, 3 | |||
| $x1 || $x5 || $x9 || $xD | |||
|- | |||
! Channels 2, 4 | |||
| $x2 || $x6 || $xA || $xE | |||
|} | |||
{|class="wikitable" | |||
!colspan=4|Address||colspan=4|Data||rowspan=3| | |||
|- | |||
|CH1||CH2||CH3||CH4||CH1||CH2||CH3||CH4 | |||
|- | |||
|colspan=2|Port 4||colspan=2|Port 6||colspan=2|Port 5||colspan=2|Port 7 | |||
|- | |||
|colspan=4|$31-$3E | |||
|colspan=4|{{8BitRegister|-|1|DT|3|MUL|4}} | |||
|Detune (DT) and Multiple (MUL) | |||
|- | |||
|colspan=4|$41-$4E | |||
|colspan=4|{{8BitRegister|-|1|Total Level|7|}} | |||
|Total Level (Volume) | |||
|- | |||
|colspan=4|$51-$5E | |||
|colspan=4|{{8BitRegister|KS|2|-|1|AR|5}} | |||
|Key Scale (KS) and Attack Rate (AR) | |||
|- | |||
|colspan=4|$61-$6E | |||
|colspan=4|{{8BitRegister|AM|1|-|2|DR|5}} | |||
|AM On (AM) and Decay Rate (DR) | |||
|- | |||
|colspan=4|$71-$7E | |||
|colspan=4|{{8BitRegister|-|3|SR|5}} | |||
|Sustain Rate (SR) | |||
|- | |||
|colspan=4|$81-$8E | |||
|colspan=4|{{8BitRegister|SL|4|RR|4}} | |||
|Sustain Level (SL) and Release Rate (RR) | |||
|- | |||
|colspan=4|$91-$9E | |||
|colspan=4|{{8BitRegister|-|4|SSG-EG|4}} | |||
|Envelope generator (not to be confused with the [[SSG]] one) | |||
|} | |||
[[Category:Audio system]] | [[Category:Audio system]] |
Revision as of 09:59, 18 February 2017
The FM (Frequency Modulation) is part of the YM2610 sound chip. It provides 4 channels, each having their own set of 4 operators, panning and amplitude values. It's the most used way of producing music in games.
Common registers
Address (Z80 port 4) | Data (Z80 port 5) | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
$22 |
|
LFO control and frequency (see below). | ||||||||||||||||||
$28 |
|
Key On/Off for each channel. |
LFO frequency values are as follows:
- 0 – 3.98Hz
- 1 – 5.56Hz
- 2 – 6.02Hz
- 3 – 6.37Hz
- 4 – 6.88Hz
- 5 – 9.63Hz
- 6 – 48.1Hz
- 7 – 72.2Hz
Channel numbering: 1, 2, 4, 5 instead of 1, 2, 3, 4 ?
Channel registers
Depending on which channel you want to write to, the Z80 ports used are different:
- Channels 1 & 2: Ports 4/5
- Channels 3 & 4: Ports 6/7
Address | Data | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CH1 | CH2 | CH3 | CH4 | CH1 | CH2 | CH3 | CH4 | |||||||||||||||||||
Port 4 | Port 6 | Port 5 | Port 7 | |||||||||||||||||||||||
$A1 | $A2 | $A1 | $A2 |
|
F-Numbers and Block (1/2) | |||||||||||||||||||||
$A5 | $A6 | $A5 | $A6 |
|
F-Numbers and Block (2/2) (must set this first) | |||||||||||||||||||||
$A9 | $AA | $A9 | $AA |
|
2CH - 2 Slot F-Numbers/Block (1/2) | |||||||||||||||||||||
$AD | $AE | $AD | $AE |
|
2CH - 2 Slot F-Numbers/Block (1/2) (must set this first) | |||||||||||||||||||||
$B1 | $B2 | $B1 | $B2 |
|
Feedback (FB) and Algorithm (ALGO) | |||||||||||||||||||||
$B5 | $B6 | $B5 | $B6 |
|
Left (L)/Right (R) output, AM Sense (AMS), and PM Sense (PMS) |
Operator registers
The ranges given for the address represent all of the parameter values. Each channel's operators are laid out as follows:
Operator | 1 | 2 | 3 | 4 |
---|---|---|---|---|
Channels 1, 3 | $x1 | $x5 | $x9 | $xD |
Channels 2, 4 | $x2 | $x6 | $xA | $xE |
Address | Data | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CH1 | CH2 | CH3 | CH4 | CH1 | CH2 | CH3 | CH4 | |||||||||||||||||||
Port 4 | Port 6 | Port 5 | Port 7 | |||||||||||||||||||||||
$31-$3E |
|
Detune (DT) and Multiple (MUL) | ||||||||||||||||||||||||
$41-$4E |
|
Total Level (Volume) | ||||||||||||||||||||||||
$51-$5E |
|
Key Scale (KS) and Attack Rate (AR) | ||||||||||||||||||||||||
$61-$6E |
|
AM On (AM) and Decay Rate (DR) | ||||||||||||||||||||||||
$71-$7E |
|
Sustain Rate (SR) | ||||||||||||||||||||||||
$81-$8E |
|
Sustain Level (SL) and Release Rate (RR) | ||||||||||||||||||||||||
$91-$9E |
|
Envelope generator (not to be confused with the SSG one) |