pouët.net

Converting samples to 8 bit

category: music [glöplog]
So,

I digged out Protracker again after all and it's funny how my hands know their way around better than my head. What I more or less forgot and where my hands can't help is

How the heck do you retain the best sample quality again?

H0ffman already provided me with wav2Amiga - superhandy, thank you! Is there a documentation anywhere? How to change conversion presets etc?

I feel like I forgot about some tricks that got me much better results back in the day. But, euh, no idea anymore. 20 years is quite a while.

Fancy a bit of chit chat - anyone?!
added on the 2017-05-14 21:24:20 by rp rp
I didn't work with protracker, but converting to 8bit saves space :)

This is not a step by step but in general you want to:

- maximise the volume before converting to 8bit
- use a companding algorithm to make better use of those 8 bits, if I recall well protracker supports one of these https://en.wikipedia.org/wiki/%CE%9C-law_algorithm
- dithering and noise shaping also helps
added on the 2017-05-14 21:45:23 by musk musk
No, ProTracker only supports raw 8-bit PCM in the end, so using any other intermediate algorithm doesn't really help you. But as has been said, normalizing the sample before conversion is vital, and depending on the sample a bit of dithering will also be useful.
Normalizing is basic indeed. I was thinking about advanced things, maybe sox options. I remember fiddling around with sampling rates depending on what material I was going to sample. Right now I'm stuck with UAE, prepping sounds on Windows.

As said I've got wav2Amiga by H0ffman which uses sox. Then there's also AmigaPal, which uses sox as well. Seems like Windows audio editors don't offer much conversion options for 8bit these days. If any at all (Wavelab doesn't).

Right now I'm importing .wav files into the Win-clone of Protracker 2.3d and then export .iff from there. It does sound okay but I think there were ways yielding better results.
added on the 2017-05-14 23:06:11 by rp rp
At least Wavelab 7 still has a ditherer that can dither to 8-bit, I'm not what else you'd expect/need for conversion.

Regarding samplerate, for oneshots that don't need to be transposed much I'd resample them to 27928 Hz, which would be an A-3 in ProTracker (highest note that you can play without stuttering). For anything else, 16574 Hz (C-3) or 22167 Hz (F-3) depending on the required note range.
Example song where I used these techniques, except for dithering. I'd say the samples are fairly clean.
Good ol' Sound Forge 8 has a comprehensive 8-bit converter with four dithering and two noise shaping methods to choose from. Saves to AIFF too.
added on the 2017-05-14 23:23:09 by dojoe dojoe
(For resampling I used Voxengo r8brain, which is integrated right into OpenMPT's sample editor and delivers high quality results)
I'm normally using Voxengo's r8brain for sample conversion, as it handles batch conversion of samples:
http://www.voxengo.com/product/r8brain/

Typically I tend to convert everything to sample rates of 8khz, 11khz, 16khz and 22khz and just use the lowest quality version that works (or necessary to hit Slummy's memory usage target).
I'm tracking in FT2 anyway, so I read the converted wavs into FT2, do my business and then save as .mod. Then I finally convert the FT2 .mod to proper .mod by opening and saving it with ModPlug Tracker, where I also make use of the cleanup functions removing unused samples and patterns if any.
added on the 2017-05-15 00:52:45 by lug00ber lug00ber
For 8-bit, you want not only dithering, but also noise shaping. Supposedly SSBC is good stuff, although I haven't tested it myself.
added on the 2017-05-15 01:02:41 by Sesse Sesse
Are we sure dithering with noise shaping is appropriate for samples that are going to be played or mixed together? I can imagine a scenario where samples with the same rate and same dither algorithm that are played at the same moment have audibly horrible aliasing...
added on the 2017-05-15 07:14:18 by trixter trixter
Yeah I'm not sure either adding dithering to a sample played around different notes is the best way.. ymmv.
added on the 2017-05-15 07:57:33 by leGend leGend
I've had issues with dithering to 8-bit using Sox, I think because the noise floor is so high the added noise from dithering becomes audible. It's useful in some cases but not every case.
added on the 2017-05-15 09:17:56 by jmph jmph
Does sampling audio work in WinUAE? Been trying to find some info, but wasn't lucky.
added on the 2017-05-15 10:57:21 by rp rp
I tend not to dither to 8 bit, because the noise is so loud that it's actually more disturbing than the quantization distortion it's supposed to hide.

If someone has a good dithering setup for 8 bit, please tell more and give examples.
added on the 2017-05-15 11:48:33 by yzi yzi
In our latest demo we adjust the amiga volume together with the 8-bit playback to scale the 8-bits into the best fit considering the 16 bit source material. This utilize the amiga volume mixing extra precision. This way there is almost no noise if you can achieve 16-bit src ~= 8-bit x amigachannelvolume.

Someone should make a tracker with this. It doesn't occupy more than 1 channel unlike the usual 14 bit mode which uses two channels to get 14 bit sound.
added on the 2017-05-15 12:10:31 by rloaderro rloaderro
trixter: Dithering is certainly appropriate even in the presence of mixing. You could argue maybe noise shaping isn't optimal for samples that are going to be played back at a different pitch, though.

loaderror: This sounds almost like the encoding scheme used for HDCD =)
added on the 2017-05-15 12:21:45 by Sesse Sesse
Quote:
In our latest demo we adjust the amiga volume together with the 8-bit playback to scale the 8-bits into the best fit considering the 16 bit source material. This utilize the amiga volume mixing extra precision. This way there is almost no noise if you can achieve 16-bit src ~= 8-bit x amigachannelvolume.

Someone should make a tracker with this. It doesn't occupy more than 1 channel unlike the usual 14 bit mode which uses two channels to get 14 bit sound.

Can you do this on the 500 and still have resources left to show anything interesting on the screen though?
For AGA stuff I'd never really consider tracking the soundtrack anyway, since I can do streaming music there.
added on the 2017-05-15 12:23:00 by lug00ber lug00ber
Maybe, maybe not. I was just in here and doing the helicopter and now I'm out again.

It would be like triggering a series of chopped notes in succession per logical sample.

For the demo we changed volume per ~512 bytes. I think that equals to roughly 1 note trigger per frame for a sample playing at 28KHz. Not too horrendous either? Need Slummy or Blueberry to chip in with non marketing numbers. :)
added on the 2017-05-15 13:08:13 by rloaderro rloaderro
Quote:
Quote:
In our latest demo we adjust the amiga volume together with the 8-bit playback to scale the 8-bits into the best fit considering the 16 bit source material. This utilize the amiga volume mixing extra precision. This way there is almost no noise if you can achieve 16-bit src ~= 8-bit x amigachannelvolume.

Someone should make a tracker with this. It doesn't occupy more than 1 channel unlike the usual 14 bit mode which uses two channels to get 14 bit sound.

Can you do this on the 500 and still have resources left to show anything interesting on the screen though?
For AGA stuff I'd never really consider tracking the soundtrack anyway, since I can do streaming music there.


In principal it would work for playback as the hardware is the same, the real issue is having enough memory and speed to decode.

@RP, you can make new presets inside the Wav2Amiga tool. If you want a custom frequency list for each note, simply edit the xml file with all the notes in.
added on the 2017-05-15 13:08:39 by djh0ffman djh0ffman
Quote:
I tend not to dither to 8 bit, because the noise is so loud that it's actually more disturbing than the quantization distortion it's supposed to hide.

If someone has a good dithering setup for 8 bit, please tell more and give examples.

As mentioned above, you should try noise shaping options available in the ditherer (or if they aren't available, get a different ditherer :D). However in the end it may still sound bad if you transpose the sample around and stack up the samples... I tried a few options in the past and just stuck with no dithering.
I don't dither or noise shape, on the whole I find I get the best results for a tracker by simply removing the lower 8 bits, or recording in 8 bit in the frist place.
added on the 2017-05-15 14:36:19 by Subi Subi
Removing the lower bits? At least surely you mean round?

Recording in 8-bit usually means there's some dithering happening in the hardware (whether it be analog or digital).
added on the 2017-05-16 12:12:48 by Sesse Sesse
Isn't the difference between round and throwing out the lower bits an offset of half an 8-bit sample? Without thinking very hard about it, I think you just get slightly different quantisation noise, not less or more of it.
added on the 2017-05-16 13:59:52 by absence absence

login