Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user peterfj ! (Registered 2019-04-20) You are not logged in 
CSDb User Forums


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

Registered: Oct 2014
Posts: 293
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: 1115
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: 293
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: 1115
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: 293
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: 1115
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: 293
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: 1115
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
Dymo/G★P
DuncanTwain
OEP
G-Force
leuat
TheEnemy/Excess/THD
Lexi
Dipswitch/Up Rough
St0rmfr0nt/ExCeSs
SLC
iAN CooG/HVSC
DnP
Guests online: 57
Top Demos
1 Unboxed  (9.7)
2 Uncensored  (9.7)
3 Rivalry  (9.7)
4 Edge of Disgrace  (9.6)
5 Coma Light 13  (9.6)
6 Comaland 100%  (9.6)
7 The Shores of Reflec..  (9.6)
8 Lunatico  (9.6)
9 X Marks the Spot  (9.5)
10 Old Men in Used Cars  (9.5)
Top onefile Demos
1 Instinct  (9.7)
2 Smile to the Sky  (9.6)
3 Daah, Those Acid Pil..  (9.5)
4 Dawnfall V1.1  (9.4)
5 FMX Music Demo  (9.4)
6 Party Horse  (9.4)
7 Bad Boy  (9.4)
8 Crystal Gazer  (9.4)
9 Rewind  (9.4)
10 Pandemoniac Part 2 o..  (9.4)
Top Groups
1 Fossil  (9.9)
2 PriorArt  (9.7)
3 Oxyron  (9.5)
4 Booze Design  (9.4)
5 Censor Design  (9.3)
Top Hardware-Gurus
1 Soci  (9.9)
2 Grue  (9.8)
3 Zer0-X  (9.8)
4 Wiesel  (9.8)
5 Lemming  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2019
Page generated in: 0.046 sec.