algorithmic-music-exploration / amen

A toolbox for algorithmic remixing, after Echo Nest Remix
BSD 2-Clause "Simplified" License
332 stars 87 forks source link

Default DSP Settings #18

Open tkell opened 8 years ago

tkell commented 8 years ago

Librosa has defaults of a 22050 sample rate, and a hop length of 512.

Brian comment that we may eventually use other feature generation / analysis tools that having other defaults, and should consider that.

I feel like we can worry about that when we get there, myself?

bmcfee commented 8 years ago

There are a few concerns here:

1) librosa has defaults, and they might not be what we want for any given task. (For example, it's possible to get more accurate onset detection just by ramping up the sampling rate and decreasing the hop size.)

2) for any given analysis within librosa, the optimal settings may change. Overriding the defaults is generally easy, but you do have to be consistent in how you call functions. So the question is: where do we want to store the dsp parameters for each feature extractor?

We just went through this discussion over here, which lead to the development of the presets package. This makes it easy to override the defaults in one place without having to remember to dot all the i's for every function call.

tkell commented 8 years ago

a) Presets is gorgeous, but terrifies me. Are you sure you're not a Ruby programmer? ; p

b) For the purposes of Amen, we're extracting each feature in its own function. Would it be too simple to simply change the librosa defaults in a feature extraction function that needs changing?

bmcfee commented 8 years ago

a) Presets is gorgeous, but terrifies me. Are you sure you're not a Ruby programmer? ; p

:rage4:

Seriously though, It doesn't actually do anything to the module, it just provides quasi-transparent wrappers that clobber defaults with custom settings.

b) For the purposes of Amen, we're extracting each feature in its own function. Would it be too simple to simply change the librosa defaults in a feature extraction function that needs changing?

Not at all. I'm simply thinking ahead to potential headaches that might arise if we decide to change settings down the line and maybe forget to update a function call. (This has been known to happen.)

bmcfee commented 8 years ago

FWIW: in one of my other projects, I'm moving to sr=32768 and hop_length=512 because powers of two give me warm fuzzies inside (and simpllify a lot of downsampling/pooling logic)`

blacker commented 8 years ago

wow, never heard of that sample rate before, and my initial knee-jerk reaction has given way to reading wikipedia about the many different rates ppl actually use. 352800Hz, 5644800Hz, it's a wide world out there