-
Notifications
You must be signed in to change notification settings - Fork 10
/
YM2609.txt
560 lines (520 loc) · 31.6 KB
/
YM2609.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
Virtual Instrument YM2609(Register Map)
Port 0 Port 1 Port 2 Port 3
__________________ __________________ __________________ __________________
$00 | SSG1 | $00 | ADPCM1 | $00 | SSG3 | $00 | ADPCM2 |
| | | | | | | |
$0F |__________________| $10 |__________________| $0F |__________________| $10 |__________________|
$10 | Rhythm | $11 | ADPCM-A | $10 | SSG4 | $11 | ADPCM3 |
| | | | | | | |
$1F |__________________| $17 |__________________| $1F |__________________| $21 |__________________|
$20 | FM | $20 | SSG2 | $20 | FM | $22 |Sys:Rev.Dep |
| (Common) | | | | (Common) | |Ins:Rev.Sl,Dis,Cho|
$2F |__________________| $2F |__________________| $2F |__________________| $2B |__________________|
$30 | FM | $30 | FM | $30 | FM | $30 | FM |
| (CH1-CH3) | | (CH4-CH6) | | (CH7-CH9) | | (CH10-CH12) |
$B6 |__________________| $B6 |__________________| $B6 |__________________| $B6 |__________________|
$C0 | Sys.Effect | $C0 | Sys.Effect | $C0 | Ins.Effect |
| 3 Band EQ | | Compressor | | HPF LPF |
$CB |__________________| $C6 |__________________| $C5 |__________________|
$CC | Reverse Phase | $C6 | Ins.Effect |
| | | Compressor |
$D8 |__________________| $CC |__________________|
Read/Write Data(SSG1:0.$00 SSG2:1.$20 SSG3:2.$00 SSG4:2.$20)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ __________________________________________________ _______________________
| |
+00 | Fine Tune |
|__________________________________________________| Channel-A Tone Period
| | | / Duty cycle
+01 | Duty cycle | Coarse Tune |
____ |________________________|_________________________| _______________________
| |
+02 | Fine Tune |
|__________________________________________________| Channel-B Tone Period
| | | / Duty cycle
+03 | Duty cycle | Coarse Tune |
____ |________________________|_________________________| _______________________
| |
+04 | Fine Tune |
|__________________________________________________| Channel-C Tone Period
| | | / Duty cycle
+05 | Duty cycle | Coarse Tune |
____ |________________________|_________________________| _______________________
| | |
+06 |=================| Period Control | Noise Period
____ |_________________|________________________________| _______________________
| | | |
+07 |===========| /Noise | /Tone | /Enable
____ |___________|___________________|__________________| _______________________
| | | | | |
+08 | L | R |PHRST| M | Level | Channel-A Amplitude / Phase reset / Panpot
|_____|_____|_____|______|_________________________|
| | | | | |
+09 | L | R |PHRST| M | Level | Channel-B Amplitude / Phase reset / Panpot
|_____|_____|_____|______|_________________________|
| | | | | |
+0A | L | R |PHRST| M | Level | Channel-C Amplitude / Phase reset / Panpot
____ |_____|_____|_____|______|_________________________| _______________________
| |
+0B | Fine Tune |
|__________________________________________________| Envelop Period
| |
+0C | Coarse tune |
____ |__________________________________________________| _______________________
| | | | | | |
+0D | RST | User def.#(0 ~ 5) | CON | ATT | ALT | HLD | Envelop Shape Cycle
____ |_____|___________________|_____|_____|_____|______| _______________________
| |
+0E | Wave Data | Define Wave data
____ |__________________________________________________| _______________________
| | | |
+0F | Ch.(0~2) | Left Mul(0~7) | Right Mul(0~7) | Channel:2bit Left:3bit Right:3bit
____ |___________|___________________|__________________| _______________________
Duty cycle
7:1/8 6:2/8 5:3/8 4:4/8 3:5/8 2:6/8 1:7/8 duty. 0:8/8 Pure square wave.
8:Triangle Wave 9:Saw Wave 10,11,12,13,14,15:user0 ~ user5
L/R panpot
0:LR Enable 1:R Enable 2:L Enable 3:LR Enable
L(M)ul
Left Panpot Multiple 0:x1.0 1:x0.875 2:x0.750 3:x0.625 4:x0.500 5:x0.375 6:x0.250 7:x0.125
R(M)ul
Right Panpot Multiple 0:x1.0 1:x0.875 2:x0.750 3:x0.625 4:x0.500 5:x0.375 6:x0.250 7:x0.125
User define wave form(0x0E)
RST : reset setting position
User def.# : user define wave number 0 ~ 5 (select duty cycle 10~15)
Wave Data : 0 ~ 15 (Write 64 times)
ex) set user0 wave form
0x80 0x01 0x02 ... 0x0f ( 64 data )
ADPCM1:1.$00 ADPCM2:3.$00 ADPCM3:3.$11
ADDRESS REGISTER
____ ____________________
| |
+00 | CONTROL 1 |
____ |____________________|
| |
+01 | CONTROL 2 |
____ |____________________|
| |
+02 | START ADR (L) |
____ |____________________|
| |
+03 | START ADR (H) |
____ |____________________|
| |
+04 | END ADR (L) |
____ |____________________|
| |
+05 | END ADR (H) |
____ |____________________|
| |
+06 | PRESCAL (L) |
____ |____________________|
| | | | |
+07 |L(M)|R(M)|=|PRSCL(H)| L(Mul):2bit R(Mul):2bit PRESCAL(H):3bit
____ |____|____|_|________|
| |
+08 | ADPCM-DATA |
____ |____________________|
| |
+09 | DELTA-N (L) |
____ |____________________|
| |
+0A | DELTA-N (H) |
____ |____________________|
| |
+0B | EG CONTROL |
____ |____________________|
| |
+0C | LIMIT ADR (L) |
____ |____________________|
| |
+0D | LIMIT ADR (H) |
____ |____________________|
| |
+0E | DAC DATA |
____ |____________________|
| |
+0F | (PCM DATA) |
____ |____________________|
| |
+10 | FLAG CONTROL |
____ |____________________|
Extend Memory Capacity
ADPCM1:256Kbyte
ADPCM2,3:16Mbyte
Write Data (FM)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ ________________________________ __________________________
| |
21 | Test | LSI Test Data(non impl)
|________________________________| __________________________
| | |
22 |================| LFO | LFO Freq Control
|________________|_______________| __________________________
| |
24 | Timer-A | Timer-A upper 8 bits
|________________________________| __________________________
| | |
25 |=======================|Timer-A | Timer-A lower 2 bits
|_______________________|________| __________________________
| |
26 | Timer-B | Timer-B Data
|________________________________| __________________________
| | | | |
| Mode | Reset | Enable | Load | Timer-A/B Control and
27 | | B A | B A | B A | 2 CH Mode
|________|_______|________|______| __________________________
| | | |
28 | Slot |===| CH | Key-ON/OFF
|________________|___|___________| __________________________
| |
29 | STATUS Mask |
|________________________________| __________________________
| |
2A |================================|
|________________________________| __________________________
| | | | |
2B | Wave Write Ch |DIC|WRst|WavTyp| WaveWriteCh(0-11) / set DICtionary mode / Wave Reset / Wave Type(0-3)
|________________|___|____|______| __________________________
| |
2C | Wave data(L/H) / dicNum | Write Wave data( 1024 * 2 count (L:8bit H:5bit)) / dicNum(8bit)
|________________________________| __________________________
| |
2D-2F | Prescaler | Prescaler
|________________________________| __________________________
| | | |
30-3E |WT L| DT1 | MULTI | Wave Type(L)/Detune/Multiple
|____|___________|_______________| __________________________
| | |
40-4E |WT H| TL | Wave Type(H)/Total Level
|____|___________________________| __________________________
| | | |
50-5E | KS |PRS| AR | Key Scale/Phase reset/Attack Rate
|________|___|___________________| __________________________
| | | |
60-6E | AM | DT2 | DR | AMON/DT2/Decay Rate
|____|_______|___________________| __________________________
| | |
70-7E | FB | SR | SelfFeedback(2OP-4OP)/Sustain Rate
|____________|___________________| __________________________
| | |
80-8E | SL | RR | Sustain Level/Release Rate
|________________|_______________| __________________________
| | |
90-9E | ALG Link | SSG-EG | ALG Link /SSG-Type Envelop Control
|________________|_______________| __________________________
| |
A0-A2 | F-Num 1 |
|________________________________| F-Numbers/Block
| | | |
A4-A6 | L(M) | Block | F-Num 2 |
|________|___________|___________| __________________________
| |
A8-AA | 3 CH * F-Num 1 |
|________________________________| 3 CH
| | | | F-Numbers/Block
AC-AE |========| 3CH*Block | 3CH*F-Num2| L(M)ul
|________|___________|___________| __________________________
| | | |
B0-B2 | R(M) | FB | ALG | R(M)ul/Self Feedback/Alg
|________|___________|___________| __________________________
| | | | | |
B4-B6 | L | R | AMS | AC| PMS | LR /AMS /AlgConstSw /PMS
|____|___|_______|___|___________| __________________________
DT2
OPM's DT2 Compatible
FB
OP2 - OP4's Self feed back
ALG Link bit3:Op4 bit2:Op3 bit1:Op2 bit0:Op1
ALG Construction Switch = 1.
It set Link parent Op bits.
Self number is Carrier.
L(M)ul
Left Panpot Multiple 0:x1.0 1:x0.75 2:x0.5 3:x0.25
R(M)ul
Right Panpot Multiple 0:x1.0 1:x0.75 2:x0.5 3:x0.25
AC
ALG Construction Switch.
s = Wave data
s : Range 0 ... 8191
実際(j) : -4095 ... +4095
jからsを算出するには↓
s = ( 4095 - abs( j ) ) * 2 + ( j < 0 ? 1 : 0 )
sからjを算出するには↓
j = ( s % 2 == 0 ? 1 : -1 ) * ( 4095 - abs( s / 2 ) )
wave tableの配列の大きさは1024
データは8bit(low) 5bit(high)の順で送信するため 1024 * 2 = 2048 回送信する必要がある
以上から
1. ユーザーは-4095~+4095のデータを1024個用意する必要がある
2. アプリケーションはユーザーの用意したデータjからsを算出後
2回に分けてデータを送信する
MDSound(YM2609)はそれを受け取りwave tableに設定する
channel毎に4つwave tableを定義できる
12ch * 4 * 2048 = 98304 byte
Write Data(Rhythm:0.$10-$1F)
OPNAのレジスタマップとコンパチブル
Write Data(ADPCM-A:1.$11-$17)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ __________________________________________________ _______________________
| | | |
11 | DM |=====| KEY ON |
|_____|_____|______________________________________|
| | |
12 |===========| Total Volume |
|___________|______________________________________|
| | | 0~5(Def:0)
13 |==============================| Select Ch | $14-$17のパラメータの対象となるチャンネル番号を送る
|______________________________|___________________|
| | |
14 |=================| Volume |
|_________________|________________________________|
| | | | | |
15 | L | L(M) | R | R(M) |==============| Lswitch LMul Rswitch RMul
|_____|___________|_____|___________|______________|
| |
16 | Start Address (L,H) | 開始アドレスをLSB,HSBの順で送る
|__________________________________________________|
| |
17 | End Address (L,H) | 終了アドレスをLSB,HSBの順で送る
_____ |__________________________________________________| _______________________
Write Data(Effect:3.$22-$2B / 3.$C0-$C5)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ __________________________________________________ _______________________
| | |
22 |=====| Reverb Delta | 0-127(Def:64(0.5秒)) 1/128 * n 秒をセット
|_____|____________________________________________|
| | | | 0-36(Def:0) 設定をするチャンネルです。Rev&Dis&Cho&HPFLPF兼用
23 |AlRst|=====| Current Channel | 0-11:FM 12-23:SSG 24-26:ADPCM 27-32:Rhythm 33-38:ADPCM-A
|_____|_____|______________________________________| AlRst:All reset
| | | 0-15(Def:0)SendLevelを送るときは
24 |========================| Reverb Send Level | Send Ch.でセットしたいチャンネル番号を送る
____ |________________________|_________________________| _______________________
| | | 0-1(Def:0)ディストーションのスイッチです。
25 |D.Sw | Distortion OutputLevel | 0-127(Def:32)ディストーションの音量です。
|_____|____________________________________________| 物凄く大きな音がでるので32以上は注意です。
| | | 0-127(Def:64)ディストーションのゲインです。
26 |=====| Distortion Gain |
|_____|____________________________________________|
| | | 0-127(Def:64)ディストーションに使用するハ
27 |=====| Distortion CutOffFrq | イパスフィルターのカットオフ周波数です。
____ |_____|____________________________________________| _______________________
| | | 0-1(Def:0)コーラスのスイッチです。
28 |C.Sw | Chorus MixLevel | 0-127(Def:40)コーラスのかかり具合です。
|_____|____________________________________________|
| | | 0-127(Def:24)コーラスの揺らぎの間隔です。
29 |=====| Chorus rate |
|_____|____________________________________________|
| | | 0-127(Def:3)コーラスの揺らぎの深さです。
2A |=====| Chorus depth |
|_____|____________________________________________| _______________________
| | | 0-127(Def:40)コーラスのフィードバック量です。
2B |=====| Chorus feedback |
____ |_____|____________________________________________| _______________________
| |
C0 | LPF Sw | 0-1(Def:0) 0:off 1:on
|__________________________________________________|
| |
C1 | LPF Freq | 0-255(Def:126) 1 ~ 38500Hz
|__________________________________________________|
| |
C2 | LPF Q | 0-255(Def:67) 0.1 ~ 20.0
____ |__________________________________________________| _______________________
| |
C3 | HPF Sw | 0-1(Def:0) 0:off 1:on
|__________________________________________________|
| |
C4 | HPF Freq | 0-255(Def:126) 1 ~ 38500Hz
|__________________________________________________|
| |
C5 | HPF Q | 0-255(Def:67) 0.1 ~ 20.0
____ |__________________________________________________| _______________________
Write Data(System Effect(3 band EQ):0.$C0-$CB)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ __________________________________________________ _______________________
| |
C0 | low switch | 0-1(Def:0) 0:off 1:on
|__________________________________________________|
| |
C1 | low freq | 0-255(Def:126) 1 ~ 38500Hz
|__________________________________________________|
| |
C2 | low gain | 0-255(Def:141) -20 ~ +19.84375
|__________________________________________________|
| |
C3 | low Q | 0-255(Def:67) 0.1 ~ 20.0
____ |__________________________________________________| _______________________
| |
C4 | mid switch | 0-1(Def:0) 0:off 1:on
|__________________________________________________|
| |
C5 | mid freq | 0-255(Def:162) 1 ~ 38500Hz
|__________________________________________________|
| |
C6 | mid gain | 0-255(Def:102) -20 ~ +19.84375
|__________________________________________________|
| |
C7 | mid Q | 0-255(Def:67) 0.1 ~ 20.0
____ |__________________________________________________| _______________________
| |
C8 | high switch | 0-1(Def:0) 0:off 1:on
|__________________________________________________|
| |
C9 | high freq | 0-255(Def:192) 1 ~ 38500Hz
|__________________________________________________|
| |
CA | high gain | 0-255(Def:154) -20 ~ +19.84375
|__________________________________________________|
| |
CB | high Q | 0-255(Def:67) 0.1 ~ 20.0
____ |__________________________________________________| _______________________
Write Data(System Effect(Compressor):1.$C0-$C6)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ __________________________________________________ _______________________
| | | 0-1 Comp.Sw. (Def:0)
C0 |C.Sw | Volume | 0-127 Comp.Vol.(Def:0)
|_____|____________________________________________|
| |
C1 | threshold | 0-255: 0.1 - 1.0
|__________________________________________________|
| |
C2 | ratio | 0-255: 2.0 - 10.0
____ |__________________________________________________| _______________________
| |
C3 | envelope Freq | 0-255: 0.19 - 50 (Hz)
|__________________________________________________|
| |
C4 | envelope Q | 0-255: 0-21
____ |__________________________________________________| _______________________
| |
C5 | gain Freq | 0-255: 0.19 - 50 (Hz)
|__________________________________________________|
| |
C6 | gain Q | 0-255: 0 - 21
____ |__________________________________________________| _______________________
Tables
Freq Table (LPF / HPF / EQ low / EQ mid / EQ high)
0 : 1 Hz
1 : 2 Hz
... (+1Hz)
94 : 95 Hz
95 : 96 Hz
96 : 100 Hz
97 : 110 Hz
... (+10Hz)
158 : 720 Hz
159 : 730 Hz
160 : 800 Hz
161 : 900 Hz
... (+100Hz)
222 : 7000 Hz
223 : 7100 Hz
224 : 7500 Hz
225 : 8500 Hz
... (+1000Hz)
254 : 37500 Hz
255 : 38500 Hz
Gain Table (LPF / HPF / EQ low / EQ mid / EQ high)
0 : -20
1 : -19.84375
2 : -19.6875
... (+0.15625)
126 : -0.3125
127 : -0.15625
128 : 0
129 : 0.15625
130 : 0.3125
... (+0.15625)
254 : 19.6875
255 : 19.84375
Q Table (LPF / HPF / EQ low / EQ mid / EQ high)
0 : 0.01041667
1 : 0.02083333
...(+0.01041667)
93 : 0.9791667
94 : 0.9895833
95 : 1
96 : 1.104167
97 : 1.208333
...(+0.104166)
189 : 10.79167
190 : 10.89583
191 : 11
192 : 11.15625
193 : 11.3125
...(+0.15625)
254 : 20.84375
255 : 21
Write Data(ReversePhase:0.$CC-$D9)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ ________________________________________________ _______________________
| | | | | | | |
CC |===========| L3 | R3 | L2 | R2 | L1 | R1 | SSG1:1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
CD |===========| L | R | L | R | L | R | SSG2:1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
CE |===========| L | R | L | R | L | R | SSG3:1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
CF |===========| L | R | L | R | L | R | SSG4:1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D0 |===========| L | R | L | R | L | R | FM1 :1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D1 |===========| L | R | L | R | L | R | FM1 :4-6: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D2 |===========| L | R | L | R | L | R | FM2 :1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D3 |===========| L | R | L | R | L | R | FM2 :4-6: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D4 |===========| L3 | R3 | L2 | R2 | L1 | R1 | Rhythm:1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D5 |===========| L6 | R6 | L5 | R5 | L4 | R4 | Rhythm:4-6: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D6 |===========| L | R | L | R | L | R | ADPCM-A:1-3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D7 |===========| L | R | L | R | L | R | ADPCM-A:4-6: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
| | | | | | | |
D8 |===========| L | R | L | R | L | R | ADPCM1/2/3: 0:OFF 1:Reverse
|___________|_____|_____|_____|_____|_____|_____|
Write Data(Effect:3.$C6-$CC)
ADDR. D7 D6 D5 D4 D3 D2 D1 D0 COMMENT
_____ __________________________________________________ _______________________
| | | 0-1(Def:0)コンプレッサーのスイッチです
C6 |C.Sw | Volume | 0-127(Def:)
|_____|____________________________________________|
| |
C7 | threshold | 0-255: 0.1 - 1.0
|__________________________________________________|
| |
C8 | ratio | 0-255: 2.0 - 10.0
____ |__________________________________________________| _______________________
| |
C9 | envelope Freq | 0-255: 0.19 - 50 (Hz)
|__________________________________________________|
| |
CA | envelope Q | 0-255: 0-21
____ |__________________________________________________| _______________________
| |
CB | gain Freq | 0-255: 0.19 - 50 (Hz)
|__________________________________________________|
| |
CC | gain Q | 0-255: 0 - 21
____ |__________________________________________________| _______________________
Effect Diaglom
Ch.Ins.Effect Sys.Effect
____________ ____________ ____________ ____________ ____________ ____________ ____________
| | | | | | | Ch.Ins. | | | | 3 band EQ | | Sys. |
| Distorsion | --> | Chorus | --> | LPF > HPF | --> | Compressor | -+-> | Reverb | --> | l > m > h | --> | Compressor |
|____________| |____________| |____________| |____________| | |____________| |____________| |____________|
.
. other Ch.Ins.Effect