Jump to content
IGNORED

Digitized Sounds


jacobus

Recommended Posts

The Quick programming manual references a digitizer described in an Atari magazine from 1989 (please see the quote below). Does anyone have such a device, or perhaps even better, does anyone have any experience converting a digitized sound recorded on a PC to the described format? Thank you!

 

 

 

The data must be in a special format as defined in ATARI magazine 1/1989 and 5/1989 by PPP Germany
(there you can also find how to build a sound sampler for the XL/XE computers). The format looks like this:
Two 4-bit sound data are put into one byte. The first data is put in the high nibble, the second in the low nibble
of the byte. The third sound data is put in the high nibble of the second byte and so on. Samples from Parrot,
Replay, Digi-Studio, and Antic Sampling Processor are fine.

 

Link to comment
Share on other sites

4 bit samples packed as described is pretty much the norm.

 

PC utilities will often only support down to unsigned 8-bit samples. Not a problem really, you can just output 8-bit samples to a file then write a little program on the Atari which reads it and outputs to packed 4-bit as required.

 

When possible, output as raw data from the PC, you don't want to include stuff like .WAV headers.

Link to comment
Share on other sites

I couldn't help but cringe when I saw someone downconverting a sound file to 4-bit through an Atari BASIC program running on an emulator. There are so many better and easier ways to do this directly on the PC -- C, Python... heck, you can even do it in MADS.

 

A decent audio tool like Audacity will let you clean up the sound (high-pass, normalize, compress) and resample it to target sample rate much better than a quick-and-dirty tool will. Don't do it by averaging samples together -- that's called a box filter and it's awful, particularly for the low rates you need to target. The 8-bit is not going to be playing high quality sound if it's doing anything else, but if you're going to do it, you might as well get as much out of 4 bits of volume and 4-8KHz sampling rate as you can.

 

Link to comment
Share on other sites

Similarly, playback technique has a large bearing.

 

Delay loops, minimised graphics or DMA off completely is the old primitive way.

 

Pokey Timers is the modern way, you can do IRQ playback which will be practically as good as screen-off. Although it's not something that a HL language will do natively, assembler is a must there.

Link to comment
Share on other sites

Does anyone have (or know a link to) a guide on using Audacity to create 4kHz samples? I'm playing with it on Linux Mint but it's not as easy to use as Virtualdub.

 

After this, does anyone know of a scripted way to remove the wav header automatically and then make them into 4 bit samples?

 

I tend to work by having the raw data which has come out of a PC application and then use a build system which strips out / converts data.

 

That way if the sample is changed, the build system just extracts the right data each and every time, without having to manually strip it out.

Link to comment
Share on other sites

Does anyone have (or know a link to) a guide on using Audacity to create 4kHz samples? I'm playing with it on Linux Mint but it's not as easy to use as Virtualdub.

 

After this, does anyone know of a scripted way to remove the wav header automatically and then make them into 4 bit samples?

 

I tend to work by having the raw data which has come out of a PC application and then use a build system which strips out / converts data.

 

That way if the sample is changed, the build system just extracts the right data each and every time, without having to manually strip it out.

 

Generally speaking, you should remove all frequencies above half of the replay rate. So, for example if you want to play the sample at 7.6kHz (i.e. one sample every scan line), you can use a low-pass filter at 3.8kHz. To be on the safe side, set it to 3.5kHz and suppress the higher frequencies as much as possible (i.e. -24dB or something). You can also suppress the lower frequencies, say below 100Hz, which will avoid the sound being drowned. After that, optionally run the sample through a limiter/compressor to make the loud passages quieter and the quiet passages louder. Remember you have only 4 bits times ca. 6dB = 24 dB of dynamic range. Thereafter, normalize everything to 0dB (i.e. maximum peak amplitude), convert to 7600Hz and save as 8-bit mono unsigned raw.

 

On the Atari side, you can cut off the lower 4 bits. Perhaps it would sound better if the converter uses dithering, though I'm not sure if that helps if there are only four bits dynamic range.

Link to comment
Share on other sites

I tried dither/oversample once, ie play an intermediate sample which is average of current/next, for slight improvement but you pay with more CPU time lost.

 

In theory you could do the 5-bit sample method, add current + next and use the result, for no extra memory cost, but of course the greater CPU expenditure.

Link to comment
Share on other sites

Thank you all for the quick responses!

 

I tried Audacity on a very short drip sound - the smallest I could make the file was 13K - and it sounded only slightly better than the non digitized sound I was using already. Even after removing the header and using Quick's compression method, the amount of data will be way too large. I will have to re-think the use of digitized sounds in my project.

Link to comment
Share on other sites

Sheddy uses Timers - I think by direct IRQ method with Ram-based OS which has lower overhead.

 

You lose a voice regardless - just use the Timer associated with the given voice, so there's no loss really, although voice 3 has no timer.

 

In theory you should be able to have a 16-bit voice pairing and use the low voice for digital output since normally you leave it silent.

Of course though, you still have the problem that it needs a Timer, although you could just resort to delay loop method.

Link to comment
Share on other sites

I tried dither/oversample once, ie play an intermediate sample which is average of current/next, for slight improvement but you pay with more CPU time lost.

It would be nice to make some precise measurements of the pokey volume channel characteristics and make a convolution matrix filter for sox or similar software in order to produce best possible sounding samples.

 

With today mass storage drives and RAM expansions there is a plenty of space for loop based sountracks without needs of pitch or volume calculations and thus leaving CPU cycles for something more useful.

Link to comment
Share on other sites

  • 4 weeks later...

Sheddy's approach was very nice it played just fine without requiring mass storage and mods etc...

I played the original beta levels off of floppy disk....

I mean it's nice that we have 1 meg memory and fast large drives and all but I think weaving some nice samples into a game or app of any kind that will work on standard equipment and with that quality...

he provided everything to the public so it could be looked at and replicated...

He moved it all to cartridge when the music was redone (RMT), the gameplay stayed the same just no wait time for disk access at major level changes, I really did not mind sliding in a floppy (it gave my hand a rest) and the method was used to make tempest extreme digitised sound later on as the same fellow who converted the music employed the methods to his own works.

Edited by _The Doctor__
Link to comment
Share on other sites

https://atariwiki.org/wiki/Wiki.jsp?page=Ironman%20Atari#section-Ironman+Atari-PushingPOKEY

 

in this page find digitized section sheddy non-irq and irq snippet

 

two different ways to skin the same cat...

 

I ignored the expired warning about invalid certificate... didn't hurt me a bit!

Edited by _The Doctor__
Link to comment
Share on other sites

RMT by default doesn't support sample playback.

 

Sheddy changed to IRQ playback after consultation with people on this forum including me. Such playback routines are DIY efforts, in any case you have to make them application specific and as compact and fast as possible to do synchronous playback.

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