NSF Export doesn't get this instrument right
Forum rules
When making a bug report, please try to be as specific as possible. Include information on how to reproduce the bug and an example file if possible.
If the application crashed, please include the generated memory dump file as well.
When making a bug report, please try to be as specific as possible. Include information on how to reproduce the bug and an example file if possible.
If the application crashed, please include the generated memory dump file as well.
- TheMudkipMaster12
- Posts: 320
- Joined: Sat Apr 25, 2015 1:26 am
- Location: :uoıʇɐɔoן
- Contact:
NSF Export doesn't get this instrument right
When I export this FTM to an NSF, it sounds different and I'm not sure what causes it.
- Attachments
-
- How it's exported.nsf
- Exported NSF
- (5.91 KiB) Downloaded 168 times
-
- How it should be.ftm
- Original FTM
- (1.01 KiB) Downloaded 168 times
"It's funny because cool, means cold." -Savestate, Feb. 17, 2016
HI IM KIPPTUNE AND THIS IS MY OLD ACCOUNT LOL
HI IM KIPPTUNE AND THIS IS MY OLD ACCOUNT LOL
- HertzDevil
- Posts: 475
- Joined: Thu Apr 23, 2015 7:39 pm
- Location: Hong Kong SAR
- Contact:
Re: NSF Export doesn't get this instrument right
The channel note underflows, after which it is treated as a note higher than B-7. Such behaviour can be shown more simply by using a relative arpeggio sequence of {| -12} and no other sequences. One fix would be:
As relative arpeggio offsets are signed, the line ensures that all underflowed note values will be set to 0x01 (C#0) rather than 0x5F (B-7).
Code: Select all
@Relative:
; Relative
clc
lda var_ch_Note, x
adc var_sequence_result
bmi :+ ; add this line
; cmp #$01 ; these lines only work when the note value is 0x00 (C-0) since carry flag is cleared upon
; bcc :+ ; *unsigned* underflow and every unsigned 8-bit value other than 0x00 is larger than or equal to 0x01
cmp #$5F
bcc :++
lda #$5F
bne :++
: lda #$01
: sta var_ch_Note, x
jmp @ArpDone
As relative arpeggio offsets are signed, the line ensures that all underflowed note values will be set to 0x01 (C#0) rather than 0x5F (B-7).
refactoring 0cc-famitracker
Re: NSF Export doesn't get this instrument right
If you do not wish to implement this fix yourself, you may also avoid this by not going too low and assuming that the note will floor at A-0