tidalcycles / Clean-Samples

Like Dirt-Samples, but cleaned up
GNU General Public License v3.0
44 stars 4 forks source link

Sample Quality, Normalization and Loudness #8

Open jkbd opened 3 years ago

jkbd commented 3 years ago

Thanks for the effort so far!

In ddbc883c324159e2591c4c580d487d68dc1152c1 the README states:

We recommend normalising them to xxx dB

I did some experiments with Dirt-Samples in the past and found that normalization is complicated. What comes to my mind is:

So my suggestions to rephrase this, are:

Probably this could form a new section in the README on "Sample Quality". Also with:

What do you think?

cleary commented 3 years ago

This is good - some more detail on how this should look/waveforms and examples of some common good examples, or a reference set would be great in a README

yaxu commented 3 years ago

Thanks @jkbd! I know very little about sample mastering really and this all sounds great.

I think we should be careful not to discourage contributions, so tackling this in two parts in the README could be a good idea. One bit that says more or less what it does now, and another 'advanced' bit with all this additional advice.

Personally I'm not super worried about this stuff, I guess loudness is just another property of a sample that I play with when improvising. Our aim isn't necessarily to compete with commercial software in making conventional sounding recordings for radio play. So the priority is to have a nice diverse set of sample banks that people can contribute to as easily as possible.

On the other hand this is all good advice, which we should try to follow when choosing sample packs for the 'default' superdirt samples etc. This sample mastering could happen at a later stage though.

yaxu commented 3 years ago

I've updated the readme a bit - PRs very welcome!

jkbd commented 3 years ago

Later I might provide a Python script that complains if a given *.wav violates the MUST-constraints. But until then, some more ideas:

telephon commented 3 years ago

Good points!

As far as SuperDirt is concerned (I see that this may not matter)

jkbd commented 3 years ago

Some analysis of Dirt-Samples:

2021-03-26_dirt-samples-02

You can peek at the Python code.

DC-offset can be improved a lot! (Edit: true_peak() was wrong in the first place.)

yaxu commented 3 years ago

Interesting! Dirt-Samples is mostly just the contents of my hard drive from ten years ago..

jkbd commented 3 years ago

I just learned, 8-bit samples can possibly be unsigned. That file is also from Dirt-Samples:

$ soxi ./sugar/001_crab.wav

Input File     : './sugar/001_crab.wav'
Channels       : 1
Sample Rate    : 11025
Precision      : 8-bit
Duration       : 00:00:17.18 = 189390 samples ~ 1288.37 CDDA sectors
File Size      : 189k
Bit Rate       : 88.2k
Sample Encoding: 8-bit Unsigned Integer PCM

With unsigned encoding the mean of a sinewave is not zero! The scipt above counted this file and some more as "with DC-offset".

yaxu commented 3 years ago

Heh, those samples are probably ripped from a MAME rom. I think I made the 'mp3' ones by reading mp3 files as raw data.