Jump to content

SID filters - questions.


kokoon
 Share

Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

If somebody wants to try this, here a quick-start:

with JSynthLib load the TB303 init patch from the patches/midibox_sid_tb303.patchlib file

edit the wavetable sequence:

first row *always* controls the accent, gate and slide

Accent: bit 0-3 (the right digit) - controls sustain of VCA OSC1, if value >= 8, the note will be accented, which means, note will be played louder (due to the higher sustain value), decay of ENV1/ENV2 will be decreased (for filter, which is normaly only assigned to ENV1), and resonance will be slightly higher.

In difference to the original TB303, the VCA sustain has 16 possible values (0...F), but normaly switching between 6 (=no accent) and C (=accent) is enough

Gate: bit 4 (if 1, note will be played)

Slide: bit 5 (if 1, current note will be hold until next note, portamento will be activated)

Examples:

16: plays common note without accent

1C: plays accented note

0C: plays no note, but accent will be set (which means: ENV1/ENV2 decay decreased - nice effects are possible with large envelopes)

36: note will be played with activated slide

3C: note + slide + accent

26: note not played, but slide activated - means: the current note will be the starting point for the slide to the next note, but the current note won't be played (this is something which is very hard to control via MIDI, and which makes TB303 sequencers so special!)

Second row defines the note (see also CC# assignment).

assigned to OSC1 by default (which is enough for the typical TB303 sound), but can also be assigned to other oscillators, or to all three at the same time

Third row: free for use. You can control any CC - or you could play different notes on another oscillator, which results into a very SID like sound. Try also ringmodulation and oscillator synchronization (note that for ringmodulation the triangle waveform must be selected, and that for osc synchronization one oscillator should be heavily detuned)

Most important sound parameters:

Waveform - Saw/Pulse of course. Pulsewidth should be about 70 for typical TB303 sound, with pulsewidth modulation it sounds more SID like

CutOff and Resonance: of course ;-) The range of the cutoff parameter is optimized to the TB303 typical range (I compared this with diversal TB303 emulators)

ENV1: most important element to control the sound characteristic

depth behaves different in TB303 mode (-> "EnvMod") - the Envelope is only positive (= added to Modulation Target), and the "gain range" goes from 0-127

Attack: normaly not available on a TB303, but can produce great effects

Decay: very important - just tweak it during the sequence is played

Sustain: should be used to control the CutOff offset

Curve: assigned to Decay, try different Curve and Decay values

Tip: set CutOff to 0, Resonance to max, start a simple sequence, and change following parameters during runtime: ENV1 Depth, Decay, Curve - change also from Pulse to Saw wave, and back to Pulse

Start to change the notes in Wavetable Row #2, and change the Slide/Gate/Sustain in Row #1

Hint for advanced users - for MIDI clock synchronization with a host sequencer the "MIDI Sync: Wavetable/Arp." flag must be set, and the wavetable rate should be set to maximum (127)

This is all what I can give you within 10 minutes - any open questions? ;-)

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 1 month later...

hey i just thought of something - regarding the 8580's funny filter curve:

now i know that the problem (the steppiness) is in low filter controller resolution in the low frequencies range. maybe it hasn't been stated like that yet but i think it sums it up sufficiently.

AFAIK there's alot of headroom left in the higher freq range (up till the max freq). so - i remember reading about how different filter capacitors for the SIDs result in different filter range. now - i don't remember exactly how capacity affects the filter frequency range but - the big question:

would it be possible to pick different filter capacitors so that the range would change (shift downwards) sufficiently to raise the controller values so we wouldn't have to use the "steppy" ones? it would probably mean that we'd also have to change the mapping table bu maybe different capacitors would also change the frequency curve?

has anyone maybe already experimented with this?

TK i'm really sorry if i'm poking at this unpleasant topic again - it will probably turn out (again) that i'm not getting something right and i'll apologize sinceirly and hope everything will be well  :-*

Link to comment
Share on other sites

Just try different values between 470 pF and 22 nF - note that caps can be combined in order to increase/decrease the value based on the equations: C_total = C1 + C2 (two caps in parallel) and C_total = 1/(1/C1 + 1/C2) (caps in serial)

Best Regards, Thorsten.

P.S.: I and some other guys of the forum tried different cap values long time ago - the filter behaviour gets worse with higher/lower values, but nobody focused to eliminate the stepiness...

Link to comment
Share on other sites

  • 6 months later...

Hi!

Sorry for posting in such an old thread, but it's really the most relevant. This is also my first post on this forum so bare with me!  :)

I started a project a while ago to control a SID chip from the computer, this was before I heard about MIDIbox. I'm not really a musician, more of an electronics guy, so it was more just for the fun of it rather than to actually produce something useful.

While browsing the net for information I discovered MIDIbox SID, and I decided to design my circuit something like this. However, I couldn't find the selected value for the filter capacitor (6.8 nF) used anywhere else. All C64/C128 schematics (and my real C64) use 22 nF with SID 8580. I also found this thread where there were complaints about steppiness in the cutoff frequency and suspected what was the cause.

Now my circuit is up and running and I have run some tests on it to try out the filter characteristics. I measured the cutoff frequency for a set of register values throughout the 11-bit range (1 to 2047). The following results were obtained with C=6.8nF.

[table]

[tr][td]register value[/td][td]cutoff frequency (Hz)[/td][/tr]

[tr][td]2047[/td][td]46300[/td][/tr]

[tr][td]1024[/td][td]22600[/td][/tr]

[tr][td]512[/td][td]11030[/td][/tr]

[tr][td]256[/td][td]5300[/td][/tr]

[tr][td]128[/td][td]2700[/td][/tr]

[tr][td]64[/td][td]1330[/td][/tr]

[tr][td]32[/td][td]673[/td][/tr]

[tr][td]16[/td][td]325[/td][/tr]

[tr][td]8[/td][td]165[/td][/tr]

[tr][td]4[/td][td]82[/td][/tr]

[tr][td]2[/td][td]41[/td][/tr]

[tr][td]1[/td][td]21[/td][/tr]

[/table]

This shows that the value to frequency mapping of the 8580 filter (at least my 8580) is indeed (very) linear! It also shows that the resolution with the proposed filter caps is really bad. The cutoff can only be adjusted in steps of about 21 Hz, which is really hearable in the low frequency range. Also, the cutoff range extends all the way up to more than twice the maximum audible frequency, wasting precious bits of resolution.

I haven't had time to redo the entire test with other capacitor values, but i tried doubling the caps to 13.6 nF and the cutoff for the lowest value sank from 21 to 10.4 Hz. It's seems likely there's linear dependency on the capacitance as well. In that case the relationship between register value, capacitance and cutoff frequency would be approximately CUTOFF = 143 / C * VALUE, where CUTOFF is in Hz and C in nF. The capacitor used in the Real Thing (and therefore by Prophet64) is 22 nF which would give a resolution of 6.5 Hz and a range of 13.3 kHz. Seems far more reasonable to me.

Ooops, this got rather long, sorry.

Link to comment
Share on other sites

By the way, if you're interested in how I did the measurements I set the SID to output a low frequency square wave and turned up the resonance (which is working really well on the 8580  :) ) to max. Then I could easily measure the frequency of the ringing following each step of the square waveform, using a digital oscilloscope.

Link to comment
Share on other sites

Thanks Nattgris! That's the sort of testing I'd like to do, if I had an oscilloscope (and more understanding of how filters work!)

FYI, the 6.8nF (6800pF) value appears in this datasheet:

http://www.joogn.de/b/6582.pdf

Under the pin descriptions for the filter capacitor pins...

... Normal operation of the Filter over the audio range (aproximately 20 Hz - 12 KHz) is accomplished with a value of 6800pF for C1 and C2. .... larger values of C1 and C2 could be chosen to provide more control over the bass frequencies of the Filter. The approximate maximum Cutoff Frequency of the Filter is given by:

FCmax = 8.2E - 5/C

Wheren C is the capacitor value. The range of the Filter extends approximately 9 octaves below the maximum Cutoff Frequency.

Maybe someone can explain that formula to me...

I am also curious to know how the capacitors affect the filter, and would like to hear about any more tests you do!

Link to comment
Share on other sites

I would like to do the same test with a couple of 6581 SIDs to find out how much they differ from eachother. Unfortunately I only have one and I'm not sure it's ok. I will post here when I find out.

If the 6581 behaves in the same way as the 8580 (if it has a linear mapping between value and cutoff, and if cutoff is proportional to capacitor value) you could derive a formula for the cutoff similar to the one i gave above for 8580. If the constant is more or less the same for different 6581 SIDs (as we know there could be huge differences between chips) you could make a general formula like

CUTOFF = K / C * VALUE

where K depends on the type of SID used and C is the capacitor used. This means it's possible to calculate MIDIbox SID's mapping between CC value and SID register value at compile time to get the same frequency characteristic from the filter no matter what SID and capacitor you use. However, the response will of course be either steppy or limited in range if you choose a capacitor unsuitable for your SID.

My main point is that by making the cutoff frequency you get from a certain CC value the same in all implementations of MIDIbox SID, it becomes easier for people to share patches that sound the same for everyone, while providing the freedom for each user to choose the tradeoff between low frequency filter resolution and filter range depending on his needs.

Link to comment
Share on other sites

Gotta say man, this is some good work. It's exactly the sort of thing that interests me as well.

I just want to makes sure i'm understanding what you're proposing here, if this is correct:

By raising the value of the filter capacitors, the filter will sweep down below 20Hz. This means that at the lowest settings, the filter will effectively mute the output? At the highest frequencies, the filter is effectively acting as an allpass filter, so some of that higher range is not really needed either.

Therefore you propose to sweep over a lower range (say 10-90% for clarity), so that you get better resolution in the lower frequency ranges?

Link to comment
Share on other sites

I actually don't propose anything, I'm just telling you what I found out and you can do whatever you want with the information. As I said, I'm not a MIDIbox user myself, so I don't think I'm in a position to propose changes to it. :)

Let me see if I can explain...

I discovered that the 8580 cutoff frequency is proportional to the 11-bit value in the cutoff register and inversely proportional to filter capacitance. That's it. In mathematical terms you could write CUTOFF = K * VALUE / C. The proportionality coefficient K was determined to be about K=143 for the 8580.

What this means is that we have 2048 levels of cutoff to play with. These levels are distributed evenly across the audio spectrum, starting from 0 Hz. If we increase the register by one the cutoff frequency will increase with a fix amount. With the 6.8nF caps everyone seems to be using this amount is about 21 Hz. 21 Hz is a tiny amount when the cutoff frequency is high. Noone can hear the difference between 10000 Hz and 10021 Hz. In the low frequency range however, 21 Hz is very large. Consider the difference between 100 Hz and 121 Hz. It's impossible to select a cutoff between these two. No wonder a sweep of the cutoff sounds steppy.

In the same time, the maximum cutoff frequency available is 21 Hz * 2047 = 43 kHz. This is far above what anyone can hear and a complete waste of levels. I don't think there's a practical use for filter frequencies above 10 to 15 kHz. By redistributing our 2048 levels to this frequency band (by change of capacitors) the levels will get spaced much tighter, providing greater resolution which is badly needed in the low frequency region.

For example, using 22 nF capacitors as in the real C64 gives us a maximum cutoff of CUTOFF = 143 * 2047 / 22 = 13.3 kHz with a resolution of 13300 / 2047 = 6.5 Hz. That is more than three times as many steps in the useful frequency band, giving us a much smoother sweep.

Again, this is completely a hardware issue, and nothing Thorsten could program can remedy the lack of levels. It's simply because the 8580 maps the values linearly to cutoff frequency. Initial testing of a 6581 suggests that its filter has an exponential mapping, giving much finer control over low frequencies at the "expense" of coarser control at high frequencies.

Now to address your questions directly, Jaicen...

By raising the value of the filter capacitors, the filter will sweep down below 20Hz. This means that at the lowest settings, the filter will effectively mute the output?

At the lowest setting (zero) the output will certainly be muted (assuming a LP filter). At the lowest practical setting (one), the passband is still too low to hear the output (unless you have sub-sonic hearing. You might still feel it though, if you have mighty speakers. :) )

At the highest frequencies, the filter is effectively acting as an allpass filter, so some of that higher range is not really needed either.

Again, assuming a LP filter, it will be more or less an allpass. At least if the maximum cutoff is chosen high enough to include most of the harmonics the SID can produce.

Therefore you propose to sweep over a lower range (say 10-90% for clarity), so that you get better resolution in the lower frequency ranges?

Not really. More the other way around. With the current cap value the filter extends all the way up to 43 kHz which means only part of the range is usable (say 0% to 40%). With a bigger cap (say 22 nF) the filter only reaches 13 kHz (still high enough for most purposes) making the entire range of the filter (0% to 100%) usable.

Link to comment
Share on other sites

I'd also wanna test it with highpass and bandpass...

Would you mind measuring what freq does the oscillator roll off at? No point in making the high point of the filter cutoff higher than that.... I checked the datasheet, but to make the formula work I need to know what rate is the SID clocked at. If anyone knows off the top of the head, could you tell me, otherwise I have to code-dive ;)

FCmax = 8.2E - 5/C

FCMax = Filter Cutoff Maximum

C= capacitor value

The E thing is scientific notation (exponential), where the E represents "times 10 to the power of"

You could say FCMax = 8.2*10-5/C

The C value is measured in whole farads. Nanofarads are farads*109

pmaCalc will take this equation: (I highly recommend that software! Really, check it, it's free, and it's small, and it kicks serious ass, test it for 10 minutes. No I don't work for them hahahah)

8.2E-5/(CE-9)

Just punch in your value for the capacitor where I have the C. For 6.8nF:

8.2E-5/(6.8E-9)=12058.823529412

for 2.2nF

8.2E-5/(2.2E-9)=37272.727272727

For 22nF it's 3727.2727272727, which is a lot lower than we thought....

Now how do we know that changing the values might not change the linearity of the cutoff?

Speaking of which, making the curve exponential would be fantastic ;) Full range, and good control in low freq's.... Nice.

Link to comment
Share on other sites

For 22nF it's 3727.2727272727, which is a lot lower than we thought....

Remember that equation is taken from the 6582 data sheet. It does apparently not apply to the 8580. As hardly noone has ever seen one of those SIDs i don't think it's relevant.

Interesting to note is that this equation together with the suggested 6.8 nF (all from the 6582 data sheet) gives about the same frequency range as the 8580 does with the recommended cap for that SID (22 nF).

Link to comment
Share on other sites

Would you mind measuring what freq does the oscillator roll off at? No point in making the high point of the filter cutoff higher than that....

The maximum oscillator frequency at 1MHz (is anyone using anything other than that?) is 3929 Hz. Now it's still perfectly sane to have a filter that extends far above 4 kHz since the waveforms have high levels of harmonics. 3rd harmonic is at 12 kHz.

Now how do we know that changing the values might not change the linearity of the cutoff?

We don't, yet. I will make a full test after I've played around with the 6581 (it works!  ;D ) and switched back to the 8580. But considering the physics behind the filter I'd say it's linear. The caps are used to set some form of time constant in the filter. Changing this time constant would scale the time linearly and the cutoff would still be linear.

Link to comment
Share on other sites

The E thing is scientific notation (exponential), where the E represents "times 10 to the power of"

Oh, that E... doh!  :-[

Remember that equation is taken from the 6582 data sheet. It does apparently not apply to the 8580. As hardly noone has ever seen one of those SIDs i don't think it's relevant.

I think it is relevant. Depending on which theory you believe, the 6582 is either an 8580 prototype, or a new revision of the 8580... what I know for sure is that the 6582 has a filter that works and sounds the same as the 8580, at least in my MBSID with 6.8nF ceramic caps and by my untrained ear. I should try some 22nF capacitors too, but I'm not sure what I should be listening out for, or how to measure the difference, or how much the frequency mapping between the CC value and the actual SID registers masks the real difference.

Interesting to note is that this equation together with the suggested 6.8 nF (all from the 6582 data sheet) gives about the same frequency range as the 8580 does with the recommended cap for that SID (22 nF).

Can you explain that a bit more?

Link to comment
Share on other sites

what I know for sure is that the 6582 has a filter that works and sounds the same as the 8580

There is another thread on this forum where someone has compared the 6582 to the 8580 by ear and concluded that there is a difference in the filters. He posted two sound files to compare them too. I haven't listened to them, but i suspect if there is a difference it might very well be due to the same capacitors have been used for both SIDs.

Can you explain that a bit more?

Well, by looking at the 6581 data sheet you learn that the recommended capacitor is 2200pF and that this would give a range of 30Hz to 12kHz.

The 6582 data sheet is more or less identical, but the recommended capacitor is instead 6.8nF for a range of 30 Hz to 12 kHz.

The 8580 data sheet ... well... is there one? What we DO know is that the capacitor chosen by Commodore for the machines using 8580 is 22nF. After my measurements on a 8580 I concluded that 22nF capacitors would give a range of 0 Hz to 13 kHz. Hmm, this is about the same as the other two with their recommended capacitors, respectively.

This makes it seem likely that Commodore designed the different SIDs to be used with a filter range of 13 kHz and that the capacitors to use for the different SIDs are 2200pF for 6581, 6.8nF for 6582 and 22nF for 8580.

However, as we know, the filter in 6581 is not up to spec, and it could differ a lot between revisions and even between chips of the same revision. For example the 6581 I have on my desk needs about 1nF to get a range of 12 kHz.

Link to comment
Share on other sites

That makes two of us. I heard those 6582a's and I instantly wanted some :)

So did I. Now I have too many.  ;)

This topic really interests me because I really want to tweak the filter caps on the 6582... so my earlier comment about the 6582 sounding the same as the 8580 is not based on Razmo's demos, it's on first hand experience. To my ear, when both have 6.8 nF caps, they appear to have the same cutoff frequency.

I just did a very, very quick test: with the 6582 and 8580 both using 6.8nF capacitors, and a simple pulse waveform, and lowpass filter, I get the same sound out of both. If I increase the 8580's capacitors to ~22nF, I need to change its cutoff CC to be 20 higher than the 6582's cutoff to get the same sound, i.e. CC=60 on the 6582/6.8nF is the same as CC=80 on the 8580/22nF. I'm not really proving anything scientifically here, but I'm pretty confident that a 6582/6.8nF does not have the same cutoff range as an 8580/22nF. I also stick by my earlier statement that a 6582/6.8nF has the same cutoff range as an 8580/6.8nF. All the filter-modulating patches sound the same.

Link to comment
Share on other sites

Has anyone verified that the filter works on the external input? Mine doesn't seem to. I silence all voices, and feed an externally generated waveform into the SIDs input. When I enable the FILEX bit the output amplitude drops to about half, but the cutoff doesn't affect the output at all.  >:(

Link to comment
Share on other sites

Hi everyone!

I've just been reading this thread, and thought I'd give my words on it too... interresting info here  :)

Well... to the statement about the 8580/6582 being linear in it's filter depends on how you look at it i feel... With the 6581, when you move the cutoff "fader" from min to max, the frequency is swept in a way, so that it sounds as if it has an equal amount of change over the entire range of the cutoff "fader". This way to me is the best way since it makes the resolution of the whole frequency range even in the whole spectrum (if the 6581 filter "works" in it's full range that is).

With the 8580 this evenness in the whole spectrum has changed, so that the lower the frequency, the worse resolution you get. you can check it out very easily, just burn the 6581 MBSID version and use that with the 8580, and then sweep the cutoff "fader"... you will notice how the range of the low frequencies have diminished greatly! ... this is how it sounds if you fade the cutoff register in a linear fashion...

To be able to use the 8580 in the same way as the 6581 filter (in a way that will give you even fading of the cutoff freq) you have to see the cutoff register the same way as you set the frequency registers... With the frequency registers you set a pitch an octave higher by multiplying the frequency register's value by 2... if you want that an octave higher again, you multiply that value by two... it's like: oct 1 = 100, oct2 = 200, oct3 = 400 etc. this also makes it clear, that setting the frequency in fine increments is at a much lower resolution in the lower range... EXACTLY as the 8580 filter does it... in essence, the filter is just controlled like the frequency... and why would they make it this way?... well possibly because it's digitally controlled on the 8580, and this is more easy to handle this way (something with the inner workings of a phase accumulating oscillator scheme)... and the bonus is also, that it's pretty easy to tune the filter properly making it possible to have the filter follow the keyboard etc.

So if you say, that the 8580 is linear, it's partly right, ... I believe the filter itself is linear, but is controlled logarithmically from the digital control...

Hope some of this was understandable  ???

Regards, Jess.

P.S. yep! I used the same standard 8580 filter caps on both of the demos I made here on 8580 and 6582  ;)

Link to comment
Share on other sites

In conclution to teh above; I find that it's not the analog filter that is limited... it's the digital control curcuit that has it's limits... to make the 8580 work linearly as the 6581 what you do is that you simply use the same freq. table you use for looking up note frequency values, and scale these values to the right amount of bits for the cutoff frequency register (freq. is 16 bit, cutoff 11). This is why the 8580 filter sounds "steppy"... now TK has made some interpolating code in the engine to smooth out this effect, but since the range of values to smooth between gets lower and lower in the bottom range, you cannot avoid the steppiness in the mighty lowest of register values...

Now I do not know much about filter caps, but if changing the caps could indeed make the response curve of the analog filter logarithmic INSTEAD of linear, then the analog filter curcuit would follow the same logarithmic working as the digital control curcuit that controls the analog filter, and the frequency range for the filter would be much much better!... I'll leave that to the hardware techs!!!  ;D

Regards, Jess.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...