You are not logged in -
nap
CSDb User Forums
Forums
>
C64 Coding
>
Detect instrument being played (goattracker)
2015-04-27
14:12
No-XS
Registered: Mar 2002
Posts: 79
Detect instrument being played (goattracker)
I have a goattracker sidtune and for a demoscreen I want some visual to happen when a snaresound is being played.
Because I'm not the best coder there is, I cannot find any way to do this or find a tutorial or reference to it. From years ago I remember doing it for other sids from another editor.
Is there an easy way to detect a certain instrument, say on channel1 ?
... 10 posts hidden. Click
here
to view all posts....
2015-05-06
20:15
No-XS
Registered: Mar 2002
Posts: 79
Quote:
You could also use timing marks in Goattracker. From the manual:
"Command DXY: Set mastervolume to Y, if X is $0. If X is not $0, value XY copied to the timing mark location, which is playeraddress+$3F."
Ah! I thought so already that something similar would have been included, but it's not the first time that I don't really understand what the manual speaks of until someone explains it to me! Some other things in goattracker happened when making the song that I couldn't explain, but I worked around it. Maybe I should start a new topic on that, or ask Cadaver directly.
2020-01-08
11:12
Flotsam
Registered: Jan 2004
Posts: 85
I know this thread is almost as old as an average C64 scener, but since Google brought me here and possibly others too when searching for info on detecting the instrument playing in a GoatTracker song, I'll leave a tiny piece of code here that I wrote because I felt uncomfortable using It's Rhythm. It searches for a signature that tells the start address of the significant data. The same data structure repeats for each channel as follows (from Cadaver in another thread), starting from the address found:
mt_chnsongnum:
.BYTE (0)
mt_chnpattnum:
.BYTE (0)
mt_chntempo:
.BYTE (0)
mt_chncounter:
.BYTE (0)
mt_chnnote:
.BYTE (0)
mt_chninstr:
.BYTE (1)
mt_chngate:
.BYTE ($fe)
THE CODE (KickAssembler format):
---------
BeatDetector:
ldy #0
BDloop:
lda ($fa),y
cmp BDdata,y
bne BDnext
iny
cpy #21
bne BDloop
BDfound:
rts
BDnext:
inc $fa
bne BDloop
inc $fb
bne BDloop
brk /*we're fucked*/
BDdata:
.byte 0,0,0,0,0,1,$fe
.byte 1,0,0,0,0,1,$fe
.byte 2,0,0,0,0,1,$fe
------------
Call it by initing $fa with start address of the song:
lda #<$1000
sta $fa
lda #>$1000
sta $fb
jsr BeatDetector
/*$fa-$fb now holds the starting address*/
For a release version you'd of course skip the search, but on production stage it's nice to have an automatic detection for changing versions of the song. Also, it's in no way dynamic. Doesn't account for using less than 3 channels etc. Life is tough.
Previous
-
1
| 2 - Next
Refresh
Subscribe to this thread:
You need to be logged in to post in the forum.
Search the forum:
Search
All forums
C64 Coding
C64 Composing
C64 Pixeling
C64 Productions
CSDb Bug Reports
CSDb Development
CSDb Discussions
CSDb Entries
CSDb Feedback
CSDb Info
CSDb moderators
CSDb Questions
Messages to moderators
Requests
for
in
Writer & text
Text
Writer
All times are CET.
Search CSDb
All
Releases
Groups
Sceners
Events
BBS
SIDs
-------
Forum
Comments
Advanced
Users Online
Epyx/TSA
Marq/Fit^Lieves!Tuor..
astaroth/TRSI
CA$H/TRiAD
Guests online: 150
Top Demos
1
Next Level
(9.7)
2
13:37
(9.7)
3
Codeboys & Endians
(9.7)
4
Mojo
(9.6)
5
Coma Light 13
(9.6)
6
Edge of Disgrace
(9.6)
7
Signal Carnival
(9.6)
8
Wonderland XIV
(9.5)
9
Uncensored
(9.5)
10
Comaland 100%
(9.5)
Top onefile Demos
1
Nine
(9.7)
2
Layers
(9.6)
3
Cubic Dream
(9.6)
4
Party Elk 2
(9.6)
5
Copper Booze
(9.5)
6
Scan and Spin
(9.5)
7
Onscreen 5k
(9.5)
8
Grey
(9.5)
9
Dawnfall V1.1
(9.5)
10
Rainbow Connection
(9.5)
Top Groups
1
Artline Designs
(9.3)
2
Booze Design
(9.3)
3
Oxyron
(9.3)
4
Performers
(9.3)
5
Censor Design
(9.3)
Top NTSC-Fixers
1
Pudwerx
(10)
2
Stormbringer
(9.7)
3
Fungus
(9.6)
4
Booze
(9.5)
5
Grim Reaper
(9.3)
Home
-
Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.304 sec.