| |
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! |
|
| |
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. |
| |
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 ... |
| |
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. |
| |
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). |
| |
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.) |
| |
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? |
| |
Frantic
Registered: Mar 2003 Posts: 1627 |
Yes |
| |
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. |
| |
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 |