Jump to content
IGNORED

RMT 1.28 Patch 8 theory


analmux

Recommended Posts

Regarding sawtooth...

 

Here's my oooold re-hack of RMT 1.25 (yeah that BRK - version). It has re-tuned sawtooth wave with normal square-one @ 64kHz (yeah - made by countless SOUND... SOUND POKE... POKE... trials in Turbo BASIC :) ). Some examples are there as well.

 

Maybe it will help a bit. :)

RMT_125Re-hack.zip

  • Like 1
Link to comment
Share on other sites

STEP FOUR:

 

RMT 1.28 Patch 8, sawtooth table, with distortion A at 1.79 MHz mode, AUDF1 and AUDF3, 48 bytes.

 

frqtabsawtooth
	dta $74,$71,$6E,$6A,$67,$64,$61,$5E,$5B,$59,$56,$53
	dta $51,$4E,$4C,$4A,$48,$45,$43,$41,$3F,$3D,$3B,$3A
	dta $38,$36,$35,$33,$31,$30,$2E,$2D,$2B,$2A,$29,$27
	dta $26,$25,$24,$23,$22,$20,$1F,$1E,$1D,$1C,$1B,$1B
Example, select the first byte, $74:

 

lda #$74
sta $D200 (AUDF1)
lda #$75
sta $D204 (AUDF3)
lda #$A2
sta $D201 (AUDC1)
lda #$64
sta $D208 (AUDCTL)
Then $74 = 116 and (116+4)*(117+4) = 120*121 = 14520, which is an approximation of 14592 = 0.5*29184, where 29184 = 256*114 is the base clock for patch 8. Edited by analmux
Link to comment
Share on other sites

STEP ONE, SUPPLEMENT (see post 4 for the previous version):

 

I will add 12 notes for the very very high flute notes.

 

frqtabpure

frqtabpurebass
	dta $FF,$F1,$E3,$D6,$CA,$BF,$B4,$AA,$A0,$97,$8F,$87
	dta $7F,$78,$71,$6B,$65,$5F,$5A,$54,$50,$4B,$47,$43
	dta $3F,$3B,$38,$35,$32,$2F,$2C,$2A,$27,$25,$23,$21
	dta $1F,$1D,$1C,$1A,$18,$17,$16,$14,$13,$12,$11,$10

frqtabpureflute
	dta $E0,$D3,$C7,$BC,$B1,$A7,$9D,$94,$8C,$84,$7C,$75

And here's the basic prog to generate audf values:

 

LOAD "D:FTDA179.BAS"

 

post-3860-0-06577600-1422911682_thumb.png

 

 

And here's a final version of the table schedule (see posts 15 and 16 for the previous versions):

 

Patch 8 Table:

RMT          PoKey        Bits:  Clock:    Number     Instrument
distortion:  distortion:                   of bytes:  name:

0            0            8      x         x          White noise
2            2            8      1.79 MHz  48         Poly 5 / Generator 2
4            A            8      1.79 MHz  36         Sawtooth / Triangle
6            C            8LSB   1.79 MHz  32         Clarinet (Poly 4), LSB
8            A            8HSB   1.79 MHz  64         Harmonic square undertones of Clarinet / Distortion guitar, HSB
A            A            8      15 kHz    48         Pure bass
A            A            8      1.79 MHz  12         Pure flute
C            C            8      1.79 MHz  31         Poly 4 (degenerate 1)
C            C            8      1.79 MHz  17         Poly 4 (degenerate 3)
E            8            8LSB   1.79 MHz  32         Distortion guitar (Poly 9), LSB
Link to comment
Share on other sites

And the last steps. Some formulas of 'clarinet' and 'distortion guitar':

 

LOAD "D:FTCL16.BAS"

LOAD "D:FTDG16.BAS"

 

post-3860-0-05401600-1422919806_thumb.pngpost-3860-0-91281900-1422919814_thumb.png

 

Index CL:  CL LSB:  CL HSB:  Index DG:  DG LSB:  DG HSB:

0          115      28       32         177      143
1          222      26       33         181      135
2          88       25       34         185      127
3          240      23       35         188      121
4          151      22       36         192      113
5          77       21       37         195      107
6          33       20       38         198      101
7          4        19       39         201      95
8          231      17       40         204      89
9          232      16       41         206      85
10         248      15       42         209      79
11         23       15       43         211      75
12         54       14       44         213      71
13         115      13       45         215      67
14         176      12       46         217      63
15         252      11       47         219      59
16         72       11       48         220      57
17         163      10       49         222      53
18         13       10       50         224      49
19         119      9        51         225      47
20         240      8        52         226      45
21         120      8        53         228      41
22         241      7        54         229      39
23         136      7        55         230      37
24         31       7        56         231      35
25         182      6        57         232      33
26         77       6        58         233      31
27         243      5        59         234      29
28         168      5        60         235      27
29         78       5        61         236      25
30         3        5        62         236      25
31         184      4        63         237      23

TEST2015.ATR update:

TEST2015.ATR

Link to comment
Share on other sites

STEP FIVE & STEP SIX:

 

The standard setting of RMT was introduced at post 1, and it contains "frqtabbasslo" and "frqtabbasshi" for the 16-bit mode:

 

frqtabbasslo
	dta $F2,$33,$96,$E2,$38,$8C,$00,$6A,$E8,$6A,$EF,$80
	dta $08,$AE,$46,$E6,$95,$41,$F6,$B0,$6E,$30,$F6,$BB
	dta $84,$52,$22,$F4,$C8,$A0,$7A,$55,$34,$14,$F5,$D8
	dta $BD,$A4,$8D,$77,$60,$4E,$38,$27,$15,$06,$F7,$E8
	dta $DB,$CF,$C3,$B8,$AC,$A2,$9A,$90,$88,$7F,$78,$70
	dta $6A,$64,$5E,$00

frqtabbasshi (= frqtab+$c0)
	dta $0D,$0D,$0C,$0B,$0B,$0A,$0A,$09,$08,$08,$07,$07
	dta $07,$06,$06,$05,$05,$05,$04,$04,$04,$04,$03,$03
	dta $03,$03,$03,$02,$02,$02,$02,$02,$02,$02,$01,$01
	dta $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00
	dta $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
	dta $00,$00,$00,$00

Table "frqtabbasslo" will be replaced by the 'clarinet & distortion guitar', low byte (frqtabcldglo), and table "frqtabbasshi" will be replaced by the 'clarinet & distortion guitar', high byte (frqtabcldghi):

 

Table "frqtabcldglo":

 

frqtabcldglo

frqtabcllo
	dta $73,$DE,$58,$F0,$97,$4D,$21,$04,$E7,$E8,$F8,$17
	dta $36,$73,$B0,$FC,$48,$A3,$0D,$77,$F0,$78,$F1,$88
	dta $1F,$B6,$4D,$F3,$A8,$4E,$03,$B8

frqtabdglo
	dta $B1,$B5,$B9,$BC
	dta $C0,$C3,$C6,$C9,$CC,$CE,$D1,$D3,$D5,$D7,$D9,$DB
	dta $DC,$DE,$E0,$E1,$E2,$E4,$E5,$E6,$E7,$E8,$E9,$EA
	dta $EB,$EC,$EC,$ED

Table "frqtabcldghi":

 

frqtabcldghi

frqtabclhi
	dta $1C,$1A,$19,$17,$16,$15,$14,$13,$11,$10,$0F,$0F
	dta $0E,$0D,$0C,$0B,$0B,$0A,$0A,$09,$08,$08,$07,$07
	dta $07,$06,$06,$05,$05,$05,$05,$04

frqtabdghi
	dta $8F,$87,$7F,$79
	dta $71,$6B,$65,$5F,$59,$55,$4F,$4B,$47,$43,$3F,$3B
	dta $39,$35,$31,$2F,$2D,$29,$27,$25,$23,$21,$1F,$1D
	dta $1B,$19,$19,$17
Link to comment
Share on other sites

SUMMARY:

 

See post 1 for the standard RMT 1.28. The origingal table index file "tabbeganddistor"

 

tabbeganddistor
	frqtabpure-frqtab,$00
	frqtabpure-frqtab,$20
	frqtabpure-frqtab,$40
	frqtabbass1-frqtab,$c0
	frqtabpure-frqtab,$80
	frqtabpure-frqtab,$a0
	frqtabbass1-frqtab,$c0
	frqtabbass2-frqtab,$c0

will be replaced by

 

tabbeganddistor
	dta frqtabpure-frqtab,$00
	dta frqtabpoly5-frqtab,$20
	dta frqtabsawtooth-frqtab,$a0
	dta frqtabpure-frqtab,$c0
	dta frqtabcldghi-frqtab,$a0
	dta frqtabpure-frqtab,$a0
	dta frqtabpoly4-frqtab,$c0
	dta frqtabpure-frqtab,$80

And here's a summary of the 320 bytes, which show Patch 8:

 

; RMT 1.28 Patch 8, 'clarinet / distortion guitar', 1.79 MHz & 16-bits, low byte
; RMT distortion 6 / E
; PoKey distortion C (poly 4) / 8 (poly 9!)
; 64 (32 + 32) bytes

frqtabcldglo

frqtabcllo
	dta $73,$DE,$58,$F0,$97,$4D,$21,$04,$E7,$E8,$F8,$17
	dta $36,$73,$B0,$FC,$48,$A3,$0D,$77,$F0,$78,$F1,$88
	dta $1F,$B6,$4D,$F3,$A8,$4E,$03,$B8

frqtabdglo
	dta $B1,$B5,$B9,$BC
	dta $C0,$C3,$C6,$C9,$CC,$CE,$D1,$D3,$D5,$D7,$D9,$DB
	dta $DC,$DE,$E0,$E1,$E2,$E4,$E5,$E6,$E7,$E8,$E9,$EA
	dta $EB,$EC,$EC,$ED


frqtab


; RMT 1.28 Patch 8, 'pure bass / pure flute', 15 kHz / 1.79 MHz
; RMT distortion A
; PoKey distortion A
; 60 (48 + 12) bytes

frqtabpure

frqtabpurebass
	dta $FF,$F1,$E3,$D6,$CA,$BF,$B4,$AA,$A0,$97,$8F,$87
	dta $7F,$78,$71,$6B,$65,$5F,$5A,$54,$50,$4B,$47,$43
	dta $3F,$3B,$38,$35,$32,$2F,$2C,$2A,$27,$25,$23,$21
	dta $1F,$1D,$1C,$1A,$18,$17,$16,$14,$13,$12,$11,$10

frqtabpureflute
	dta $E0,$D3,$C7,$BC,$B1,$A7,$9D,$94,$8C,$84,$7C,$75


; RMT 1.28 Patch 8, 'high notes', 1.79 MHz
; RMT distortion 2
; PoKey distortion 2 (poly 5)
; 48 bytes

frqtabpoly5
	dta $E7,$DA,$CE,$C2,$B7,$AC,$A2,$99,$90,$88,$80,$79
	dta $72,$6B,$65,$5F,$5A,$54,$4F,$4B,$46,$42,$3E,$3B
	dta $37,$34,$30,$2D,$2B,$28,$26,$23,$21,$1F,$1D,$1C
	dta $19,$18,$16,$15,$13,$12,$11,$10,$0F,$0E,$0D,$0C


; RMT 1.28 Patch 8, 'very high notes', 1.79 MHz
; RMT distortion C
; PoKey distortion C (poly 4, degenerate 1 / 3)
; 48 (31 + 17) bytes

frqtabpoly4

frqtabpolydeg41
	dta $F0,$E1,$D5,$CA,$BD,$B2,$A8,$9D,$96,$8E,$84,$7C
	dta $76,$70,$69,$63,$5D,$57,$52,$4E,$49,$45,$40,$3C
	dta $39,$36,$31,$30,$2D,$2A,$27

frqtabpolydeg43
	dta $EF,$E3,$D4,$C8,$BC
	dta $B3,$A7,$9E,$95,$8C,$86,$7D,$77,$6E,$68,$62,$5C


; RMT 1.28 Patch 8, 'sawtooth / triangle', 1.79 MHz, filter / double voice
; RMT distortion 4
; PoKey distortion A
; 36 bytes

frqtabsawtooth
	dta $74,$71,$6E,$6A,$67,$64,$61,$5E,$5B,$59,$56,$53
	dta $51,$4E,$4C,$4A,$48,$45,$43,$41,$3F,$3D,$3B,$3A
	dta $38,$36,$35,$33,$31,$30,$2E,$2D,$2B,$2A,$29,$27


; RMT 1.28 Patch 8, 'harmonic square undertones of clarinet / distortion guitar', 1.79 MHz & 16-bits, high byte
; RMT distortion 8
; PoKey distortion A
; 64 bytes

frqtabcldghi

frqtabclhi
	dta $1C,$1A,$19,$17,$16,$15,$14,$13,$11,$10,$0F,$0F
	dta $0E,$0D,$0C,$0B,$0B,$0A,$0A,$09,$08,$08,$07,$07
	dta $07,$06,$06,$05,$05,$05,$05,$04

frqtabdghi
	dta $8F,$87,$7F,$79
	dta $71,$6B,$65,$5F,$59,$55,$4F,$4B,$47,$43,$3F,$3B
	dta $39,$35,$31,$2F,$2D,$29,$27,$25,$23,$21,$1F,$1D
	dta $1B,$19,$19,$17
Edited by analmux
Link to comment
Share on other sites

Changing the 16-bit settings will be the final step. But first I recall that I already made Patch 3 years ago. Patch 3 already has a 'distortion guitar' setting, and at the time I changed some settings in rmtplayr.a65, parts qq3 and qq3a. The idea for 'patch 8' is to change parts qq3, qq3a, qq4, qq4a, qs3, qs3a, qs4, qs4a.

 

Here you can see the original standard RMT code, part qq3 and qq3a:

 

qq3
	IFT FEAT_FILTERG0L||FEAT_FILTERG1L
	cpx v_audctl
	bne qq5
	EIF
	EIF
	IFT FEAT_BASS16
	IFT FEAT_BASS16G1L
	lda trackn_command+1
	and #$0e
	cmp #6
	bne qq4
	lda trackn_audc+1
	and #$0f
	beq qq4
	ldy trackn_outnote+1
	lda frqtabbasslo,y
	sta trackn_audf+0
	lda frqtabbasshi,y
	sta trackn_audf+1
	IFT FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG0L
	lda trackn_audc+0
	and #$10
	bne qq3a
	EIF
	lda #0
	sta trackn_audc+0
qq3a
	txa
	ora #$50
	tax
	EIF

And here's Patch 3. See the difference.

 

qq3
	IFT FEAT_FILTERG0L||FEAT_FILTERG1L
	cpx v_audctl
	bne qq5
	EIF
	EIF
	IFT FEAT_BASS16
	IFT FEAT_BASS16G1L
	lda trackn_command
	and #$0e
	cmp #6
	bne qq4
	lda trackn_audc
	and #$0f
	beq qq4
	ldy trackn_outnote
	lda frqtabbasslo,y
	sta trackn_audf+0
	lda frqtabbasshi,y
	sta trackn_audf+1
	IFT FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG0L
	lda trackn_audc+0
	and #$10
	bne qq3a
	EIF
;	lda #0
;	sta trackn_audc+0
qq3a
	txa
	ora #$D0
	tax
	EIF
Link to comment
Share on other sites

So... waiting for something more material. :)

When it's finished, I'll close this 'theory' topic here, and open an official one. I'm thinking of a simple scale song, to show all the newest possibilities. ;)

 

The aim is to play 4-channel PoKey tune which will sound a bit like King Crimson - "Level Five".

Link to comment
Share on other sites

  • 10 months later...

I always thought about doing some hacking of RMT player myself, but I need to know what some of the variable memory locations do exactly. After all I am a very knowledgeable assembly language programmer with the Atari. Maybe start with an automatic NTSC/PAL delay switch inside RMT player. One trick I did in the past was check the lower 3 bits of the RTCLOCK (20), if 0 and running on a NTSC system, HOLD, otherwise CONTINUE. I have been doing whole VBI hold ups on some games to make them play about the same speed on both NTSC and PAL. I am aware this is a 1/8th frame delay is still slightly faster than a 1/6th frame delay. But very people really notice a difference, 52.5 frames per second vs 50 frames per second. Later games and programming went back to using a separate frame countdown that delays every 6th frame on NTSC.

 

I am a little busy with some game projects but I occasionally look at the RMT player source and wish someone can do something with this.

Link to comment
Share on other sites

Maybe start with an automatic NTSC/PAL delay switch inside RMT player.

AFAIK, the newest RMT 128 already contains a PAL/NTSC check and has an extra posibility to switch the rmtplay timers. But it may interfere with critical on screen subroutines. But during export song to xex says: "Playing speed will be adjusted to 50Hz on PAL and also on NTSC systems."

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...