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 Composing > GoatTracker 2 Filtering Question
2021-10-09 08:13
acrouzet

Registered: May 2020
Posts: 80
GoatTracker 2 Filtering Question

Hi there.

I’m considering switching from SidTracker64 to GoatTracker 2, and have been reading some GT2 usage guides in order to figure out how the program works. Although most of what I’ve read seems rather straightforward to me, I have a question about GT2 that I couldn’t find an answer to in any of the guides that I’ve found.

My question is: How does GT2 determine which channel controls the filter when/if multiple instruments utilizing the filter-table are being played at the same time?

I’m hoping that you’ll be able to shed some light on this matter.

Thanks!
2021-10-09 10:14
Conrad

Registered: Nov 2006
Posts: 833
The filter routine is executed first, and from there it does a sequence of JSR's to the voice update routine, like this:
	(filter routine)

	...

	ldx #$00
	jsr voice_routine
	ldx #$07
	jsr voice_routine
	ldx #$0e
voice_routine:
	(code)
	...
	rts


Where X holds the offset for the start register of each voice... i.e $d400,x

ldx #$0e represents voice 3, therefore the 3rd channel will be the highest priority of setting up the filtering, whether it's from an instrument or a pattern command.

So, if you have a note / instrument in channel 1 and channel 3 that both have a filter setting, channel 3 will always override channel 1.


If the JSR sequence was the other way round (i.e. ldx #$0e, ldx#$07, ldx#$00) ... then channel 1 will be highest priority of setting up filtering.
2021-10-09 10:18
spider-j

Registered: Oct 2004
Posts: 444
The channel bitmask is part of the filter program.
From the readme:
80-F0 Set filter parameters. Left side high nybble
     tells the passband ($90 = lowpass, $A0 = bandpass
     etc.) and right side tells resonance/channel
     bitmask, as in command BXY.


So from left to right this would be:

PASSBAND UNUSED/0 RESONANCE CHANNELBITMASK

ie.:
90 81 = lowpass, resonance $8, channel 1

channel bits are
001 ($1) - channel 1
010 ($2) - channel 2
100 ($4) - channel 3

If you need filter on multiple channels it would be i.e.:
101 ($5) - channel 1+3
011 ($3) - channel 1+2
... etc ...
2021-10-09 12:55
Frantic

Registered: Mar 2003
Posts: 1627
Interesting. I thought it was an established standard for music players, and especially the more widely used ones, to automatically enable/disable filter on various channels depending on whether the instrument that is currently played on a channel is supposed to be filtered or not.
2021-10-09 15:41
vincenzo

Registered: Sep 2003
Posts: 78
Quote: Interesting. I thought it was an established standard for music players, and especially the more widely used ones, to automatically enable/disable filter on various channels depending on whether the instrument that is currently played on a channel is supposed to be filtered or not.

Afaik SID-Wizard and DMC don't care about channel masks and just trigger the filter whenever any instrument wants to use the filter. Usually, Channel 1 has priority over Channel 2, and Channel 2 has priorit over Channel 3 if multiple instruments require filter.
Also afaik, this is not really common in other editors and for example SID Factory (and many more that I tested this year, check out The C64 Grand Tour Challenge *hint hint*) doesn't trigger the filter in case an instrument wants to use it but the Channel mask doesn't match the Channel where the instrument is used. Or they trigger the filter but completely messes up the filter values. Both methods have pros and cons when composing music, I couldn't really pick which method is more useful (or useless).
2021-10-09 16:07
Frantic

Registered: Mar 2003
Posts: 1627
Thanks for the information. Yes, obviously my impression of what is common among other editors is wrong.

(I probably remember wrong in this case too, but the way I remember the JCH's Newplayer it had the "auto enable/disable filters on current channel" feature, and I thought SID Factory was based on this player. Anyway.. I guess I am getting off topic here.)
2021-10-09 20:04
acrouzet

Registered: May 2020
Posts: 80
Quote: The channel bitmask is part of the filter program.
From the readme:
80-F0 Set filter parameters. Left side high nybble
     tells the passband ($90 = lowpass, $A0 = bandpass
     etc.) and right side tells resonance/channel
     bitmask, as in command BXY.


So from left to right this would be:

PASSBAND UNUSED/0 RESONANCE CHANNELBITMASK

ie.:
90 81 = lowpass, resonance $8, channel 1

channel bits are
001 ($1) - channel 1
010 ($2) - channel 2
100 ($4) - channel 3

If you need filter on multiple channels it would be i.e.:
101 ($5) - channel 1+3
011 ($3) - channel 1+2
... etc ...


So from what I understand, channel 3 has priority over channel 2, and channel 2 has priority over channel 1?
2021-10-09 23:02
Frantic

Registered: Mar 2003
Posts: 1627
Yes
2021-10-10 01:17
acrouzet

Registered: May 2020
Posts: 80
Quote: The filter routine is executed first, and from there it does a sequence of JSR's to the voice update routine, like this:
	(filter routine)

	...

	ldx #$00
	jsr voice_routine
	ldx #$07
	jsr voice_routine
	ldx #$0e
voice_routine:
	(code)
	...
	rts


Where X holds the offset for the start register of each voice... i.e $d400,x

ldx #$0e represents voice 3, therefore the 3rd channel will be the highest priority of setting up the filtering, whether it's from an instrument or a pattern command.

So, if you have a note / instrument in channel 1 and channel 3 that both have a filter setting, channel 3 will always override channel 1.


If the JSR sequence was the other way round (i.e. ldx #$0e, ldx#$07, ldx#$00) ... then channel 1 will be highest priority of setting up filtering.


Apologies, I meant to quote this in my last post.
2021-10-10 09:46
Conrad

Registered: Nov 2006
Posts: 833
Yes, to both my and Spider-J's post. ;)


Just try it yourself in GT editor ...

1.) Edit pattern 00 with a note and instrument that sets the filter table index.
2.) Copy this pattern into pattern 01 and 02.
3.) In Pattern 02 (this is on channel 3), change the instrument to one that has a different filter table setting.


Obviously you'll need to program the filter table, something like:

01:90 f7
02:00 10
03:40 02
04:ff 00
05:90 f7
06:00 20
07:18 ff
08:ff 00


Instrument 1 Filter Index = 01
Instrument 2 Filter Index = 05
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
Apollyon/ALD
Freeze/Blazon
wil
MCM/ONSLAUGHT
Bieno/Commodore Plus
JackAsser/Booze Design
Guests online: 110
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 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
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 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (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 Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

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