News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_redbox

SID Voices

Started by redbox, 14:51, 21 November 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ralferoo

Yeah, that sounds awesome. :) The square waves do make it sound quite harsh, but it's still very nice... :)

redbox

Quote from: BSC on 15:47, 16 December 13
Was this run on a Plus or CPC? It sounds really great! Could you elaborate a bit on how this is achieved technically?  What is this delay thing you mentioned?

This example used the DMA but it would work just the same on a normal CPC if you updated the registers every 64us.  Maybe delay is the wrong word, but I used this because generally by modulating the AY frequency you either delay or shorten the duty cycle of the wave.  I think it's what you referred to it as an offset with your player.

Basically what I did was start with a volume waveform table representing a normal square AY waveform, like this:


defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f,&0f
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00
defb &00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00,&00


Then I worked out the frequency of the note played by the AY.  For example, if reg 2 and 3 total 80, we have:


4000000 (CPC clock frequency) / 64 (line interval) / 80 = 781.25hz


Next I divided this by the AY resolution (15625hz) and the size of the waveform table (256 bytes) to give me the delay (or offset):


15625 / 781.25 = 20     256 / 20 = 12.8


Turn 12.8 into a highbyte and lowbyte so you can use it along with fixed point maths to step through the table.


highbyte = 12 (&0c)
lowbyte = 256 * 0.8 = 205 (&cd)


If you then stepped through the table at this rate you would produce a tone which is pretty much exactly like the AY tone (i.e. it will be 781.25hz).

However, when I was decoding the ST timers used in SID voices I noticed two things - 1) they always use a fixed 50% square tone (they have to because it's just an interrupt trigger timer) and therefore 2) generally they just use very slight frequency changes which overlap the existing tone to alter the duty cycle.

So, for example the "SID frequency" might be 782.25hz (just 1hz higher).  This would make a highbyte/lowbyte offset for our waveform table of &0c/&d3.  The lowbyte here is increased by 6.  Generally, nice effects are found in the 4 to 8 range (Tao uses this a lot) but this can be altered depending on the frequency of the note being played so you don't suffer cut outs and interference.  The Commando MP3 used a static 6.

Now the AY is generating a tone of 781.25hz and we are generating a tone of 782.25hz.  Play them at the same time (and cut the volume to the AY produced tone) and you have a modulated AY tone aka "SID voice".

Gryzor

Wow, Commando sounds really nice! A bit low in the bass region, but a lovely render.

arnoldemu

nice rendition of it!
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

BSC

Quote from: redbox on 21:18, 16 December 13
[...]
Now the AY is generating a tone of 781.25hz and we are generating a tone of 782.25hz.  Play them at the same time (and cut the volume to the AY produced tone) and you have a modulated AY tone aka "SID voice".


Have you been doing anything since? Some new demo sounds maybe? :)
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

sigh

I just listened to Commadno and it sounds really good.


Even more so - it's super useful to hear the comparison between the AY and your SID voices rendering the same tune.

redbox

Quote from: BSC on 14:14, 24 January 14
Have you been doing anything since? Some new demo sounds maybe? :)

Yes, been trying a few things but time a little limited at the moment  :(

One thing I'm really interested in is the 'interpolation' used in your 3rd demo - could you tell me how you do it (maybe in pseudo-code)...?

Quote from: sigh on 15:08, 24 January 14
I just listened to Commadno and it sounds really good.
Even more so - it's super useful to hear the comparison between the AY and your SID voices rendering the same tune.

Thanks - it's more of a classic 'SID' effect like used on the Atari ST, but built for the CPC rather than just importing the ST routines and timers.  I kind of combined the ST way of doing things with BSC's wavetable approach and that was the result so far.

But using wavetables is the key for the CPC as it makes some really sweet sounds like BSC is demonstrating at the moment.

BSC

Quote from: redbox on 15:15, 24 January 14
One thing I'm really interested in is the 'interpolation' used in your 3rd demo - could you tell me how you do it (maybe in pseudo-code)...?

Sure! Here: SID Voices

Joking aside.. The interpolation (of the wave form) is the same in all demos. Just as I described in the post I mentioned.
Maybe you mean something else..? I have the feeling we keep talking at cross-purposes concerning our terminology..
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

redbox

Hmmm, we are doing the same thing ;)

I think your 3rd demo sounds nice because of the frequencies used.

I await the source on GitHub :)

BSC

Quote from: redbox on 17:46, 24 January 14
Hmmm, we are doing the same thing ;)

I think your 3rd demo sounds nice because of the frequencies used.

I await the source on GitHub :)


Yeah, but we name some things differently :D I think the 3rd demo sounds nice because it sounds nice ;-) And because it's a sine wave, not square.


GitHub.. what was that again? *scratcheshead* .. Yeah! I know .. I am a slacker in a way ..
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

TotO

Here, how may look a "tracker/demo" on CPC using the CTC-AY...  :-*


[attachimg=1]
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

BSC

How is your new (plus DMA) engine evolving? You haven't posted anything in a while..
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

redbox

Quote from: BSC on 16:02, 27 March 14
How is your new (plus DMA) engine evolving? You haven't posted anything in a while..

It hasn't evolved much further yet I'm afraid.

Too much real life work :(

Powered by SMFPacks Menu Editor Mod