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


Forums > C64 Coding > Detect instrument being played (goattracker)
2015-04-27 14:12
No-XS

Registered: Mar 2002
Posts: 75
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 ?
 
... 2 posts hidden. Click here to view all posts....
 
2015-04-27 14:51
Oswald

Registered: Apr 2002
Posts: 4507
It's Rythm V1.2

this tool helps in finding the byte in memory. serves me since mid 90's for this purpose.

you just look for the color changes on screen as the music plays basically, then you can pick some favourite spots, and monitor them.

shows you both address and value.
2015-04-27 16:46
No-XS

Registered: Mar 2002
Posts: 75
Cool! Thanks!
2015-04-27 21:21
TheRyk

Registered: Mar 2009
Posts: 653
I could not find the tool I originally wanted to recommend you (?OUT OF MEMORY), but while searching I discovered this one:
SidInspector
Looks pretty much like what yer looking for.
2015-05-03 14:38
daison

Registered: May 2005
Posts: 90
We tried both It's Rhythm and SidInspector.

It's Rhythm really worked out well for us.
Despite some bugs (may crash when moving the cursor around) it's pretty insightful what is happening wear exactly.

SidInspector seemed to have issues with sids above $2000? Apart from that it's a somewhat less userfriendly in every way. But tnx anyway. It was fun playing around with these tools!

The result:
Outline 2015 Invitation
2015-05-04 07:42
Oswald

Registered: Apr 2002
Posts: 4507
glad its ryth worked out. was totally stable for me always, probably this player interferes with some zp var they both use.
2015-05-05 18:26
Domspitze

Registered: Oct 2013
Posts: 2
Sorry for this stupid question. But how can I use another sid in sidinspector?
2015-05-05 19:29
TheRyk

Registered: Mar 2009
Posts: 653
It only works with SIDs located at $1000.

Summary sez:
"load another standard SID to $1000 and restart SidInspector with SYS 2064 ($0810)"
http://csdb.dk/release/?id=112199&show=summary#summary

so after loading and RUNning SidInspector, soft-reset, then make sure your tune is at $1000 (without .SID header of course) and then either load it in direct mode or in monitor.
2015-05-06 19:47
Klegg

Registered: Feb 2006
Posts: 15
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."
2015-05-06 20:15
No-XS

Registered: Mar 2002
Posts: 75
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: 27
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
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
Mibri/ATL^PRX
PAL/Offence
XTRO/Whoop
Hawk
Jammer/TooMany
iAN CooG/HVSC
Dymo/G★P
stephan-a
hedning/G★P
CA$H/TRiAD
Mason/Unicess
Sentinel/Excess
No-XS
Thunder.Bird/HF/MYD!..
Guests online: 66
Top Demos
1 Uncensored  (9.7)
2 Unboxed  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.7)
5 Comaland 100%  (9.6)
6 Lunatico  (9.6)
7 The Shores of Reflec..  (9.5)
8 Rivalry  (9.5)
9 X Marks the Spot  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Tribute to Ben - Las..  (9.8)
2 Gumbo Revised  (9.6)
3 Crystal Gazer  (9.6)
4 Smile to the Sky  (9.5)
5 Dawnfall V1.1  (9.5)
6 The Best Compopic Ar..  (9.5)
7 Daah, Those Acid Pil..  (9.5)
8 Instinct  (9.5)
9 Innervasion  (9.5)
10 Merry Krampus  (9.5)
Top Groups
1 Oxyron  (9.4)
2 PriorArt  (9.4)
3 Fossil  (9.4)
4 Booze Design  (9.4)
5 Censor Design  (9.4)
Top Fullscreen Graphicians
1 Joe  (9.9)
2 Veto  (9.9)
3 Facet  (9.8)
4 Mirage  (9.7)
5 Duce  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.048 sec.