Jump to content
IGNORED

TIA Perceptual Tuning


RevEng

Recommended Posts

In the battle to make good sounding music with TIA, we have a few weapons at hand: atonal composition, cherry picking notes, wavering, and Tune2600. (any more I've missed?)I came up with an alternate one called Perceptual Tuning, and wrote up about it at the 7800 Development Wiki. I figured I'd post about it here, since it's equally applicable to the 2600.Enjoy!

Can you make a 2600 Salvo .bin?

Can't believe that's the TIA chip!!!

Wish there were trackers for 2600/7800 TIA to do musical effects like that.

Would not have thought it possible had I not heard it.

Didn't hear a chiptune like that until the C64 or the NES, and here it is from the ancient TIA (drool)...

Liked it so much, an edit of some of the percussion and trilling is now my ringtone :D Almost miss answering because I want to hear it play.

Link to comment
Share on other sites

thegoldenband,

 

Nice to see you found a fix for phaser on real hardware. That is an amazing effect!

Was it you that made "underwater_delay4m"? That's brilliant as well, AND in batari Basic!

I personally can not stand all that data duplication, so I wrote that Mappy tune compressing by hand post, like setting a Channel once and a data flag to change Channel when needed. Lots and lots of same Channel 12, Channel 4...

Wish music data compression could be automated.

I turned 8668 batari Basic music data bytes into 823 bytes, and left an idea to possibly save 122 more bytes.

Http://tinyurl.com/MappyTIA-Demo

 

For some reason I hadn't considered that DPC+ could totally liberate composers from worrying about the TIA, and use any waveform or pitch they want. OTOH, there is a certain amount of inevitable grit to most or all of the VCS wavetable synthesis I've heard -- the tones aren't as pure or clear as the TIA's native sounds.

 

I really like the challenge of writing for the Atari's limited palette of notes, but there have been some amazing wavetable feats too.

 

Just intonation is a fine idea but the problem is that the VCS uses the undertone series, which is the exact opposite of the harmonic relationships needed for just intonation! :) Maybe other tuning systems are possible, though.

 

I'd still like to figure out how to get my phaser demo to reliably work on real hardware; sounds great on Stella, but doesn't work properly on the VCS.

Link to comment
Share on other sites

Can you make a 2600 Salvo .bin?

Can't believe that's the TIA chip!!!

Wish there were trackers for 2600/7800 TIA to do musical effects like that.

:) Thanks! I'm quite pleased with how it turned out.

 

The Salvo music was actually written in a prototype of the 7800basic tracker. Its based around MML, but there's a few twists of my own in there. Each pattern can call another pattern like a subroutine. The instruments are based around the priority SFX engine in 7800basic, which gives the composer the ability to ensure certain instruments can interrupt others, or to play some instruments (like drums) only when there's a free voice.

 

All of that costs a fair bit of RAM. It might be ported to the 2600, but the RAM trade-off would make less sense there.

 

On the 2600 tracker side there's always Paul Slocum's tracker, and hopefully Kylearan's tracker will debut soon! :thumbsup:

  • Like 1
Link to comment
Share on other sites

On the 2600 tracker side there's always Paul Slocum's tracker, and hopefully Kylearan's tracker will debut soon! :thumbsup:

It's making steady progress. The editors for melodic and percussion instruments are finished and I'm working on the pattern editor/sequencer right now, and I'm really optimistic that I'll be able to release a first version at Easter. :)

post-35905-0-96000200-1454231970_thumb.jpg

  • Like 3
Link to comment
Share on other sites

Please bare in mind that I know essentially no music theory.

Neither do I. icon_smile.gif

 

The idea is to have a bunch of notes that are perfectly in tune with each other according to just intonation.

I did just that with my Tune2600 some years ago. Some people liked is (web based version here), but I am not sure how correct it really is.

Link to comment
Share on other sites

Nice to see you found a fix for phaser on real hardware. That is an amazing effect!

Was it you that made "underwater_delay4m"? That's brilliant as well, AND in batari Basic!

 

Hey, thanks very much! RevEng should get the credit for the fix, and I get the impression he and others have worked up a phaser effect on the VCS in the past. But "underwater_delay4m" is all me. :) I've always though that interlocking, pseudo-delay effects were underutilized on the VCS, though Paul Slocum has done some good ones.

Link to comment
Share on other sites

:) Thanks! I'm quite pleased with how it turned out.

 

The Salvo music ...

Maybe I was not clear, or I've misunderstood your reply.

I was just asking about the music in Salvo, not porting the Salvo game to the 2600 or making the tracker on the 2600.

 

I was asking if you could take the compiled Salvo music, and make a .bin that plays on the Atari 2600.

Just a stand-alone music demo, black screen, or maybe a promotion that plays the Salvo music on the 2600 and a vertical scroller that says, "This music is used in the 7800 game Salvo for the 7800. Check it out!"

 

Would that be very simple or very hard to do?

I just figured that your Salvo game title screen is playing the best chip tune I've heard so far on the TIA, and that the same compiled tune should play on a 2600?

 

For instance I have the Source Code for 7800 Food Fight.

There's an assembly music player routine, and also blocks of channel and frequency data for the sound effects and the music parts. Instant Replay intro block, Part A, Part B, end tag, etc. That seems quite easy to use what is there and play the same music on the 2600. Are the differences in the CPU speed and RAM too great between 7800 mode and 2600 mode to just play the same chiptune?

 

Anyway, amazing work you've done so far for this hobby scene!

Link to comment
Share on other sites

  • 2 weeks later...

Ask and ye shall receive.

 

attachicon.gifsalvotheme.bin

Wow, that's very nice, indeed one of the best 2600 tunes I've heard so far! Not only good percussion fx, which is easy to do on the VCS, but also a good lead and even chords!

 

My absolute personal favorite tune on the 2600 is from the demo Saigon, though: http://www.pouet.net/prod.php?which=56384

Link to comment
Share on other sites

  • 3 years later...
On 12/24/2015 at 8:37 AM, Thomas Jentzsch said:

Same for the Boulder Dash title screen.

 

How about frequency mixing? You have to update the frequency multiple times per frame, the more the better. I did that for the Star Castle siren sound.

Hi @Thomas Jentzsch, I'm reviving an old thread, because I'm also trying to do frequency mixing, but I don't get the results I was hoping for.

When mixing frequencies, I noticed some 'distortion' in the audio output, even when doing multiple updates per frame.

In Star Castle I also do hear some distortion, but way less than during my own experiments. Maybe the distortion is more noticeable for the high pitch notes?

Did you use some special tricks to get rid of the distortion when mixing frequencies?

 

I've created a test rom that slowly changes the audio pitch/frequency by mixing frequencies. In the example settings, I'm using the clean waveform/tone (nr. 12), and then starting with frequency #14, gradually mixing in frequency #15 and after 2 seconds mixing back to frequency #14 again.

 

I've added the rom and sources here, in case someone wants to have a look. For now I'm going to look at alternative solutions for slowly sliding frequencies.

 

sliding-audio.zip

Edited by Dionoid
Link to comment
Share on other sites

Dionoid,

I don’t understand exactly what you are trying, but the following may or may not help. 

Both channels at high or full volume can sound distorted.

A sound’s volume value going from 0, to on, and back to zero can cause a pop. Maybe because that is how samples are played - just by changing the volume register rapidly (and nothing else). If you just change the volume alternating each frame on and off you get a sound. :)

 

Maybe none of that helps, and maybe you already knew this? But I’m all for experiments on new sounds. 

 

  • Like 1
Link to comment
Share on other sites

On 2/4/2020 at 10:59 PM, Thomas Jentzsch said:

...

I am setting AUDC0 and AUDV0 once each frame, maybe that's the difference? I think writing to AUDC0 will reset the waveform.

Hi Thomas, it makes no difference if I set AUDC0 and AUDV0 each frame or just once. The 'popping' sounds are still there.

 

This is the mp3 of my results using frequency mixing on a clear waveform to generate a sliding sound. The popping is way less on lower frequencies, or if a use a waveform other than 4/5 or 12/13. But that is not what I want :)

sliding_sound_freq_mixing.mp3

 

Also I found that frequency mixing works best if you update the frequencies 4-8 times per frame (so "the more the better" doesn't seem correct).

 

On 2/5/2020 at 7:03 AM, iesposta said:

Dionoid,

I don’t understand exactly what you are trying, but the following may or may not help. 

Both channels at high or full volume can sound distorted.

A sound’s volume value going from 0, to on, and back to zero can cause a pop. Maybe because that is how samples are played - just by changing the volume register rapidly (and nothing else). If you just change the volume alternating each frame on and off you get a sound. :)

 

Maybe none of that helps, and maybe you already knew this? But I’m all for experiments on new sounds. 

 

I found that mixing frequencies (e.g. quickly switching between frequencies 14 and 15 within the same waveform) also causes a soft pop, which is only noticeable when you switch frequencies back and forth a lot.

4-bit PCM samples give me better results here: the 'pops' are gone, but the sound isn't as clear as using the normal TIA waveforms.

 

I also did some experiments by playing different frequencies on voice 0 and 1, and then slowly mixing the volumes of voices 0 and 1, so it simulated a note-slide.
This kind of works, but the results weren't that great. I think e.g. volume 10 isn't 5 times as loud as volume 2, which makes the volume-mixing hard.

 

Thanks for the replies anyway!

Edited by Dionoid
Link to comment
Share on other sites

23 minutes ago, Dionoid said:

Hi Thomas, it makes no difference if I set AUDC0 and AUDV0 each frame or just once. The 'popping' sounds are still there.

Probably your should debug Star Castle and see if there is any other difference which I missed. Or check my attached test program from back then.

 

Quote

Also I found that frequency mixing works best if you update the frequencies 4-8 times per frame (so "the more the better" doesn't seem correct).

I would test again when you have removed the popping sounds. My experience is different here.

 

Quote

I also did some experiments by playing different frequencies on voice 0 and 1, and then slowly mixing the volumes of voices 0 and 1, so it simulated a note-slide.
This kind of works, but the results weren't that great. I think e.g. volume 10 isn't 5 times as loud as volume 2, which makes the volume-mixing hard.

Yes, the volumes are non-linear, even more when two volumes are combined. But you can use a look-up table instead.

 

For details look here:

 

siren.asm

Edited by Thomas Jentzsch
Link to comment
Share on other sites

1 hour ago, Thomas Jentzsch said:

Probably your should debug Star Castle and see if there is any other difference which I missed.

 

I would test again when you have removed the popping sounds. My experience is different here.

 

Yes, the volumes are non-linear, even more when two volumes are combined. But you can use a look-up table instead.

Thanks for the link about the non-linear volumes!

 

Star Castle has the same popping sound, but it's less noticeable because of the lower tones. I can reproduce the sliding sound of Star Castle almost exactly, including the popping sounds, if I mix the frequencies 4 times a frame.

 

Maybe I have sensitive ears ?

Edited by Dionoid
Link to comment
Share on other sites

I'd expect some popping with frame based frequency changes or control changes, and indeed if I listen close I can hear them in my own frame-based routines.

 

With AUDF/AUDC changes, you're interrupting the current waveform, which will often leave a partial, very short wave. A very short wave would audibly be a high pitched blip.

 

The AUDF/AUDC based distortion is distinct from frame-based AUDV change distortion, which introduces a 60Hz pop, which is as loud as the volume delta.

 

 

  • Like 1
Link to comment
Share on other sites

Dionoid,

 

Remarking on your “sliding sound” mp3 file you posted.

As an effect, that’s an amazing sound that doesn’t seem like it should come from the 2600!

To use it in a game as a sound effect would be amazing, even if it has noisy pops. 

Used all the time like a continuous background sound, not as an effect, then yes the noise would make it bad.

  • Like 1
Link to comment
Share on other sites

I guess iesposta was referring to my mp3 sample, that has a higher pitch and makes the pops more noticeable.

IMO frequency mixing works better for lower pitch notes (like you have used in Star Castle Arcade), where the pops are both less frequent and mingle in with the sound.

 

Personally I never noticed the pops in Star Castle Arcade; only when I was actively listening to it ?

Link to comment
Share on other sites

20 minutes ago, Dionoid said:

I guess iesposta was referring to my mp3 sample, that has a higher pitch and makes the pops more noticeable.

IMO frequency mixing works better for lower pitch notes (like you have used in Star Castle Arcade), where the pops are both less frequent and mingle in with the sound.

The lower frequencies are also easier to mix because the frequency differences between two values are smaller. I do not know how you are mixing AUDC = 4 and 12, but it sure helps to keep the frequency distances minimal when mixing. Maybe it even makes sense to switch back and forth between 4 and 12.

Edited by Thomas Jentzsch
  • Like 1
Link to comment
Share on other sites

18 hours ago, Thomas Jentzsch said:

Does that mean it annoys you in Star Castle Arcade?

No, not at all.

In that case it is more important to recreate the sound of the arcade original you are porting. 

I realized very quickly the first time I heard Star castle Arcade’s siren that it was what the original game does and something that I didn’t think the 2600 could create. 

  • Like 1
Link to comment
Share on other sites

On 2/10/2020 at 2:24 PM, Thomas Jentzsch said:

Thanks for the siren code, Thomas! I can see that you're updating the frequency 5 times each frame, which probably gave you the best results.

I have a similar experience, and found that around 8 frequency-updates a frame works best for mixing frequencies. If you update the frequency more often (e.g. 50 times a frame) the distortion will get really bad.

 

Here's my code to generate a "falling down" sound effect:

falldown_sfx.asm

 

Anyway, I've switched to using 4-bit PCM sound, which has less 'blips' (but isn't as clean as the TIA waveforms)

  • Like 1
Link to comment
Share on other sites

  • 8 months later...
On 12/24/2015 at 11:56 AM, thegoldenband said:

Just intonation is a fine idea but the problem is that the VCS uses the undertone series, which is the exact opposite of the harmonic relationships needed for just intonation! :) Maybe other tuning systems are possible, though.

 

Sorry for the necrobump, but I would like to register my disagreement. In song form!

 

It's not perfect but I think TIA does pretty well here. No samples, AUDC is among 1, 4, 6, and 12.

 

Thanks to Paul Slocum for his well-thought-out and nicely documented driver.

 

Also, surely somebody must have found TIA's F major scale before, but I haven't seen any mention of it. I have it tucked away in one of my tables:

https://docs.google.com/spreadsheets/d/148aza1TfSvlUZeSx6haHcU4IKwpYF8N7BxPbGRDA_f8/edit?usp=sharing

These are mostly POKEY tables, but I have been adding TIA columns for 7800 development. Go to the F major (matching TIA) tab and scroll to the far right.

 

BTW this is Bach Prelude BWV 856 from Well-Tempered Clavier book 1. Maybe I'll add the fugue later.

Just_Tempered_2600.bin

Edited by bizarrostormy
Minor tweaks to binary
  • Like 1
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...