Schrijver
| MSX-AUDIO & MSX-MUSIC Freq Tables
| nerlaska msx user Berichten: 48 | Geplaatst: 07 Januari 2008, 06:34   | Hello,
I would like to know what should be the Freq Table for 96 entries (12 * 8 octaves) in each case MSX-Audio and MSX-Music to be compatible with PSG/SCC table
I'm using for MSX-Audio the given in Y8950 Application Manual but .. when i combine PSG and MSX-Audio .. i obtain.. mmm .. i don't know the correct english word for define it ... disonnance? well .. the same track sounds different .. out of tone.
Thank you.
| | Edwin msx professional Berichten: 594 | Geplaatst: 07 Januari 2008, 12:12   | The application manual of the Y8950 tells exactly how you can calculate the appropriate register values for a frequency. Fnum = (F*2^19/50000)/(2^(B-1)) where F is the desired frequency and B is the block (effectively the desired octave). See page 27 of the application manual.
If memory serves me right, MSX-MUSIC has a similar method, but different values.
| | nerlaska msx user Berichten: 48 | Geplaatst: 07 Januari 2008, 15:18   | But, Do F should be the same freq value used in PSG?
| | Edwin msx professional Berichten: 594 | Geplaatst: 07 Januari 2008, 15:39   | I would choose to do that yes. But what the actual sound is like probably depends on the instrument used. But that's something better handled in the editor.
| | ro msx guru Berichten: 2320 | Geplaatst: 07 Januari 2008, 15:44   | MA/MM frq tables are the same, tho (IIRC) MA (Msx Audio) has double resolution, so multiply FRQ by 2.
Here's what you need:
; MM/MA frequencies
OPLFRQ: DB $AD,$00,$B7,$00,$C2,$00,$CD,$00,$D9,$00,$E6,$00
DB $F4,$00,$03,$01,$12,$01,$22,$01,$34,$01,$46,$01
DB $AD,$02,$B7,$02,$C2,$02,$CD,$02,$D9,$02,$E6,$02
DB $F4,$02,$03,$03,$12,$03,$22,$03,$34,$03,$46,$03
DB $AD,$04,$B7,$04,$C2,$04,$CD,$04,$D9,$04,$E6,$04
DB $F4,$04,$03,$05,$12,$05,$22,$05,$34,$05,$46,$05
DB $AD,$06,$B7,$06,$C2,$06,$CD,$06,$D9,$06,$E6,$06
DB $F4,$06,$03,$07,$12,$07,$22,$07,$34,$07,$46,$07
DB $AD,$08,$B7,$08,$C2,$08,$CD,$08,$D9,$08,$E6,$08
DB $F4,$08,$03,$09,$12,$09,$22,$09,$34,$09,$46,$09
DB $AD,$0A,$B7,$0A,$C2,$0A,$CD,$0A,$D9,$0A,$E6,$0A
DB $F4,$0A,$03,$0B,$12,$0B,$22,$0B,$34,$0B,$46,$0B
DB $AD,$0C,$B7,$0C,$C2,$0C,$CD,$0C,$D9,$0C,$E6,$0C
DB $F4,$0C,$03,$0D,$12,$0D,$22,$0D,$34,$0D,$46,$0D
DB $AD,$0E,$B7,$0E,$C2,$0E,$CD,$0E,$D9,$0E,$E6,$0E
DB $F4,$0E,$03,$0F,$12,$0F,$22,$0F,$34,$0F,$46,$0F
PSGFRQ: DW $0D65,$0C9D,$0BEB,$0B42,$0A9A,$0A04,$0971,$08E8
DW $086B,$07E2,$077F,$0719,$06B3,$064E,$05F5,$05A1
DW $054D,$0502,$04B9,$0474,$0434,$03F9,$03C0,$038C
DW $0359,$0327,$02F6,$02D1,$02A7,$0281,$025C,$023A
DW $021A,$01FD,$01E0,$01C6,$01AD,$0194,$017D,$0168
DW $0153,$0141,$012E,$011D,$010D,$FE,$F0,$E3
DW $D6,$CA,$BF,$B4,$AA,$A0,$97,$8F
DW $87,$7F,$78,$72,$6B,$65,$5F,$5A
DW $55,$50,$4C,$47,$43,$40,$3C,$39
DW $36,$33,$30,$2D,$2A,$28,$26,$24
DW $22,$20,$1E,$1C,$1B,$19,$18,$17
DW $15,$14,$13,$12,$11,$10,$0F,$0E ;
| | nerlaska msx user Berichten: 48 | Geplaatst: 07 Januari 2008, 17:14   | ey!! thank you!! yes .. now it sounds nice!! thank you!
| | nerlaska msx user Berichten: 48 | Geplaatst: 08 Januari 2008, 05:26   | The wait cycles in every writting to OPL1 or OPLL should be Z80 cycles?
If i must wait 84 cycles this means 84 NOPS?
Thank you.
| | nerlaska msx user Berichten: 48 | Geplaatst: 08 Januari 2008, 07:48   | Another question is ... i can play Y8950 music in BlueMSX, no problem with this .. i use ports 0xC0 and 0xC1 and i initialize the instruments, etc .. fastly i can listen the changes but .. if i attemp to use YM2413 using 0x7C and 0x7D i can't listen anything. Do I need to do something special?
Debugging in BlueMSX i can see how YM2413 registers are modifyied. Is very bizarre.
Thank you.
| | Edwin msx professional Berichten: 594 | Geplaatst: 09 Januari 2008, 00:07   | 84 cycles sounds a bit excessive. Even with a nop doing 5 of them. So it's probably based on some other clock. I found some code with two ex (sp),hl delay after a write to $C1. And four of them after a write to $7D for msx-music. In works, but it can probably be shorter unless you really do consecutive writes without any extra processing.
| | ro msx guru Berichten: 2320 | Geplaatst: 09 Januari 2008, 08:58   | This is what I use in Oracle:
; Write to ports:
MAFOUT: JP MAROUT ; fast
MMFOUT: JP MMROUT
; Z80
O3ZOUT: EX AF,AF
LD A,C
O3ZBNK: OUT ($C4),A
EX AF,AF
OUT ($C5),A
RET
MAZOUT: EX AF,AF
LD A,C
OUT ($C0),A
EX AF,AF
OUT ($C1),A
RET
MMZOUT: EX AF,AF
LD A,C
OUT ($7C),A
EX AF,AF
OUT ($7D),A
RET
; R800
O3ROUT: EX AF,AF
CALL TRWAIT
LD A,C
O3RBNK: OUT ($C4),A
IN A,($E6)
LD (RCOUNT),A
EX AF,AF
OUT ($C5),A
RET
MAROUT: EX AF,AF
CALL TRWAIT
LD A,C
OUT ($C0),A
IN A,($E6)
LD (RCOUNT),A
EX AF,AF
OUT ($C1),A
RET
MMROUT: EX AF,AF
CALL TRWAIT
LD A,C
OUT ($7C),A
IN A,($E6)
LD (RCOUNT),A
EX AF,AF
OUT ($7D),A
RET
TRWAIT: PUSH BC
LD A,(RCOUNT)
LD B,A
TRWT.0: IN A,($E6)
SUB B
CP 6
JR C,TRWT.0
POP BC
RET
RCOUNT: DB 0
PSGOUT: OUT ($A0),A
PUSH AF
LD A,E
OUT ($A1),A
POP AF
RET
There's 2 modes: Z80 and R800. In Z80, there's not extra wait. The R800 routes will wait just long enough, including the "call" cycle time. | | Edwin msx professional Berichten: 594 | Geplaatst: 09 Januari 2008, 11:26   | A wait of 6 on the turbo R timer is 168 cycles of the r800 clock (not including the extra delay from returning from the call). This is 84 cycles on the z80 clock. But if I count quickly, you can do a consecutive call on z80 in 56 cycles. Does the rest of the code imply more delay? Ever tried what happens when you reduce the delay on r800?
| | ro msx guru Berichten: 2320 | Geplaatst: 09 Januari 2008, 13:13   | Yes, I have tested it and 6 was the minimum.
| | nerlaska msx user Berichten: 48 | Geplaatst: 09 Januari 2008, 15:25   | Mmm. thank you .. it's a very useful information. About my problem with YM2413 .. it was solved .. was a problem with volume entry .. i wrote wrong value (0xF = silence!)
A question <ro> .. is there an ASM Player for ORACLE modules? Could you show me info about ORACLE song files?
Thank you people!
| | ro msx guru Berichten: 2320 | Geplaatst: 10 Januari 2008, 14:11   | There is an ASM replayer, but it's the build in version which depends heavilly on the MIDAS f-Kernel. I've never made a stand-alone version (shame..). I should tho.
There's, ofcourse, lotsa info on ORC mods. here's some:
$1.1 Song/Module file structure:
================================
Ext.name: *.ORC (Default)
Lenght: Variable
Type: Data, not crunched
Contents: Header, patterns, [+ ADPCM data if MOD], [+ info]
$1.1.1 EDIT file
================
Offs Lenght Description
----+------+--------------------------------------------------------
00 08 Oracle ID
08 01 File type (0/1)
09 01 File set up: b0-b7:
b0: 1, song type (0, Edit. 1, User)
b1: 1,
b2: 1,
b3: 1,
b4: 1, Hertz equal speed
b5: 1, Track name included
b6: 1, Info included
b7: 1, Truncated
0A 40 Track name
4A 01 Default Tempo (02-1F)
Pattern Info Block:
4B 01 +0 Total used channels (global) (max #20)
4C 01 +1 Total used NOTE channels
4D 01 +2 Total used DRUM channels
4E 01 +3 Total used patterns
4F 01 +4 Default total rows per pattern
50 06 +5 Free
Instrument Info Block:
56 01 Total used OWN instruments (#20)
57 01 Total used NOTE instruments (#20)
58 01 Total used DRUM instruments (#08)
59 01 Total used Samples (#20)
5A 01 Total used Envelopes (#10)
5B 01 Song length (total positions) (#100)
5C 01 Restart position (-1, OFF)
5D 01 x songlength (#100)
Position Table (pattern sequence)
15D 04 x [total channels]
Channel routing:
+00 Mode (bit value below)
b#0, MSX Music
b#1, MSX Audio
b#2, Sample (audio, ADPCM)
b#3, PSG
b#4,
b#5,
b#6, drum (1=yes)
b#7, stat (1=ON)
+01 Instrument (00-1F)
+02 Tuning
+03 Volume (00:min, 3F:max)
?? 0A x [total used instruments]
Instruments MSX Music:
+00 01 Program Instr.no./Type:
o 00-EF Original:
(00-AF: Oracle instr. B0-EF: User instr.)
+01 08 OPL voice data (MM string!)
+09 01 empty (not used)
o FD Standard:
+01 01 FM instrument nr (b7-b4, #10-#F0)
+02 08 empty (not used)
o FE Standard PLUS:
+01 01 Program Instr.no:
(00-3F: Oracle instr. 40-7F: User instr.)
+02 01 1st FM instrument (b7-b4)
VBL counter (b3-b0, 0: end)
+03 01 2nd FM instrument (b7-b4)
VBL counter (b3-b0, 0: end)
+04 01 3rd FM instrument (b7-b4)
VBL counter (b3-b0, 0: end)
+05 01 4th FM instrument (b7-b4)
VBL counter (b3-b0, 0: end)
+06 04 Empty
o FF Empty
?? 0A x total used instruments
Instruments MSX Audio:
+00 01 Program Instr.no.
o 00-EF Instrument:
(00-AF: Oracle instr. B0-EF: User instr.)
+01 09 OPL voice data (MA string!)
rem: Volume (TL, gen A -> OPL reg 3) is futile.
o FF Empty
?? 10 x total used FM DRUM sets
Drum instruments MSX Music:
+00 01 Program Instr.no.
o 00-1F Instrument:
(00-0F: Oracle drum. 10-1F: User drum.)
+01 06 Frequency data
+07 06 Volume relations
+0C 03 Empty
o FF Empty
?? 10 x total used FM DRUM sets
Drum instruments MSX Audio:
+00 01 Program Instr.no.
o 00-1F Instrument:
(00-0F: Oracle drum. 10-1F: Own drum.)
+01 06 Frequency data
+07 06 Volume relations
+0D 03 Empty
o FF Empty
?? xx Free!
?? 04 x total envelopes:
+00 01 Program Envelope no.
o 00-0F Envelope:
(00-07: Oracle envl. 08-0F: Own envl.)
+00 Attack speed/rate
+01 Decay speed/rate
+03 b0-b3: Sustain level
b4: Percussion (0=yes)
b5: Key (sys)
+04 Release speed/rate
o FF Empty
?? ... Pattern data
[ ?? ... Info]
[ ?? ... Sample kit+names]
$1.1.3 Pattern structure:
=========================
One row looks like:
1st_chnl, 2nd_chanl, 3rd_chanl --- last_chanl
[ROWLEN = (TOTCHN) x 2]
Each step is build up out of 2 bytes:
byte +00 byte +01
bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
x2 y y y y y y y x1 x0 z z z z z z
> Note channel:
y6-1 Description
-------+------------------------------------------------------------
00-5F Note (octave x 12 + note)
60 Empty step (note only)
61 Key OFF.
62 VIB (Frequency modulation -> VIBration)
63 TRM (Amplitude modulation -> TReMolo)
64 WAH (Brighness modulation -> Wah-Wah effect)
65 SUS (Sustain-OFF at MSX music)
66-7F Empty steps note&FX-1 (subtract #66) -> for channel pack.
> Drum channel:
y6-1 Description
-------+------------------------------------------------------------
00-1F Drum items:
b0, HiHat
b1, Cymbal
b2, Tom
b3, Snare
b4, Bass
60 Empty step (drum only)
61 Key OFF.
62-65 xx
66-7F Empty steps Drum&FX (subtract #66) -> for channel pack.
> Note channel effects:
x210 Effect:
-----+--------------------------------------------------------------
000 Arpeggio (z543, first half note add-1
z210, second half note add-1)
001 Volume (z543210, local volume)
010 Instrument (z43210, instrument nr)
011 z5:0, Tune (z4, pos (0) / neg (1)
z5:1, Pitch Bend z3210, value)
100 z5:0 Volume slide (z4, pos (0) / neg (1)
z5:1 Bright slide z3210, slide value)
101 Brightness Control (z543210, value)
[note: FM note channel only]
110 z5:0, Global speed (z43210, speed value -1)
z5:1, Global trans (z4, pos (0) / neg (1)
z3210, half note transpose value)
111 2nd FX mode (see below):
z54 (second FX)
111 00 Velocity (z3210, depth)
111 01 Retrig note (z3210, retrig after z VBLs)
111 10 Timer Byte (z3210, user value)
111 11 3rd FX mode (see below):
z3210: 0, Pattern break (global)
1, Note link
2, Volume Fade out (global)
3, Channel LEFT (OPL3, FM)
4, Channel CENTER (OPL3, FM)
5, Channel RIGHT (OPL3, FM)
6, Reset channel (set start vars)
D, Clear envelope
E, Kill local FX
F, No FX (empty!)
> Drum channel effects:
x210 Effect:
-----+--------------------------------------------------------------
000 Normal (z543210, NULL)
001 Volume (z543210, local volume)
010 Instrument (z43210, instrument nr)
011 xx
100 z5:0 Volume slide (z4, pos (0) / neg (1)
z5:1 xx
101 xx
110 z5:0, Global speed (z43210, speed value -1)
z5:1, Global trans (z4, pos (0) / neg (1)
z3210, half note transpose value)
111 2nd FX mode (see below):
z54 (second FX)
111 00 xx
111 01 Retrig note (z3210, retrig after x VBLs)
111 10 Timer Byte (z3210, user value)
111 11 3rd FX mode (see below):
z3210: 0, Pattern break (global)
1, xx
2, Volume Fade out (global)
3, Channel LEFT (OPL3, FM)
4, Channel CENTER (OPL3, FM)
5, Channel RIGHT (OPL3, FM)
6, Reset channel (set start vars)
E, Kill local FX
F, No FX (empty!)
| | manuel msx guru Berichten: 3381 | Geplaatst: 10 Januari 2008, 16:54   | ro, are you checking out the Nijmegen fair, this year?
| |
| |
| |