A desktop app for preparing and converting 8bit samples to use in Protracker on the Commodore Amiga. Also suitable for some other trackers, perhaps certain old hardware samplers, Nintendo Game Boy running LSDJ, and similar stuff.
\
(next to Left Shift on UK keyboards) to kill a currently-playing note. Up/down arrows highlight previous or next file items16th March 2022 -
15th March 2022 -
‘Preview output’ now lets you hear almost exactly how the exported 8SVX/WAV file will sound. Previously the preview was quite a rough approximation; now it renders an output buffer using the current SR/filter/limiter settings every time you play a note, so you can do quick comparisons before deciding on the best compromise between quality and size.
When ‘Preview output’ is disabled, the original sample is always played dry - no filters or limiters. This reduces the variables when you’re trying to objectively compare the (presumably) high quality source sample with the lower quality output sample.
Since preview playback involves the non-realtime rendering of the requested note, any changes made to the lo/hi cut filters or the limiter won’t be heard until a new note is played.
In case it’s not obvious, importing gargantuan samples might involve commensurately long delays when playing preview notes! Having said that, previewing a short trim section only renders that section, so loading big samples in order to export short sections shouldn’t cause noticeable delays on a reasonably modern computer.
“Near total accuracy” is what I said in the commit message for this update… What does this mean? Previously I used some realtime DSP effects to create a preview playback buss: the lo/hi cut filters and the limiters (user-programmable and internal) were identical to those used on the non-realtime output rendering stage, but the bitdepth and sample reduction were faked in an…unsatisfactory way. Akira (aka FastRam, one of the PT-1210 team) asked me about the discontinuities (clicks’n’pops) in that mode which made quality comparisons difficult and it motivated me to do what I should’ve done ages ago and fix it. Now the preview playback buffer is fed by the exact same offline rendering process that does the file export, so you’re hearing the output bytes as close as possible to the way their target platforms will play them back. ‘As possible’ - so what I can’t emulate is e.g. the Amiga’s DAC stage and its inherent aliasing artefacts, or similar characteristics of other vintage systems and samplers, but I’ve done my best to get our 8bit output buffer back into WebAudio’s native 32bit float buffer in as harsh and unsanitised a way as I can :)
“Why are some samples, or sample sections, mega loud in the preview output?” - probably because they’ve been normalised as part of the output render. This will be especially noticeable if you trim to a quiet section within a generally louder sample; AmigaPal always aims to get the best SNR before doing any conversion, so if there’s any headroom available within your trim points, that section will be amplified just short of clipping. Bear in mind that this is NOT the same as maximisation, where hard limiting/compression is applied to destructively bring up the perceived level without clipping. You can do that with the Limiter :)
There's a slight inconsistency between playback durations depending on whether 'Preview output' is enabled. This is due to some latency in the non-preview chain not being compensated for. The preview duration, however, is the exact duration of the output file (give or take a single byte, if the output buffer has to be padding to the nearest even number of bytes). So rely on preview for getting your trim markers set right!
1st December 2020 -
13th May 2020 -
\
key (the one next to Left Shift on my keyboard).6th May 2020 -
5th May 2020 -
I have managed to get the latest version (v0.0.7-beta.1) to run on MacOS Sierra, but when I package it with electron-forge it crashes instantly after the app is launched without any kind of useful error log. I can't say when I'll have time to bug-hunt this, but if anyone else is able to package for MacOS or Linux please let me know. Previous versions of MacOS should still work fine, although you'll need to set up sox as before (e.g. install with brew and point AmigaPal at /usr/local/bin or wherever).
If it doesn't make the app too sluggish, it'd be nice for the waveform display to reflect limiter/gain changes and give an impression of how the sample will look in Protracker after conversion, in terms of transients and dynamics.
It would be nice to be able to layer/mix samples in AmigaPal. You can do it in ProTracker, of course, but mixing at higher sample rates/bit depths might give better results in the end. We'd need to be able to select multiple samples, and also decide on an output filename template. Low priority for now!
I wish I could get the app Icon working properly. There IS one, I just can't get Electron-Forge to add it when packaging.
Output directory chooser has stopped working in Windows since I updated the Electron version. Until it's fixed, please try typing or pasting your output path into the box.
Output normalisation is a bit wonky so I've disabled the controls and hardcoded it for now - I need to untangle a lot of messy code and redo it from scratch. Meanwhile it works...but you won't be able to drive the level past any rogue peaks. Ultimately I'd like to do it in multiple stages, or with a discrete non-brickwall limiter stage, or RMS, or a more forgiving peak average, or something.
Grab the latest release for your platform from the releases page and unpack the zip wherever you like.
MacOS/Linux
As long as you've got SoX installed, and can find the path to the sox binary, you should be all set. The default path is /usr/local/bin. When I get a chance, I'll zip up a MacOS version to bring the MacOS release up to date with the latest Windows one.
Windows
It's no longer necessary to have SoX installed, or to know where it lives. In theory you should be able to unzip the Windows release and just run the exe.
My sample plays through fine in AmigaPal but when I load it into Protracker, the end is chopped off
Check the 'size' value to the left of the waveform. Is it over 65534? If so, then lots of Protracker versions will be loading only data up to that limit, ignoring the rest. Some versions with proper 128KB sample support might load samples up to that size; some will simply allow them to be created (by increasing PT sample length and copy/pasting) but won't load them in one go from disk. Your mileage may vary! But ultimately if you want to fit all of a long sample's duration into Protracker, you'll have to compromise on quality by lowering the PT note, which lowers the samplerate (while increasing the relative pitch, so you'll have to enter lower note values to get the 'real life' note you wanted). Or, if you can't sacrifice quality, consider loading the sample into AmigaPal multiple times, trimming them into chunks, and converting them all at a high PT note value (therefore high samplerate and high quality), then loading them into multiple Protracker sample slots and adjusting them until they can be played back seamlessly. And if that seems like a pain...welcome to tracking!
I tried to load a sample but nothing happened
Please check the 'STATUS:' message - if audio data can't be decoded from an incoming file, the message should notify you. I've tested with malformed WAV headers and the warning appears, but AmigaPal otherwise carries on silently without locking up (but if anything crazy happens please let me know). The underlying audio subsystem in AmigaPal is the Web Audio API so any of the filetypes listed above, in most channel/samplerate configurations, should at least be decoded - by which point AmigaPal treats everything like it's a single channel of 32bit float amplitudes anyway.
It doesn't work on my operating system of choice
Up until late 2019 all AmigaPal dev was done on MacOS, so Windows and Linux were always slightly behind in terms of testing and updates. Now I'm primarily on Windows, so expect the Windows version to get updated first - though I'll try my best to keep parity across all three platforms. I don't typically keep a modern Linux installation running these days, so if someone else can test and report back to me I'd be grateful.
If you'd prefer to script the conversion process, or would just rather not use the Electron GUI, here's a guide to the SoX settings that earlier versions of AmigaPal used:
sox [infilename].wav [outfilename].8svx trim [starttime] [duration] norm 0.5 remix - highpass -1 [frequency in hz] lowpass -1 [frequency in hz] rate [sample rate] lowpass -1 8000 norm 0.5 dither -S
The second lowpass filter is optional, being processed after the sample rate reduction in the event that some unwanted hiss needs to be removed. The conversion to 8bit is implicit in the 8SVX filetype, which is an explicitly 8bit format.
Values in square brackets were mapped to AmigaPal's controls. Here's an example for converting a 16bit stereo WAV to an 8bit 8SVX sample trimmed to 2.3 seconds starting at 0.2 seconds, normalised, highpassed (low cut) at 60hz, lowpassed (high cut) at 10000, reduced to the sample rate of ProTracker's note 'A-3' (~27928hz), lowpassed again at 8k to remove hiss, normalised again, then finally dithered:
sox inputfile.wav outfile.8svx trim 0.2 2.3 norm 0.5 remix - highpass -1 60 lowpass -1 10000 rate 27928 lowpass -1 8000 norm 0.5 dither -S
AmigaPal was doing nothing special that you couldn't do with this SoX syntax, but it makes batch-converting stuff a lot easier and removes some guesswork! You might find it's worth playing with the order in which SoX processes the effects (with some caveats, of which SoX's terse and only occasionally helpful error messages will inform you), but this is what works best for me.
Now AmigaPal does everything internally, including writing 8SVX files, without SoX. This means the preview audio is slightly closer to what you end up with after conversion, and also that you save a few bytes per sample (because AmigaPal doesn't write the optional ANNO chunk)
You'll need to have bower and npm installed.
Clone the repo:
https://github.com/echolevel/AmigaPal.git
Install all the dependencies:
cd AmigaPal && npm install && bower install
Run:
electron-forge start
Package (optional - see electron-packager documentation for more on platform and arch options):
electron-forge package --platform=darwin,win32 --arch=x64
Publish (optional, and you'll need to use your own GitHub credentials in package.json - my access token is set locally as an environment variable):
electron-forge publish
Note that electron-forge's publish can only package a distributable for the architecture/platform you're building on. I'm on Mac, so for AmigaPal's Windows zip in the Releases section, I've just zipped and uploaded the package created with 'electron-forge package --platform=darwin,win32 --arch=x64'. This may or may not be wise ¯\(ツ)/¯
"Why is it called AmigaPal?" - I made this for myself, to speed up converting audio samples into the format I generally use in ProTracker on the Amiga. They need to be mono, 8bit, and it's useful if they conform to the samplerates ProTracker uses for musical notes. By default AmigaPal converts to 27928hz (A-3), which produces a relatively high quality 8bit 8svx file. So it's a helper tool (hence pal), plus I grew up using PAL-region Amigas (hence pal), plus I like the redundancy of Amiga (friend) and Pal (friend). Also it currently defaults to using PAL samplerates for ProTracker notes...I may add in NTSC as an alternative if there's any demand. AmigaPal is essentially a front-end for a SoX command that I baked with the help of h0ffman, kebby and some of my own trial-and-error testing. The dream would be to replicate the lowpass filter 8bitbubsy has implemented in his MacOS/PC port of ProTracker and use it as post-bit reduction processing to reduce some dithering noise, but I haven't been able to match it so far. Right now, AmigaPal gives the best quality I've been able to achieve within ProTracker's limitations, according to my tastes - your mileage may vary!