English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Asm / Hardware (https://eab.abime.net/forumdisplay.php?f=112)
-   -   Audible tick when playing samples (https://eab.abime.net/showthread.php?t=114194)

Haplo 10 April 2023 06:27

Audible tick when playing samples with ptplayer
 
Hi all,

I have a few small .wav samples that I have saved to "IFF (Amiga/SVX8/SV16), signed 8-bit PCM" using Audacity. When I play these samples using ptplayer, I hear one audible "tick" noise at the beginning of them, regardless of whether a MOD is also playing or not. The IFFs don't have this noise when played back in Audacity.

When this happens in a circuit is it because of a sudden DC level change in the audio signal. Is something similar happening here? How to fix this?

a/b 10 April 2023 08:32

Did you trying setting the first 2 sample bytes (raw, not iff) to 0? The player should do that automatically to prevent it, but...
You could also try loading a sample into Protracker and saving it back to take care of that.

phx 10 April 2023 10:51

Yes, this is a FAQ, and a/b's hint is correct.
Please read the FAQ section in ptplayer.readme. (There is also an option without clearing the first two bytes).

Haplo 10 April 2023 14:58

Yes, I am already using the "NULL_IS_CLEARED" option. Moreover, in my experience, not getting this right will cause a high-pitch noise at the end of the sample (as the FAQ says), not a "click" at the beginning.

I'll run the samples through Protracker anyway, just in case Audacity is doing something unexpected.


Edit:
I have confirmed that locations $0 and $1 stay 0. Also, passing the samples through ProTracker didn't help, regardless of the value of "NULL_IS_CLEARED". The click at the beginning is still there. What else could be wrong?

meynaf 10 April 2023 15:50

Perhaps the samples aren't properly normalized, i.e. not centered around value 0.

phx 10 April 2023 18:17

Quote:

Originally Posted by Haplo (Post 1608151)
Yes, I am already using the "NULL_IS_CLEARED" option. Moreover, in my experience, not getting this right will cause a high-pitch noise at the end of the sample (as the FAQ says), not a "click" at the beginning.

Correct. I missed that. Then there is something else.
Can you share such a sample for testing?

Haplo 11 April 2023 10:29

1 Attachment(s)
They seem to be properly centred around 0 as well.

I have attached one of the samples, saved using Audacity and then ProTracker 2 clone 1.57. Thanks for taking a look.

hooverphonique 11 April 2023 10:34

Does ptplayer support playing back 8SVX directly (I'm not familiar with it) ?
If not, the IFF metadata in the file will cause some audible artifacts if played back.

a/b 11 April 2023 10:54

Players in general expect raw data. But that shouldn't be a problem, e.g. you load an IFF sample in protracker while composing a module, it gets converted and saved as raw within a module itself.
However, if you are using *external* samples, so you load an IFF sample yourself as a raw binary file and feed that to a player, that won't work (as hoover pointed out, the IFF header will be interpreted as raw sample data). Was this the case from the beginning?

Don_Adan 11 April 2023 11:29

Easy, dont use IFF files as samples for Protracker, save them as raw data. This is common bug. some Amiga soundformats handles IFF samples, but not Protracker.

Haplo 11 April 2023 12:55

This was it! Raw data it is. Thanks everyone for your help!

no9 11 April 2023 13:03

Quote:

Originally Posted by Don_Adan (Post 1608401)
some Amiga soundformats handles IFF samples, but not Protracker.


It does. You can store loop points data there. There is RAW/IFF/PAK switch in PT2.3.

phx 11 April 2023 13:40

Quote:

Originally Posted by Haplo (Post 1608434)
This was it! Raw data it is.

Great! I guess I have to make that clearer in the next readme, and maybe add another point to the FAQ. :)

Don_Adan 11 April 2023 15:00

Quote:

Originally Posted by no9 (Post 1608436)
It does. You can store loop points data there. There is RAW/IFF/PAK switch in PT2.3.

Maybe for experienced musicians. But i see too many Protracker mods with IFF files as raw samples when i ripped modules. Sometimes this is not hearable but sometimes hearable.

meynaf 11 April 2023 15:10

Protracker can load IFF samples, and will convert them to RAW inside the mod.
Thus, if the IFF file format isn't identified as such, you end up with IFF headers in samples.

No.3 11 April 2023 18:38

Quote:

Originally Posted by Haplo (Post 1608379)
I have attached one of the samples, saved using Audacity and then ProTracker 2 clone 1.57. Thanks for taking a look.

the 8SVX file attached has a broken VHDR chunk i.e. it contains invalid data

pandy71 11 April 2023 22:51

SoX seem to be OK with 8svx files - i use script like this to convert audio files into 8svx. Feel free to modify - it has some additional audio processing to deal with some Amiga limitations.

Code:

@setlocal

@REM Where to Find SoX
@set SoX=C:\sox
@set PATH=%PATH%;%SoX%


@SET PAL=28375160
@SET NTSC=28636363
@rem Paula PAL=3546895
@rem Paula NTSC=3579545.45454545


@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

@rem SET dither=dither -S
@rem SET dither=dither

@SET dither=

@rem lipshitz, f-weighted, modified-e-weighted, improved-e-weighted, gesemann, shibata, low-shibata, high-shibata
@set noiseshp=improved-e-weighted

@SET /a CLK=%PAL%/8
@SET PERIOD=128

@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%

@SET /a APREC_I = (((100*%CLK%)/(4*%PERIOD%))) / 100
@SET /a APREC_F = (((100*%CLK%)/(4*%PERIOD%))) %% 100
@SET APREC=%APREC_I%.%APREC_F%

@SET file=%1
@SET fname=%~n1

@ECHO Samplerate=%AFREQ%
@ECHO Precompensation=%APREC%
@ECHO %LPF%
@ECHO file=%file%
@ECHO filename=%fname%

@rem SET aproc=treble +6.0206 %LPF% .5 treble +6.0206 %APREC% .5 gain -n -0.085576 %dither%
@SET aproc=treble +6.0206 %LPF% .5 gain -n -0.085576 %dither%


@sox --multi-threaded --buffer 524288 --input-buffer 524288 -S -D -G %file% "%fname%.8svx" remix - rate -v -s -I %AFREQ% %aproc% stats -b 8 stat
@sox --multi-threaded --buffer 524288 --input-buffer 524288 "%fname%.8svx" -n spectrogram -z 64 -q 12 -w Kaiser -y 513 -x 496 -o "%fname%_8svx.png"

@pause
@endlocal

I use recent SoX build from https://audiodigitale.eu/repo/sox/ - it has some features not present in old SoX (seem SoX development was stopped few years ago)

Just checked that this particular SoX doesn't have integrated 'spectrogram' command as such it may be not the best one.

Haplo 12 April 2023 14:48

Thanks. Once I used Audacity to export those IFFs to raw files the annoying click went away.

pandy71 12 April 2023 19:31

Quote:

Originally Posted by Haplo (Post 1608765)
Thanks. Once I used Audacity to export those IFFs to raw files the annoying click went away.

In SoX you just need to replace extension .8svx to .s8 and it should work equally... Somehow i don't like Audacity (after they changed license and started spying users).

desiv 12 April 2023 19:35

You just need to put a floppy disk in the drive to stop that clicking...
...
sorry... couldn't help it...
;-)


All times are GMT +2. The time now is 19:26.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05300 seconds with 10 queries