astriiddev / Ami-Sampler-VST

VSTi 8-bit Sampler inspired by the sound of the famous Commodore Amiga for Windows/MacOS/Linux using VST3/AU/LV2
GNU General Public License v3.0
156 stars 2 forks source link

PAL/NTSC sample rate #4

Closed BitBlit88 closed 3 months ago

BitBlit88 commented 4 months ago

It would be nice if there were a switch to set the sample rate conversion to PAL or NTSC. I think at the moment "C-2" uses the "NTSC" sample rate of 8363 Hz. For PAL system, it is about 8287 Hz.

BitBlit88 commented 4 months ago

I just realized that I used only raw Amiga samples. If I convert them to wav with the "PAL" sample rate, the plugin uses the PAL sample rate. Perhaps the load dialog should show an option for PAL or NTSC if a raw sample is loaded.

astriiddev commented 4 months ago

I do plan on adding a playback samplerate text box (and perhaps a resample option) but I have to find/make room to put it. I've thought about making an "extended" options/settings menu for some settings like this that might not be used as often but would still be a nice option to have. The file dialog box is just the OS's standard box. There's not much of an option in JUCE to customize the dialog box itself and writing separate Win32, GTK, and AppKit dialog boxes to be able to include that one button would honestly be more work than it would be worth imo. You are correct tho, I do have the sample rate for raw files preset to 8363. Most of the raw samples I deal with are 8363 or 16726 and a lot of other trackers will default raw samples to a sample rate of 8363 (Fasttracker II and SchismTracker for instance). If you are primarily using PAL samples with sample rates of 8287, a few solutions for now would be:

  1. change the fine-tune of the sample after loading it
  2. resample to 8363hz with a program like SoX: sox -b 8 -e signed-integer -r 8287 [infile] -r 8363 [outfile]
  3. Convert to WAV (or IFF, if you'd like to keep it more Amiga accurate). SoX can handle the WAV conversion fine, but you might have to get a bit creative for converting it to IFF with a sample rate of 8287 as most IFF exporters don't have that as an option
  4. If you're building the plugin from source, you can just change lines 216 and 225 in astro_IffAudioFormat.cpp to say 8287 instead of 8363 Frankly, I'm going to keep the default sample rate of 8363 for RAW formats, as most trackers that support raw formats will default them to 8363. I'm going to add an extended options menu with more sample rate options further down the line, but it might be a bit before that gets added
BitBlit88 commented 4 months ago

Thank you for sharing your plans. The extended option menu would be a great enhancement. As you mentioned, there are a few workarounds that works fine. Thank you again for this great plugin.

astriiddev commented 3 months ago

Hey @BitBlit88 I've just released v0.7 of Ami Sampler! This version has the option to change the playback sample rate of a sample. You'll still have to change it upon loading a PAL sample, but the rate will save between sessions