Oric SID tunes now as MP3

Probably the most technical forum around. It does not have to be coding related, or assembly code only. Just talk about how you can use the AY chip to do cool sounding things :)
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

beware of C64 fans cursing, the AY chip in the ORIC has nothing to do with the legendary SID in C64 :)
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

I've actually just returned from X-Party 2006 in Holland which was a C64 only demo party run every two years. 153 people turned up, a little more the the total population of Oric users (active and inactive) hehe.
Anyway, i showed the guy in charge of HVSC (High Voltage SID collection) some of the SID tune i'd converted and he thought they were very cool, and didn't get upset at all ;)
Britelite, a Finnish coder from the famous Dekadence C64 group also heard the double speed tune and thought it was amazing.
I have had alot of positive feedback regarding this, but not sure how to progress it, since the actual areas used by each SID is a little unknown.

Some SID music won't work at all (eg. Some of Follin Brothers works) because they access page 3, corrupt page zero or the screen.
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

Oh yeah because of embedded code... looks like it'll need a vm or so :D
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

I just wish their was a way to see what areas of memory a sid play routine corrupts.
This way we could develop more demos or even games using sid tunes.

However because the SID tune player is a virtual emulator running under 6502, it uses alot of cpu power to perform the conversion.

Most of the cpu power is used up transforming the 16bit pitch of the C64 SID to the 12 Bit pitch of the AY8912 Oric. And no, it is not a simple matter of chopping off the top 4 bits :(

However for title screens this music is fine :)
aeeben
Private
Posts: 1
Joined: Mon Jan 08, 2007 7:58 pm
Contact:

Post by aeeben »

I wrote a little piece of code which emulates the C-64 SID sound chip on VIC 20. Just like in your SID emulation, patched versions of the actual original C-64 music routines are used, only the SID part is emulated.

But since VIC 20 sound chip is so crappy, I wrote a little tone generator which outputs 6.1kHz sample.

Here's two examples that run on unexpanded VIC 20:
http://www.cncd.fi/aeeben/temp/upside.prg
http://www.cncd.fi/aeeben/temp/zoids.prg

(Working fine in VICE xvic when you turn off all extra memory and reset the emulator. Also check that audio timing method is in 'exact' mode)

Some sounds recorded from VICE:
http://www.cncd.fi/aeeben/temp/vic20-si ... dedown.mp3
http://www.cncd.fi/aeeben/temp/vic20-sid-emu-zoids.mp3
http://www.cncd.fi/aeeben/temp/vic20-si ... mmando.mp3
http://www.cncd.fi/aeeben/temp/vic20-sid-emu-uuno.mp3

What is emulated?
- Pulse wave (32 widths), triangle, sawtooth, noise
- ADSR envelopes, but decay and release are linear and there's only 8 volume steps
- Pitch accuracy is 1/13th of SID
- Output at 6.1 kHz, 4-bit volume register 'DAC' ($900e)

The routine uses almost all rastertime (depending on playroutine used) and if there's any cycles free from NMI & IRQ, it runs in a busy loop generating random numbers to improve the noise emulation.

I talked with dbug on #c-64 and it should be possible to port this routine to Oric too. VIC 20 has two VIA chips and I'm using Timer A of both chips (6.1 kHz tone generator interrupt and 50 Hz frame interrupt). But it should be doable with just one VIA by branching depending on which timer raised the interrupt.

Here's the source:
http://www.cncd.fi/aeeben/temp/sidemu_source_v0.zip

cheers,
ae
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

The most time consuming aspect of SID tunes on the Oric is the realtime conversion of the Pitch. C64 pitch is based on a 16Bit entity, on the oric the Pitch is 12 Bit. I remember that the conversion is not just a simple shift sequence but consists of a math conversion (Alot of fast division). I increased the speed of the conversion by using some advanced division routine source.
Unfortunately, the limit is easily seen with double speed tunes (The volume bars in the demos update rarely), and producing a 6.1Khz or less synthesised sound during this process is just not viable on the 1Mhz machine. :(
Post Reply