Creating Samples For Amiga

Fast Amigas can replay WAVs and even MP3s (at 14-bit quality) - but the OCS/1MB platform normally uses the hardware 4-channel audio DMA to replay samples, which requires a bit of knowledge to get good quality sound out of 28 kHz 8-bit. This article is a collection of experiences and an attempt at a general overview guide about how to make the best instruments and sounds for the Amiga.
In summary, it became apparent that resampling from WAV could never reach optimal quality, but sampling on the Amiga can. See the picture for how I got it noise-free.

Overview

Coming from newer platforms, the Amiga's sound capabilities may seem on the crude side. But you can verify for yourself from the links at bottom that it really is possible to make exciting songs!
The Amiga has 2 audio DMA channels hard-panned to the left, and 2 more for the right speaker. This rules out panning, although you can extract left and right channels of a stereo instrument (or sample it on a stereo sampler using its provided software) and play the samples in two channels to preserve panning or other stereo effects in the sound.
This is memory-hungry and hogs half of the channels available, so usually all instruments are mono. The instruments are then used in music programs such as Protracker to compose a song, and stereo effects such as pan and echo (delay) are created manually where needed, so that the notes occupy two channels only temporarily.

Strategy

Each DMA channel supports up to 28836 Hz, and this maximum frequency works fine for non-tonal samples like speech or percussion. It's fine to use this frequency and always play the sample at the single highest pitch the Amiga can muster, if you have the memory to spare. (The samples must lie in chipmem, and the Amiga 500 only has 512K chipmem.)
Both to conserve memory, and to play tonal instruments, such as bass, melody, etc at different notes, you would instead use a frequency between the maximum and half the maximum (one octave down), or half the maximum, or even lower.
For "bassy" sounds, even a frequency of 14KHz might be overkill; you would be wasting memory to "preserve" high frequencies that aren't there. (First check that they're not! You may lose fidelity in bass samples featuring chorus, phasing, etc.) You can always upsample afterwards (transposing it up one octave, thereby halving the sample length in memory; resampling it at half the frequency), and then play the higher note at half the frequency. While resampling will deteriorate the sample, resampling once at an even multiple of the start frequency will typically sound acceptable. This means that you can first sample it and then make a copy and try the upsampling and hear if it sounds OK.
Music programs typically support at least 3 full octaves ("C-1 up to B-3" in Protracker, corresponding to C-4 up to B-6 on a piano). That doesn't mean your sample will sound decent in all octaves. You can fix this by sampling the instrument at the same note frequency, but hitting a synth/keyboard key 1 or 2 octaves up or down. Some programs support 5 octaves with instruments that in fact consist of several versions of the same sound sampled at different octaves. Protracker does not.
So, it seems we can divide the sounds into 3 categories: non-tonal vocals or percussion that we can sample and play at 28 kHz, tonal vocals or instruments that should be sampled at the note being played on a synth/keyboard key (at C-3 or about 16.7 kHz for a C key in any octave on the keyboard), or the same but sampled at C-2 or even C-1 depending on how "bassy" they are.

STRAIGHT INTO PROTRACKER. Minimal sampling chain setup for noise-free instrument transfer: grounded outlet PC's USB sound card line-out -> AMAS sampler line-in on the Amiga in a non-grounded outlet. Digital volume adjustment only, via Sound Volume Hotkeys. Monitoring on Amiga headphones only.

Resampling vs. Sampling

Resampling comes with an unavoidable and tough choice: you either get aliasing distortion, or you use dithering, which is better, but deliberately adds noise to the sample. From extensive tests, it's clear that any resampling gives lackluster results. For even frequency multiples without dithering, you may get lucky (some samples won't get aliasing distortion). But since sound cards and (non-Amiga) samplers in general have fixed frequencies that are not even multiples of the frequencies used in Amiga programs, even if you're lucky you can't use this frequency-halving etc. for any tonal instrument; they'll all end up off key and unusable. (Well, you can re-record the instruments of a song a few halfnotes up, convert, and fine-tune as close as possible to 22050 Hz (edit: F-3 fine-tune -1 is closest). Then the song will at least be consistent, but still slightly off key. Occasional halving-distortion still applies, of course.)
You can resample in SoundForge, Audacity, or similar WAV editors, but be aware that they don't all support dithering for the 8-bit conversion. The best resampler software is SoX, an advanced command-line program (with equally advanced options in its manual).
Sampling gets rid of all of these resampling artifacts. In its place, you may get others: typically there may be (in order of decreasing severity): 50 Hz hum, weak electronics interference, bias (a.k.a. DC offset), and regular sampling aliasing distortion and noise (like for resampling, but substantially less pronounced).
These will usually be fixed by using a grounded outlet for the source, a non-grounded for the Amiga, and making a minimal setup consisting only of these two with one cable between them: the sound cable into the sampler. This includes unplugging any and all equipment that are connected to mains (have PSU) from the setup, including speakers. When the sampling chain is perfect, you can add equipment back in, only on the grounded PC side.
It's assumed you've set it up this way before applying the below fixes. Connect source and destination with a single (mono or stereo) audio cable, and always use line-out and line-in jacks.

Fix 50 Hz hum

This is usually caused by a bad or deteriorating PSU. Listen to the source equipment first, if OK, then replace the Amiga PSU, else run the source on batteries if possible, else replace its PSU.

Fix weak electronics interference

Check the source. If present in the source, unplug any cables not connected to anything at the other end. Loose cables act as antennas, picking up the noise. If it persists, it can come from the electronics itself, like a laptop or PCI sound card. If you're sampling PC sound output, get a USB sound card to fix this.
If present only when the Amiga is connected, similarly unplug unused cables, and if it persists, replace the sampler or try shielding it in a Faraday Cage. (For hardware modders: from experience, the lack of a top half of the RF shield in an Amiga is not a problem.)

Fix bias

This is what causes clicks at ends of samples and exaggerates aliasing distortion and noise. It's caused by a difference in ground levels between devices, in turn caused by PSU differences and differences in load on these PSUs. This must be evened out. Since you connected your Amiga PSU to a non-grounded socket and connected the Amiga's ground to the "master ground", that of the source (with a single audio cable), bias should be 0 (or you have a problem with the Amiga PSU or with high-watt equipment on the same fuse as the involved outlets).
If you really need bias-causing powered equipment connected to the sampling chain for convenience, you can fix the bias digitally with the "NormalDC" button in Protracker if the sample does not reach max or min amplitude anywhere. Even then, you can apply it to quiet portions of the sample, where the bias is more audible.

Fix sampling distortion/noise

This is usually only audible in quiet portions of a sample, typically when a sample's volume tapers off at the end. One simple way of fixing it is to ensure the sample is "maximized"; that the wave (roughly) fills the sampling window vertically. This maximizes the signal to noise ratio. Ensure that it's not too loud, though for instruments with very sharp attack it's usually a good idea to trade a little distortion to not have noise throughout the long fadeout. (This also means that you should not have exaggerated attacks in your instruments, in order that you can increase the volume a notch without hitting max. Hit the keys softly or use a compressor set to slow attack.)
The artifact simply comes from the 8-bit sampling resolution. Occasionally, sampling at a lower note will reduce it (by not sampling to frequency near a prominent one present in the sound). You can also use studio equipment such as equalizers with a 1-octave-soft-knee low-pass filter (such as that present in a reverb's "HF damp" control) and noise reduction units to generally polish up the sound.
8-bit post processing is limited - but you can always do it the ST-01 way: cut off the sample before it causes trouble (becomes quiet enough for the noise to be heard). You should fade the volume to zero at the end to avoid end clicks. A very short (16 to 64) fadeout length is enough.

Workflow

From the issues above, resampling will never yield best results, but a minimal sampling chain setup can. If you have 1000 samples already edited and ready to be Amiga-converted, by all means drop them on this SoX script.
But for all sensible music use, you really need to hear what you're doing, tweak stuff until it sounds good on Amiga, and then sample it to the note you're recording, so you can play melodies with it. I do this with the above setup and listening in headphones, only at the Amiga end, and sampling directly to the note I strike, 95% of the time C-3 but occasionally C-2 for bass or A-3 for noisy percussion such as cymbals. A-3 is close enough to 28 kHz.

Conclusion

For one who really wanted to "do it oldskool and use a sampler" to start with, but assuming quality WAVs and converting them with SoX would surely give the highest quality results, it was a surprise and a learning experience that in this case the oldskool way was superior. This was the only reason for me writing the article - apart from hoping to hear some new songs using excellent new instruments, of course! :)
This is not to say that the best way is the only way. Usually what decides if music gets done is not the quality of the instruments in the first place, but ideas and inspiration (or just a window of opportunity finally appearing in your available free time in which to fiddle around and have fun)!
If you have neither a good sampler nor a working Amiga which Protracker 2.3D or 3.15 work on, you can still make music for Amiga on PC. You may use the quick and direct Windows/Mac Protracker (resampling C note WAVs to 16726Hz before loading them!), or use Protracker in WinUAE, or use Milkytracker (automated sample conversion causing the familiar resampling issues).
All of these will yield songs usable in Protracker, demos, games, etc on Amiga. (There are also other trackers and track-alikes such as Sonix, Octalyzer, SidMon, Future Composer, etc. High quality samples will help with all of them.)

But it still sounds crap!

Well, you're working within the limitations of the computer itself. That said, it sounds more crap on PC than on a real Amiga! Partly, this may be because you're listening in headphones, and the wide stereo is putting you off, and if you're already a musician, your excellent equipment will flaunt the 8-bit quality with a clarity that can really be off-putting!
The by far preferred monitoring and composing setup for me is a real Amiga with a good normal stereo stack, satellites on either side of the monitor. Perfect and savory stereo separation without the actively exaggerated treble boost of f.ex modern headphones. You're supposed to be inspired while you're composing, not put off! I too was sort of stumped and couldn't get going, so I'm thrilled I set the Amiga up like this next to my music PC :)

But it STILL sounds crap!

Well, some complex sounds need some production (polishing up) before shining in the confines of the 8-bit realm. This includes sounds from analog synths using filter chains and feedback, which doesn't care about any digital realm, and effect chains in "wave calculating software" such as Reason or any software supporting chained VST plugins, where the wave sounds okay but you have not applied enough production to the sound.
Also, sounds relying on dynamics to a large extent, such as classical music or its instruments, are tough to capture with anything approaching the full dynamics. In general, you want to isolate sounds and clean them up as much as you can before sampling them.
If you're still put off to the point where you can't compose, there no choice but to impair your hearing or your judgment by applying consumer grade headphones or alcoholic beverages, or both in a win-win combination.

Example songs made for Amiga using tracker type software


Community

If you're on Facebook, consider joining the Amiga Music group and ask advice and talk to other musicians there!