Richi_S Posted July 5, 2009 Share Posted July 5, 2009 (edited) For my games I've developed a sound system trying to max out the TIA chip. It's based on two Ideas: A two channel tracker system like in *.MOD files (A Index Table pointing to the Note-patterns, Instrument Table used for teh pattern) 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. 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. 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. 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 July 5, 2009 by Richi_S Quote Link to comment Share on other sites More sharing options...
Richi_S Posted July 5, 2009 Author Share Posted July 5, 2009 (edited) 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. Edited December 16, 2009 by Richi_S Quote Link to comment Share on other sites More sharing options...
Richi_S Posted July 9, 2009 Author Share Posted July 9, 2009 Here is another sound demo. This time I'm making barely use of the special instruments. song2.bin I'm going to upload a demo the next days that shows the full capabilities of the sound system. Quote Link to comment Share on other sites More sharing options...
B00daW Posted July 17, 2009 Share Posted July 17, 2009 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. Quote Link to comment Share on other sites More sharing options...
Richi_S Posted July 18, 2009 Author Share Posted July 18, 2009 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 Quote Link to comment Share on other sites More sharing options...
Richi_S Posted July 22, 2009 Author Share Posted July 22, 2009 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. Quote Link to comment Share on other sites More sharing options...
Richi_S Posted July 27, 2009 Author Share Posted July 27, 2009 Please watch my new Topic: In Game Sound Engine Quote Link to comment Share on other sites More sharing options...
Richi_S Posted September 25, 2009 Author Share Posted September 25, 2009 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! Quote Link to comment Share on other sites More sharing options...
Richi_S Posted October 13, 2009 Author Share Posted October 13, 2009 So, how is the development of the Sound System going on ... Now the Main Instrument is working das described and it seems like I'm still below 3 scanlines!!!! In the new demo I had been playing around with the ADSR Envelope function, getting a nice reverb effect. moosic.bin Quote Link to comment Share on other sites More sharing options...
Richi_S Posted December 15, 2009 Author Share Posted December 15, 2009 (edited) During the Christmas season I'll have the system finished. Currently I'm fixing the last minor glitches... Meanwhile there is another teaser, which sure is not so lame as the previous one. music.bin Edited December 16, 2009 by Richi_S Quote Link to comment Share on other sites More sharing options...
RevEng Posted December 16, 2009 Share Posted December 16, 2009 Way cool - I'm looking forward to the official release! Quote Link to comment Share on other sites More sharing options...
KevinMos3 Posted December 18, 2009 Share Posted December 18, 2009 This is very nice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.