![]() |
![]() |
#41 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
![]() The synchronization is relevant only when chasing high quality, so I'd be surprised if for "normal" use cases like modules playback the tracker routines care about this issue at all. |
|
![]() |
![]() |
#42 | ||
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
I tested the output of the very last, quiet, part of the coda of the demo music, repeated for 14 seconds on my A1200: * volume 1: there is some barely audible noise that requires concentration and headphones to hear; * volume 0: the noise is very audible. This means that even if the period is 50 and even if the volume counters get reloaded when a new sample gets written to AUDxDAT (as the other test proved and also as logical), a volume of 1 still has some effect, whereas I'd have expected not to work at all, as the volume counter can never reach 0 in 50 clocks. Could it be that the volume counter actually starts from 0 and then wraps around from 63? Quote:
Later I hope to whip up a proggie that plays back 8 bit waveforms and to make also a version that does the volume modulation you proposed. By the way, I find it a really nice idea! |
||
![]() |
![]() |
#43 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
It will not work as intended for higher feeding rates. One possible solution that was AFAIK not tested yet is to split the sample into two 8bit ones (per side) depending on the sound frequency: one channel for mids and highs and one channel for bass. The bass channel can run on lower feeding rates and use just regular audio DMA, while the mids and highs are fed to the other channel by CPU at much higher feeding rates. So you would use all 4 hardware channels at full volume and avoid the mentioned problem and the CPU demand would be the same as 2 of the channels are just using regular DMA. |
|
![]() |
![]() |
#44 | ||
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
Quote:
Last edited by saimo; 29 May 2024 at 15:08. Reason: Fixed typo. |
||
![]() |
![]() |
#45 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
Sadly we can not apply a low-pass filter per channel on the amiga - otherwise we could work with noise shaping for the bass as well ... but maybe some dithering would still work. So it would need some testing how 8bit quantization noise is perceived by the human ear for bass frequencies and if we would get audible artifacts from dithering... |
|
![]() |
![]() |
#46 |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
|
![]() |
![]() |
#47 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,307
|
Quote:
|
|
![]() |
![]() |
#48 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@Gorf
Quote:
@all I just finished preparing the tools. Now just some time to test them on the A1200 (I've been working in WinUAE), prepare the package and then some basic instructions. |
|
![]() |
![]() |
#49 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Alright, here are the tools for you to fiddle with: https://www.retream.com/_temporary/AQA.lha
A little premise... To make the playback as fast as possible, I designed three very basic, chunk-based, uncompressed file formats which I called "AQA" = "Amiga Quality Audio" (pun related to WAV intended): * AQA0: stereo 8-bit * AQA1: stereo 14-bit * AQA2: stereo 8 bit carrier + 6 bit signal 2:1 AM (Sorry, for the moment being there's no documentation.) Now, some quick instructions... The archive contains 6 programs to be run from shell: * cWAV8toAQA0: converts an unsigned 8-bit WAV to an AQA0 * cWAV16toAQA1: converts a signed 16-bit WAV to an AQA1 * cWAV8toAQA2: converts an unsigned 8-bit carrier WAV and an unsigned 8-bit signal WAV to an AQA2 * sAQA0/1/2: streams an AQA0/1/2. 68020+ required. The command line parameters are self-explaining. cWAV8toAQA0 and cWAV16toAQA1: * WAVFILEPATH=WAVFP/A * AQAFILEPATH=AQAFP/A * TEXTFILEPATH=TFP/K cWAV8toAQA2: * CARRIERWAVFILEPATH=CWAVFP/A * SIGNALWAVFILEPATH=SWAVFP/A * AQAFILEPATH=AQAFP/A * TEXTFILEPATH=TFP/K sAQA0: * AQAFILEPATH=AQAFP/A * PLAYBACKFREQUENCY=PF/K/N * PLAYBACKPERIOD=PP/K/N * FASTINTERRUPTHANDLER=FIH/S * FILTERON=FO/S * VOLUME=V/K/N * QUIET=Q/S sAQA1 and sAQA2: * AQAFILEPATH=AQAFP/A * PLAYBACKFREQUENCY=PF/K/N * PLAYBACKPERIOD=PP/K/N * FASTINTERRUPTHANDLER=FIH/S * FILTERON=FO/S * QUIET=Q/S If no frequency or period is specified, the one indicated in the AQA file is used. Fiddling with those parameters allows to see how far the machine can be pushed. At some point, playback will start to stutter. In the worst case, the machine will freeze (adding safety code impacts radically the performance, so I didn't include any). Anyway, to freeze the machine, really small periods are required: sAQA1, on my A1200 in stock configuration, hangs at period 30 (118229 Hz) and, when the Blizzard 1230 IV is on, it hangs at period 11 (322445 Hz). Speaking of performance, the FASTINTERRUPTHANDLER option tells the player to bypass the system handler of the level 4 interrupt and use a really tight interrupt handler (by the way, the aforementioned figures come from this option). If not specified, a system-compliant handler is used, which performs much worse. For safety, the channels get allocated first through the audio.device in all cases. During the playback nothing shows (as the video DMA channels get turned off), except crazy colorbars when the system interrupt handler is used. Playback can be interrupted by pressing (and keeping pressed for a little while) the right mouse button. Finally, here are some test files, which I derived from this one provided by Sony: * 55420 Hz 16-bit WAV * 96000 Hz 8-bit WAV * 55420 Hz 8-bit WAV to be used as carrier * 27710 Hz 8-bit WAV to be used as signal (it's just a 1 Hz sinusoid) * 96000 Hz 8-bit AQA0 (obtained from 96000 Hz 8-bit WAV) * 55420 Hz 14-bit AQA1 (obtained from the 55420 Hz 16-bit WAV) * 55420 Hz 14-bit AQA2 (obtained from the carrier and signal WAVs) (Given this has been written in the usual haste - I shouldn't be sitting here now - I'm pretty sure numerous edits will follow ![]() Last edited by saimo; 10 June 2024 at 23:03. |
![]() |
![]() |
#50 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
|
|
![]() |
![]() |
#51 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
It's a very old concept - Paper from 1964: https://ieeexplore.ieee.org/document/1088973 More practical explanation: https://www.allaboutcircuits.com/tec...on-distortion/ (What is Dithering? Using Dithering to Eliminate Quantization Distortion) Last edited by Gorf; 30 May 2024 at 00:13. |
|
![]() |
![]() |
#52 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
Main takeaways for me: * channels phase shift: apart from the DMA slots issue (which is irrelevant here), was it eventually fully understood? IIRC somebody wrote that it's due to the DACs; * volume counters counting upwards: this answers my question about how it was possible that a volume of 1 has some effect also with a period of 50; given that the AHRM uses "volctrrld" (or something like that - I don't have it at hand now), I had assumed they were counting downwards. Also, now that I know how the volume counters work and that they get reloaded also in CPU-driven operation, I can see that in this case of 14-bit playback with period 50 the error that affects the second sample of each word containing the least significant 6 bits is that it gets sent to the DAC with a delay of 14 clocks, so for such an interval of time the upper byte and the lower one go out of sync. That said, despite this error and the imprecision of the 14-bit method, the result (at least on my A1200) is very good to the ears (I've tried sampling the output by connecting the A1200 to this PC, but there's a remarkable noise floor even when no sound is output). Last edited by saimo; 30 May 2024 at 11:48. |
|
![]() |
![]() |
#53 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
OK, I will (hopefully later today, after updating the tools, as the AM ones have stupid 0-padding in the signal data, although the player can be modified to remove that padding - and thus save 25% of space - at no computational cost).
Last edited by saimo; 31 May 2024 at 13:19. Reason: Fixed typo. |
![]() |
![]() |
#54 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Promised script to convert SoX supported formats (flac can be used so feel free to feed your 192kHz 24 bit precious recordings) - hope script is self descriptive (just kidding
![]() With used noise shaping filter this is measured noise floor (source was silence at 192kHz 32 bit float converted with help of the provided script to 64489Hz 8 bit) - with Paula optimal filter this will be probably way better. There is also two gentle (+6dB) highpass (high shelf) filter to compensate two things - first embedded Amiga low pass filter - as default set Amiga 500 4.42kHz and second named preemphasis (1/8 sampling rate) - to compensate overall low pass filter (reconstruction?) in Amiga - both together provide approx 12dB boost so using setting with filter ON is recommended - should be neutral in overall response. I use also sharp bandpass filter from 16Hz to 32kHz (overkill probably - can be removed especially if your goal is to use extremely high oversampling rates - but this will be waste of bits to be honest especially if noise shaping filter will have suboptimal characteristic). Due high level of ultrasonic signal (noise) i recommend to apply 20..22kHz low pass filter at the amplifier input or use moderate power level to not burn your tweeters (or use speakers insensitive to excessive high levels of ultrasonic signals) Spectrograms are produced for source and for converted file - they are Amiga friendly i.e. using 16 colors and size for 640x512 screen, IFF SVX can be produced but it is poor choice for stereo (for example foobar 2k plays stereo 8svx at mono twice longer i.e. same as channel order is stored in file). Code:
@setlocal @REM Where to Find SoX @set SoX=C:\sox @set PATH=%PATH%;%SoX% @set PAL=28375160 @set NTSC=28636363 @rem SET CLK=28375160 @noise shapinf filters - some of them are designed only for 44.1kHz, some also for 48kHz - as Paula use different freq then frequency warping will occure - filter characteristic will be shifted - transposed - depends on how far from primary 44.1k/48k sampling rate is located. @rem lipshitz, f-weighted, modified-e-weighted, improved-e-weighted, gesemann, shibata, low-shibata, high-shibata @set noiseshp=improved-e-weighted @rem LowPassFilter F= @rem Amiga 500/2000: 4.42 kHz (100 nF, 360 ?) @rem A600: 4.42 kHz (100 nF, 360 ?)11 @rem A1200 Rev1d: 27.7 kHz (3.9 nF, 1.5 k?) @rem A1200 Rev2: 34.4 kHz (6.8 nF, 680 ?) @rem A4000: 4.52 kHz (47 nF, 750 ?) @SET LPF=4420 @SET PERIOD=55 @SET /a CLK=%PAL%/8 @SET /a AFREQ_I = (((100*%CLK%)/(1*%PERIOD%))+1) / 100 @SET /a AFREQ_F = (((100*%CLK%)/(1*%PERIOD%))+1) %% 100 @SET AFREQ=%AFREQ_I%.%AFREQ_F% @rem SET /a APREC_I = (((100*%CLK%)/(4*%PERIOD%))) / 100 @rem SET /a APREC_F = (((100*%CLK%)/(4*%PERIOD%))) %% 100 @rem SET APREC=%APREC_I%.%APREC_F% @SET /a APREC_I = (((100*%CLK%)/(8*%PERIOD%))) / 100 @SET /a APREC_F = (((100*%CLK%)/(8*%PERIOD%))) %% 100 @SET APREC=%APREC_I%.%APREC_F% @SET file=%1 @SET fname=%~n1 @ECHO file=%file% @ECHO filename=%fname% @ECHO: @ECHO -------------------------- @ECHO: @ECHO Samplerate=%AFREQ%Hz @ECHO: @ECHO -------------------------- @ECHO: @ECHO Precompensation=%APREC%Hz @ECHO: @ECHO -------------------------- @ECHO: @ECHO Amiga LowPass freq=%LPF%Hz @ECHO: @ECHO -------------------------- @ECHO: @pause @rem SET aproc= @rem SET aproc=sinc 16-13.85k treble +6.0206 %LPF% .5 treble +6.0206 %APREC% .5 compand 0.25,1 6:-inf,-90.1,-inf,-90,-75,-70,-70 -3.0103 -90 0.20 @SET aproc=sinc 16-32k treble +6.0206 %LPF% .5 treble +6.0206 %APREC% .5 gain -n -0 @rem setting max signal level with headroom for noiseshaping @rem set clip= @rem set clip=gain -n -1.769537 @rem set clip=gain -n -2.110204 @rem set clip=gain -n -2.153742 @rem set clip=gain -n -2.197500 @set clip=gain -n -0.526579 @rem mono @rem sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V4 -D -G %file% -e float -b 32 -t f32 "%fname%.f32" remix - rate -v -s -I %AFREQ% %aproc% stats -b 8 stat @rem sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 1 -r 48299 -e float -b 32 -t f32 "%fname%.f32" -c 1 -b 8 -e signed-integer -t s8 "%fname%.s8" %clip% dither -f %noiseshp% -p 8 stats -b 8 stat @rem sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 1 -r %AFREQ% -b 8 -e signed-integer -t s8 "%fname%.s8" "%fname%.8svx" @rem sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 1 -r %AFREQ% -b 8 -e signed-integer -t s8 "%fname%.s8" "%fname%.wav" @rem sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 1 -r %AFREQ% -e float -b 32 -t f32 "%fname%.f32" -n spectrogram -z 96 -q 13 -w Kaiser -y 513 -x 496 -o "%fname%_32.png" @rem sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 1 -r %AFREQ% -e signed-integer -b 8 -t s8 "%fname%.s8" -n spectrogram -z 96 -q 13 -w Kaiser -y 513 -x 496 -o "%fname%_8.png" @rem stereo @sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V4 -D -G %file% -e float -b 32 -t f32 "%fname%.f32" rate -v -s -I %AFREQ% %aproc% stats -b 8 stat @sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 2 -r 48299 -e float -b 32 -t f32 "%fname%.f32" -c 2 -b 8 -e signed-integer -t s8 "%fname%.s8" %clip% dither -f %noiseshp% -p 8 stats -b 8 stat @sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 2 -r %AFREQ% -b 8 -e signed-integer -t s8 "%fname%.s8" "%fname%.8svx" @sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 2 -r %AFREQ% -b 8 -e signed-integer -t s8 "%fname%.s8" "%fname%.wav" @sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 2 -r %AFREQ% -e float -b 32 -t f32 "%fname%.f32" -n remix - spectrogram -z 96 -q 13 -w Kaiser -y 513 -x 496 -o "%fname%_32.png" @sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -V6 -D -c 2 -r %AFREQ% -e signed-integer -b 8 -t s8 "%fname%.s8" -n remix - spectrogram -z 96 -q 13 -w Kaiser -y 513 -x 496 -o "%fname%_8.png" @del -q "%fname%.f32" @del -q "%fname%.s8" @pause @endlocal Last edited by pandy71; 30 May 2024 at 17:20. |
![]() |
![]() |
#55 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
|
|
![]() |
![]() |
#56 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
I did not say otherwise - in fact I brought it up as a method to reduce noise for a potential separate bass channel that is replayed via DMA at 28kHz, where noise shaping is no option. |
|
![]() |
![]() |
#57 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
I just made clear separation as dither gain from oversampling is not so useful as gain from noise shaping - ideally dedicated application (sample player) for Amiga should optimally use Paula - as pointed by Vanderkooy and Lipschitz 4 times oversampled 8 bit audio with optimal noises shaping can deliver better results than audiophile oriented SACD format (technically this 64 times oversampled 1 bit bitstream so literally 1 bit DAC Sigma Delta output recorded on disc.
|
![]() |
![]() |
#58 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
Even the not 100% temporal alignment of these channels are probably irrelevant if one of them played only the lower frequency part of the source material: https://audioxpress.com/article/audi...ally-a-problem While this site talks about jitter, the same would be true for audio-cannel misalignment Last edited by Gorf; 30 May 2024 at 17:36. |
|
![]() |
![]() |
#59 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@pandy
Many thanks for the hard work! One thing, though: Quote:
By the way, it's years that I no longer have speakers: I moved from place to place several times, and every time I had to get rid of everything, until I just grew tired of that. So now my A1200 is connected to a monitor with unsignificant speakers and for these tests I'm simply using commercial-quality headphones. Also, I tried to sample the A1200 output connecting the machine to the PC, but there's a consistent noise floor that would hamper any kind of software-based measurements. In short: I'm not really the right person to make appropriate tests ![]() |
|
![]() |
![]() |
#60 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Uploaded updated tools.Download & informationChanges: * removed padding bytes from the signal data in the AQA2 files (so, sAQA2 no longer supports the old AQA2 files); * added rounding to the 16->14-bit conversion code in cWAV16toAQA1; * made cWAV8toAQA2 accept signal files which contain enough data with respect to the carrier files (before, it required the data ratio to be exactly 2:1).The audio files were also updated, as I have re-rendered the WAVs from the original 24-bit FLAC (instead of the intermediate 16-bit WAV) and then converted them to AQAx with the updated tools.Now I'm going to make some tests by massively reducing the amplification of the test song and then by hearing the results on the Amiga.
Last edited by saimo; 10 June 2024 at 23:06. Reason: Fixed broken English. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ArtPazz - New game for AGA Amigas [WIP] | saimo | Amiga scene | 38 | 07 June 2023 15:08 |
RNOPDF for ECS/AGA Amigas released | jPV | News | 5 | 10 July 2020 07:57 |
Recommend a good Hertz switcher? | lordofchaos | request.Apps | 5 | 28 June 2013 04:55 |
How does a 50 Hertz image get displayed? | Richardcavell | Coders. Asm / Hardware | 14 | 15 March 2013 13:59 |
AGA Amigas | Kitty | Retrogaming General Discussion | 25 | 13 October 2009 12:56 |
|
|