Jump to content
IGNORED

A2600 Music


Der Luchs

Recommended Posts

Done ;-)

Very crude though.

Coming from Germany as well I figured you'd want a PAL player?

http://enthusi.de/player.bin

 

Dont mind the overly flashy colors.

It can _almost_ read in Bas Datas.

As this is normal assembler, instead of

12,0,4

0

 

I use/need

.byte 12,0,4

.byte 0

 

But this might differ for other coders using different assemblers.

And seriously, the BB music format is VERY simple. Any coder can utilize it if he sees it.

Take me, I was not aware at all of the way BB handles it and it took like 5 Minutes in total.

 

Nice one btw.

Do you compose for PAL or ntsc?

 

Cheers,

Martin

 

PS: one drawback of the BB format is that you can only play with ONE duration for both channels. That's quite a no-go imho.

There is really no need for that limitation though. You can basically write two chans with its own duration per note. Not sure if BB can handle it.

Doesnt seem so. But for an independant player its really not much extra work.

Edited by enthusi
Link to comment
Share on other sites

K, over 150 Views, I think most of the Coders know this Topic now.

Because of this, to all A2600 Coders:

Do you need me here, to compose some Tunes for your Games or will you handle it by yourself?

No problem if you wanna compose by yourself, then I will concentrate on the Lynx Coders and

don't need to look here anymore ;)

 

Or as "the Clash" would say: "Should I stay or should I go" :grin:

 

Definitely stay! :)

It would be fantastic if you could write a catchy tune for the ASDK demo's:

http://atariage.com/...b-and-the-asdk/

 

The next chapter is going to be on editing the music table, I will translate your bB example and integrate it into the chapter.

 

I also have a game I'm working on that needs a cool background tune that I will PM you about :)

Link to comment
Share on other sites

What I don't understand is, how can the A2600 "emulate" 3,4,5 Instruments at the same time, when the A2600 only got 2 Channels?

Is that something like: this music works only on the Emulator, but not on real hardware?

Edited by Der Luchs
Link to comment
Share on other sites

What I don't understand is, how can the A2600 "emulate" 3,4,5 Instruments at the same time, when the A2600 only got 2 Channels?

Is that something like: this music works only on the Emulator, but not on real hardware?

It's the same as a pair of speakers that can "emulate" an entire orchestra performing in stereophonic sound, or even a one-speaker monophonic system playing back a musical recording. The sound waves for the sounds are added together to create a complex wave. :)

 

To do this on the Atari 2600 you use the "always on" wave, then vary the volume (amplitude) to create complex waves. The catch is that each of the 2600's audio channels can play only 4-bit sound waves, or amplitudes from 0 to 15. So if you want a single channel to play multiple notes at the same time, the sum of their amplitudes can't exceed 15. For example, you can have three sounds, each with an amplitude of 5 (0 to 5), so their sum will never exceeed 15 (0 to 15). The other catch is that it takes a lot of processor time to compute the next value for a complex wave. The Harmony "cheats" by letting the ARM co-processor do the calculations in the background. :)

Edited by SeaGtGruff
Link to comment
Share on other sites

Considering how primitive the 2600 sound hardware is that's pretty impressive. Is it possible to the harmony notes quickly up and down an octave at 30 times a second?

 

This would give the illusion of a third sound channel, give more bass/depth and does not have the overheads of mixing. :)

Link to comment
Share on other sites

Even without a Harmony cart-- i.e., using just the built-in waveforms and frequencies-- you can play different notes as fast as you can change them, or several times per scan line. However, that obviously has practical limitations, since a given note may have a frequency that requires the wave to play for at least several scan lines in order for a single cycle of the note's wave to play. So yes, you can certainly alternate between different notes at 30Hz. However, the result is a series of notes that rapidly alternate between each other, as opposed to a true chord sound.

 

On the other hand, you can create some chords using harmonics, by defining a waveform that combines multiple harmonics. The resulting notes will be slightly "out of tune" as judged by equal temperament tuning, but they'll actually be more pleasing because of the harmonic resonance or consonance. For example, a major chord consists of P1, M3, and P5-- perfect unity or the base note of the chord, the note that's up a major third from the base note, and the note that's up a perfect fifth from the base note. The just intervals for those are 1:1 (P1), 5:4 (M3), and 3:2 (P5). If you go up a couple of octaves and start with the P5 note-- equivalent to playing G4-C5-E5 instead of C4-E4-G4-- the harmonics are 3, 4, and 5. So if you pre-define a waveform that combines the 3rd, 4th, and 5th harmonics, and play it at the frequency of C3, you'll get a chord that sounds like G4-C5-E5. Or if you play the wave at the frequency of D4, you'll get the chord A5-D6-F#6. Then you don't need to compute the next value of a complex wave, you just have to play the pre-defined wave at whatever frequency is needed to get a particular major chord-- or rather, the second inversion of that major chord.

 

The catch is that you don't get the equal temperament notes, and more importantly you're limited to a specific type of chord for each pre-defined waveform. But you could define a set of waves that mix certain harmonics together at different amplitudes to emulate the drawbars of an organ, or something like that.

Link to comment
Share on other sites

Well volume-adjustments to mimic (in principle) any instrument (aka sampling) is not at all feasable for games though since this requires multiple updates per frame.

A 60Hz sample just doesnt sound right ;-)

 

Well, afaik Boulderdash does this during the Title-screen ;-)

Edited by enthusi
Link to comment
Share on other sites

Well volume-adjustments to mimic (in principle) any instrument (aka sampling) is not at all feasable for games though since this requires multiple updates per frame.

A 60Hz sample just doesnt sound right ;-)

 

Well, afaik Boulderdash does this during the Title-screen ;-)

The TIA updates the audio output twice each scan line-- well, in theory at least, since each of the two audio clocks are generated twice during each scan line, although the selected frequency setting lets through only certain clock pulses (i.e., every pulse, or every other pulse, or every third pulse, or every fourth pulse, etc.). If you're controlling the audio by varying the volume-- whether doing the wave or frequency computations yourself or letting the ARM co-processor do them for you-- then it's best to update the volume at least once per scan line, otherwise you can't produce the higher notes. The NTSC TIA's line rate is about 15699.89Hz, so updating the volume once per line will let you produce frequencies up to about 7849.945Hz (approximately B8, higher than the highest note on a piano, but less than the full range of MIDI notes). If you update the volume twice per line you can go up to 15699.89Hz (approximately B9, a little more than the highest MIDI note-- assuming the MIDI note values haven't been transposed up an octave or more).

 

Many games probably don't have enough free time during each scan line to allow for updating the volume even once per scan line, at least not during game play. But most title screens probably do have enough free time for this, especially if the ARM co-processor or the DPC chip is being used. If you're doing the frequency computations yourself, there's barely enough time left for updating the VBLANK and VSYNC registers during each frame, let alone drawing a screen display.

Link to comment
Share on other sites

THIS is NOT the way people generate nice tunes in demos etc.

How do they do it in demos? Obviously not with the ARM co-processor (unless it's a Harmony demo). The TIA can make some decent music by itself-- maybe not "in tune" in terms of equal temperament and A4=440Hz, but certainly "in tune" in terms of just intonation. As for PWM-- how would you do that if not by changing the volume manually?

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