Jump to content
IGNORED

Another Sampling Test


analmux

Recommended Posts

Hello all,

 

After a busy time I finally have some spare time now (holidays). Before going on a camping trip for two weeks I put something together to play a bit with. I'd like to share it with AA visitors.

 

I was thinking of wavetable synthesis. How would you do it with the 4bit PCM features of pokey?

• I just made wavetable of a triangle wave, with a fixed size of 256 steps.

• The table is read with a variable 'speed', declared by a 16bit value: Resampling speed. For this resampling I let an IRQ kernel compute the table-index.

• I used a timer IRQ (pokey timer 1) with a fixed sample rate of once every 228 cycles (=every 2 rasterlines). So, the best is to use audctl = 1 and audf = 1.

 

Problems encountered: When resampling frequency is not a nice value, some artefacts can be heard.

 

Solutions: I already have some suggestions. I still need to test them some time :)

 

 

Here it is, including sourcecode.

 

• test0 was a mystery, but then I remembered how to use IRQs. You need to reset IRQ when executed.

• test1_$xxxx is just a test of the triangle wave, with a different resampling value.

• test21 is another test. I made an algorithm which modifies the table in a background process

• test22 is just another test. Algorithm slightly simplified.

 

Have fun.

Link to comment
Share on other sites

Without having looked at your program, I have a suggestion (so you might have already used it):

 

Have a 16 bit "Frequency" value.

 

The low byte acts as a "fractional" value. Each iteration of the Timer IRQ, add the frequency to the accumulated value, performing carry etc.

 

So, for example, a frequency value of 0080 would mean the index value increments by 1 every second IRQ.

0040 every 4th, etc.

 

Allows for fine increments, without using too much CPU power. And, has the added bonus that the frequency steps are granular rather than logarithmic like the AUDF countdown method.

Link to comment
Share on other sites

Without having looked at your program, I have a suggestion (so you might have already used it):

 

Have a 16 bit "Frequency" value.

 

The low byte acts as a "fractional" value. Each iteration of the Timer IRQ, add the frequency to the accumulated value, performing carry etc.

 

So, for example, a frequency value of 0080 would mean the index value increments by 1 every second IRQ.

0040 every 4th, etc.

 

Allows for fine increments, without using too much CPU power. And, has the added bonus that the frequency steps are granular rather than logarithmic like the AUDF countdown method.

 

Hmmm, that's funny :D

this is exactly how I already did it.

 

Another method I'd like to test later, in a few weeks, is using again a fixed pokey timer frequency, but now with a fixed 'index speed' of 1 and variable length of the wavetable. (index speed : how much steps will the (x) index count during one IRQ).

 

I still don't have a picture if this would reduce artefacts (due to 4bit PCM resolution). One thing I know: the IRQ code will be shorter, as we don't have to deal anymore with fractional index values.

Link to comment
Share on other sites

Hola,

 

muy interesante e inexplorado el tema, además de ingenioso e ilustrativo tu trabajo. Cuando escuché por primera vez los test de frecuencias bajas, recordé los bajos de la música de NES. :D

 

Grabé en .wav la señal del test, luego las cargué en el GoldWave y les hice ZOOM a la señal y le hice una captura. Se observa una señal portadora extraña (cuadrada?) la cual es la que genera los sonidos extra por armónicos y la triangular que da el sonido que se desea.

 

Si llama la atención cuando cambia de un bit a otro de resolución, hay unos leves picos que quizás se podría aprovechar y aplicar para darle un detalle mas suave con alguna técnica sofisticada, aunque desconozco si eso lo hace solo en la emulación (Atari800win) o también en el Atari real.

 

Salu2

 

--------------------------------

 

 

Hello

 

first, sorry for my poor english. Your work is very interesting and informative. When I first heard the low-frequency test reminded of NES music. :D

 

I saved a ".wav" file with the test sound , load this on "Goldwave" and zoom the wave image, and I made a couple of screenshots. There is a strange signal carrier (square?), which is generate the extra harmonic sounds(FX) and triangular waves which gives the sound you want.

 

 

 

 

Something took my attention when you change one bit to another bit of resolution, there are some little peaks that perhaps could be softened and applied to get a more sophisticated technics, although I don't know whether it does so only in emulation (Atari800win) or in the real Atari too.

 

Regards

post-13235-1215888576_thumb.jpg

post-13235-1215888595_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Hi (Sorry for the long wait, I returned home today from my travels to Austria :) )

 

There is a strange signal carrier (square?), which is generate the extra harmonic sounds(FX) and triangular waves which gives the sound you want.

 

The sample resolution is only 4 bits. That's because it is done by the volume-only mode of a pokey voice. You know volume is only 4 bits. This means there are only 16 different amplitude steps. That's why the 'triangle' cannot be a REAL triangle

 

Something took my attention when you change one bit to another bit of resolution, there are some little peaks that perhaps could be softened and applied to get a more sophisticated technics, although I don't know whether it does so only in emulation (Atari800win) or in the real Atari too.

 

The peaks at the beginning of every step is an effect of pokey internals. Every time a new value is written to a volume register (in volume only mode) a capacitor is charged. After that it will decharge. This causes a fall of the signal. I suspect it happens too on a real machine.

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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...