Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > GoatTracker and the random dropped notes
2019-04-04 15:20
oziphantom

Registered: Oct 2014
Posts: 478
GoatTracker and the random dropped notes

So every time I use Goattracker at some point I get "this song is dropping a note on a channel".. "it works fine when I export an prg and listen to it.

So I use bin files. It set to be at $3000/$6000 ( I have two files) and ZP is set to DB-DC. I'm playing it off a NMI, which is set to the frame rate, so it always plays in the same spot. The main loop is - jmp - so its doing nothing, IRQs are disabled.

initAudio 
 	SEI 
	LDA #$7F
	STA aDD0D                    ;CIA2: CIA Interrupt Control Register
	lda CurrentSong
	cmp #kSong1Max
	bcs _song2
		jsr SONG_1 ; init Song
		LDA #<AudioNMI
		STA aFFFA                    ;NMI
		LDA #>AudioNMI
		STA aFFFB                    ;NMI
		jmp _setup
_song2
	sec
	sbc #kSong1Max
	jsr SONG_2 ; init Song
	LDA #<AudioNMI2
	STA aFFFA                    ;NMI
	LDA #>AudioNMI2
	STA aFFFB                    ;NMI
_setup		
	lda #<19655
	sta aDD04
	lda #>19655
	sta aDD05
	lda #$0f
	sta $D418


	LDA #$00
;	STA a20
;	STA a21
;	STA a22
	LDA #$11
	STA aDD0E                    ;CIA2: CIA Control Register A
	LDA #$FF
	STA a00
	LDA #$35                     ;Set Just IO
	STA a01
	LDA #$81
	STA aDD0D                    ;CIA2: CIA Interrupt Control Register
	RTS 

exitNMIEnbNext 	
	LDA #$81
	STA aDD0D                    ;CIA2: CIA Interrupt Control Register
exitNMI	
	PLA 
	TAY 
	PLA 
	TAX 
	PLA 
	RTI 

AudioNMI  
	PHA 
	TXA 
	PHA 
	TYA 
	PHA 
	LDA #$7F
	STA aDD0D                    ;CIA2: CIA Interrupt Control Register
	LDA aDD0D                    ;CIA2: CIA Interrupt Control Register
	Bpl _bA0F7
	;JMP jA123
	inc $d020
	jsr SONG_1+3 ; call goattracker
	dec $d020
	jmp exitNMIEnbNext
_bA0f7	
	jmp exitNMI

AudioNMI2  
	PHA 
	TXA 
	PHA 
	TYA 
	PHA 
	LDA #$7F
	STA aDD0D                    ;CIA2: CIA Interrupt Control Register
	LDA aDD0D                    ;CIA2: CIA Interrupt Control Register
	Bpl _bA0F7
	;JMP jA123
	inc $d020
	jsr SONG_2+3 ; call goattracker
	dec $d020
	jmp exitNMIEnbNext
_bA0f7	
	jmp exitNMI
anybody got any ideas of what could be causing the "dropped notes" that randomly change to be happening? something extra I have to ensure I set up or call?
2019-04-04 15:38
cadaver

Registered: Feb 2002
Posts: 1153
IMO, best solution is just to not use unsafe ADSR values that are liable to drop notes or bug the attack. Buffered or full buffered playback can also help. When using 2-frame hardrestart, most ADSR values should actually be safe, buffered or not.

The editor basically is "too stable", while real playroutine will write the registers at different times depending on what code it needs to execute each frame.

Or better yet .. make your own player / editor :)
2019-04-04 16:30
oziphantom

Registered: Oct 2014
Posts: 478
sure editor vs code would be different, but PRG export on machine, vs bin file export? We are comparing VICE to VICE ;) Although different export locations. The author assures me he is using hardreset of 2 for everything.
2019-04-04 16:38
cadaver

Registered: Feb 2002
Posts: 1153
The difference of .prg or .bin export should just be the inclusion of startaddress.

How is the composer driving the song when listening to it?

If the NMI was to somehow trigger twice in a frame, then it could cause ADSR bugs, as notes suddenly become shorter.
2019-04-04 16:56
oziphantom

Registered: Oct 2014
Posts: 478
The usual wait for d012
.7000  sei
.7001  lda #$00 (subtune #)
.7003  jsr $0c00
.7006  lda $d012
.7009  cmp #$80
.700b  bne $7006
.700d  jsr $0c03
.7010  jmp $7006
2019-04-04 17:07
cadaver

Registered: Feb 2002
Posts: 1153
Could be difference in badlines when the player is called in different part of the screen. Usually this takes very small (unsafe) decay or release values to cause trouble.

If you turn on full buffering, then the previous frame's SID values are dumped into SID in the beginning of the play call, resulting in the best possible stability. This causes the most CPU use, so regular buffering should be a preferable solution.
2019-04-04 17:35
oziphantom

Registered: Oct 2014
Posts: 478
bad lines might be a cause..
If say setting the pulse width got cut in half, that might cause something odd?
2019-04-04 18:17
cadaver

Registered: Feb 2002
Posts: 1153
If the pulse is making a fast modulation, or when it's crossing highbyte boundaries, it could have a half-wrong value (only lowbyte updated at first) for the duration of the badline.

TBH I haven't consciously noticed or thought about this.

But if you want the best possible fidelity for SID write "grouping", use full buffering, and call the player outside the screen.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Twilight/Excess/Arcade
Alakran_64
hedning/G★P
Mike
eater
morphfrog
Sentinel/Excess/TREX
CA$H/TRiAD
t0m3000/ibex-crew
Paladin/G★P
Guests online: 229
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.039 sec.