Jump to content



0

4-bit Wave Table sound for 2 voices


6 replies to this topic

#1 Rybags ONLINE  

Rybags

    Quadrunner

  • 10,323 posts
  • Location:Australia

Posted Fri Mar 24, 2006 3:24 AM

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

Attached File  demowavt.zip   2.94K   88 downloads

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.

#2 twh/f2 OFFLINE  

twh/f2

    Moonsweeper

  • 415 posts
  • Location:Fractalus

Posted Fri Mar 24, 2006 4:57 AM

View PostRybags, on Fri Mar 24, 2006 4:24 AM, said:


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

#3 Rybags ONLINE  

Rybags

    Quadrunner

  • 10,323 posts
  • Location:Australia

Posted Fri Mar 24, 2006 5:20 AM

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.

#4 emkay OFFLINE  

emkay

    Quadrunner

  • 6,498 posts
  • What's up?
  • Location:Holy Grail ;)

Posted Fri Mar 24, 2006 5:57 AM

View Posttwh/f2, on Fri Mar 24, 2006 11:57 AM, said:

View PostRybags, on Fri Mar 24, 2006 4:24 AM, said:


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 ;)

#5 danwinslow OFFLINE  

danwinslow

    Stargunner

  • 1,748 posts

Posted Fri Mar 24, 2006 6:21 AM

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.

#6 Rybags ONLINE  

Rybags

    Quadrunner

  • 10,323 posts
  • Location:Australia

Posted Fri Mar 24, 2006 6:25 AM

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.

#7 Rybags ONLINE  

Rybags

    Quadrunner

  • 10,323 posts
  • Location:Australia

Posted Fri Mar 24, 2006 8:30 AM

Attached File  deltatst.zip   2.97K   75 downloads

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users