Jump to content
IGNORED

Yet another sound system


Richi_S

Recommended Posts

For my games I've developed a sound system trying to max out the TIA chip.

It's based on two Ideas:

  1. A two channel tracker system like in *.MOD files (A Index Table pointing to the Note-patterns, Instrument Table used for teh pattern)
  2. So called "Special Instruments" that can be assigned to the Instrument used. This alows special waveforms. Every time a key is hit, the waveform is restated.

 

post-23660-1246821883_thumb.jpg

 

  • This system can easily fit in the overscan area (about 5 scanlines needed).
  • Due to the separation of the Tracker and the Instrument modification table a minimum of ROM space is needed.
  • 16 Byte of RAM needed (could be optimized to 12 Byte)

 

The Tracker:

Based on the 60Hz TV Picture cycle a timer is used with a prescaler. This allows variable BPM.

 

post-23660-1246821497_thumb.jpg

 

 

Music_Song0_Pattern

-> Pointer To the Pattern to be played

 

Music_Song0_Instrument

-> Instrument of the Pattern (High Nibble: Special Effect, Low Nibble: TIA Instrument: AUDC0)

 

Music_pattern0_AUDF

-> The patterns "Music_Song0_Pattern" is pointing to. These values represent the Base frequency Loaded

 

Music_Song0_Pattern
        ;Audio0: pointer to the Patterns (1 Pattern = 1 Beat)
        ;        Intro                             Main                                            
        ;         |                                 |                                  
        ;        0    1    2    3    4    5    6    7    
        .byte #$00,#$00,#$08,#$08,#$10,#$10,#$18,#$18

Music_Song0_Instrument
        ;Audio0: "Instrument" of the Pattern
        ;        0    1    2    3    4    5    6    7  
        .byte #$01,#$01,#$11,#$11,#$21,#$21,#$01,#$01

Music_pattern0_AUDF
        ;Audio0: Frequency / Tone Base: 1/8 (0..31 = Tones, 99: Pause)
        ;Intro
        ;$00 - Pattern 0
        .byte  #15,#15,#15,#15,#15,#15,#15,#15
        ;$08 - Pattern 1
        .byte  #14,#14,#14,#14,#14,#14,#14,#14
        ;$10 - Pattern 2
        .byte  #13,#13,#13,#13,#13,#13,#13,#13
        ;$18 - Pattern 3
        .byte  #12,#12,#12,#12,#12,#12,#12,#12

 

The Special Insrument:

Every 60 Hz the Registers AUDFx and AUDVx are updated from the designated tables.

If a new note is loaded from the Tracker tables, the Pointer for the special instrument tables is updated.

 

The High Nibble of "Music_Song0_Instrument" is shifted 4x low. and used as a index for Music_special_instrument_pointer.

 

post-23660-1246821140_thumb.jpg

 

Music_special_instrument_pointer

-> The Start address in the Music_special_AUDF_table and Music_special_AUDV_table.

 

 

Music_special_AUDF_table

-> AUDFx Modifier: AUDFx = Music_pattern0_AUDF + Music_special_AUDF_table

 

Music_special_AUDV_table

-> AUDVx Modifier: AUDVx = Music_special_AUDV_table

 

Music_special_instrument_pointer
        ;Special Instrument # (Pointer to: Music_special_AUDF_table / Music_special_AUDV_table)
        ;      $0x $1x $2x
        .byte  #0, #8, #16,#25


Music_special_AUDF_table
        ;Special Instrument Modifications: Frequency
        ;      0    1    2    3    4    5    6    7    8    9   
        .byte  #0  ,#250,#250,#2  ,#2  ,#0  ,#0  ,#0  ,#0  ,#0  

Music_special_AUDV_table
        ;Special Instrument Modifications: Volume
        ;      0     1    2    3    4    5    6    7    8    9   
        .byte  #4  ,#5  ,#5  ,#5  ,#4  ,#4  ,#4 ,#8  ,#8  ,#8  

Edited by Richi_S
Link to comment
Share on other sites

So, what does it sound like...

 

Here is some sound from my current project.

The sound is derived from Contra.

It is demonstrating the tracker Capabilities more than the Special Instrument capabilities.

 

I'm goingt to upload a programm that demonstrates some of the Special Instruments which are possible.

 

post-23660-1246825211_thumb.jpg

Edited by Richi_S
Link to comment
Share on other sites

Looking forward to the next demo, and possibly playing around with the engine.

 

Do you mind listing its capabilities? I'm pretty sure the other current sound engine topic should set an example for a desireable TIA sound engine.

 

Any work done on a new, publically available sound engine is appreciated. :)

Link to comment
Share on other sites

Hi B00daW,

nice idea, in the next days I'm going to dissect the sound engine from the game code and publish it here.

 

A short list this engine features:

1) A Sequencer

2) Every time a new TV frame is drawn the AUDF and AUDV registers are changed (almost like a Synthesizer does).

The AUDF and AUDV value changes are stored in tables, a free runnind pointer is used.

Once a new note is loaded the by the seqencer the pointer on the AUDF and AUDV table is reloaded.

Every pattern in the sequencer can be assigned to a TIA Instriment and a Special Instrument.

So it's basically a tracker without a sampler (Wikipedia has a nice article about it).

 

 

A 30 second Demo:

The song is derived from Contra.

 

Instruments used for the two tracks:

1) TIA Instrument 1 and Sawtooth Envelope, Volume: Piano (done by special Instrument)

2) TIA Instrument 7 and Sawtooth Envelope, Volume: Forte (done byspecial Instrument)

 

moosic_01.bin

Link to comment
Share on other sites

Hi,

again some new demos...

 

The demos are basically the same as moosic_01.bin only the special instruments are changed to experiment around:

The first 5 seconds are the plain TIA instrument, followed by the special instruments.

 

 

TIA Instrument 5 with different Frequency curves:

moosic_02_lfo.bin

 

TIA Instrument 5 with different Envelope curves:

moosic_03_envelope.bin

 

 

TIA Instrument 1 with different Envelope curves:

Moosic_05_envelope.bin

 

I've noticed two bugs in the demos... I'm going to fix them and put the code online subsequently.

Link to comment
Share on other sites

  • 1 month later...

Well, the summer is over and I'm back on the 2600...

 

After playing around with game music and my sound system, I'm doing some mayor changes to it.

I think following approach serves Atari 2600 music programming best:

 

There are two Stella Tracks:

Track 0: The Percussion Track

Track 1: The Main Instrument Track

 

First the Music designer can define the waveform of the Percussion Instruments (there can be up to 32 Percussion Instruments).

Then the Main Instrument Waveform needs to be defined (Envelope, and Frequency Shift), the system will feature the the ADSR envelope known from the C64 SiD Chip.

This allows a wide variety of Instruments and Sounds.

Once the instruments are there, the Notes need to be punched into a sequencer table (this is done like in the old sound system).

Various "Songs" shall be storable (Title Music, In Game, Game Over Screen,...).

Every Song Points to three Beats in the Sequencer table: The "Song Start" Beat, The "Song End" beat, and the "Song shall loop to when it has reached the end" Beat.

 

 

The Game Developer should be able to control the sound system:

1. The two tracks can be attenuated and muted separately from each other. When Muted the Progammer has got full control over the Audio Channel for the games sound effects for example.

2. There will be 4 Songs that can be defined (Title Music, In Game, Game Over Screen,...) the programmer can start them out of his program.

This control are done via a control register (1 byte).

 

The entire sound system will use 8 to 10 bytes of RAM, and it might be feasible to squezze it into the Vsync area.

 

Enough Chit-Chat, how will it sound?

 

This file has got a little Beat box with 7 different Percussion Instruments (the main Instrument is not finished yet). I'm trying out various beats here.

Percussion.bin

 

Please tell me your opinion!

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

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...