Jump to content
Sign in to follow this  
Rybags

4-bit Wave Table sound for 2 voices

Recommended Posts

Here's another little demo program "DEMOWAVT.XEX"

 

demowavt.zip

 

It plays 2 voices of wavetable sound (digitized) without screen blanking.

It uses the VCOUNT wait technique similar to the 1-bit and 2-bit sound demos I posted before.

 

The way the program is setup, wave tables up to 256 bytes in length can be used. 512 individual frequencies are available, although that could be increased fairly easily.

 

To use the program, Load Exe from the emulator, or binary-load from DOS on a real machine.

Use joystick 1 up/down to change the pitch - hold the button to do the other voice pitch.

 

The waveforms can be selected from 9 that I've included. Just press the number or <shift> number to do the second voice. Note that key assignments mean you have to press the corresponding key if using the emulator (e.g. SHIFT-2 actually generates SHIFT-8 on Atari800Win).

 

Waveforms:

1 - triangle, lower frequencies

2 - triangle, higher frequencies

3 - sawtooth, lower frequencies

4 - sawtooth, higher frequencies

5,6 - noise (high and low volume)

7,8 - short and long pulse-waves

9 - square wave (much the same as normal Atari "pure" sounds)

0 - Mute

 

Mac/65 source code included. It can easily be modified to include customised waveforms. Note that the first byte in each wave table is the length (-1) of the waveform. Due to the way the program works, it should be 1,3,7,15,31,63,127,255.

 

This program could easily be used in conjunction with conventional a conventional music player, provided it has reasonably tight coding.

Share this post


Link to post
Share on other sites

 

This program could easily be used in conjunction with conventional a conventional music player, provided it has reasonably tight coding.

 

great news. But I think Raster already included something like this in his great RMT. What is the difference?

 

\twh

Share this post


Link to post
Share on other sites

I'm fairly sure RMT "volume only" does it at the Vblank level, so only allowing 50 Hz tones.

 

My routine does it at just under 8,000 samples / second, which allows complex waveforms.

Share this post


Link to post
Share on other sites

 

This program could easily be used in conjunction with conventional a conventional music player, provided it has reasonably tight coding.

 

great news. But I think Raster already included something like this in his great RMT. What is the difference?

 

\twh

 

 

If it was, I would have used it already ;)

Share this post


Link to post
Share on other sites

Rybags, this is cool as hell. And I'd like to thank you for the source code, studying good stuff is what I need to do a lot of when it comes to asm.

Share this post


Link to post
Share on other sites

I reckon it could be incorporated into RMT.

 

Different translation tables for the frequencies would have to be generated, and the RMT player would need a slight rewrite to spread the load (ie- not do all processing in 1 block of scanlines).

 

Since RMT nicely keeps shadow copies of the sound registers, the program could be adapted to only generate its waveforms under certain conditions.

Share this post


Link to post
Share on other sites

deltatst.zip

 

OK. The popular "Delta" music .XEX file, hacked with my routine added to replace the normal bass sound which plays on channel 2, with a triangle waveform.

 

Sure, it sounds crap because the frequency is rather out (translation tables need work), and it's playing a triangle wave where a guitar sound would be more appropriate, plus there's no ADSR (but that could be worked in with little trouble).

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...