GuitarML / NeuralPi

Raspberry Pi guitar pedal using neural networks to emulate real amps and effects.
https://guitarml.com/
GNU General Public License v3.0
1.06k stars 59 forks source link

Questing regarding bitdepth/sample rate #34

Open mabushey opened 2 years ago

mabushey commented 2 years ago

The plugin processes at 44.1kHz (specified in config file) for the neural net DSP.

What would be involved to make it work at 24/96? I'm OK throwing a lot more CPU than a PI at it.

GuitarML commented 1 year ago

@mabushey I've been thinking about this lately as well, there is a great article by @jatinchowdhury18 that explains a good solution, which has been implemented into RTNeural: https://jatinchowdhury18.medium.com/sample-rate-agnostic-recurrent-neural-networks-238731446b2

I believe it would be a fairly straight-forward code update to tell RTNeural to use samplerate correction.

mabushey commented 1 year ago

You asked about my 24bit use case... 20 years ago I was in an alternative band with an amazing singer and great guitarists. We recorded in 24 bit. I could not tell the difference between 24 bit and 16 bit at all. 15 years ago I had friends who were amazing musicians who had a progish rock band. They were highly intelligent and very accomplished in their life. One day I went to their studio and they were playing one of their new songs. I literally couldn't shut up about how awesome it sounded. They had a classical chello player lay down some backing, and the mix, and everything was like audio crack. I was blown away. It was just so full and rich. 15 minutes later they played it again and I said "What happened, it sounds flat". Their response: "You were listening to 24bit before, we just downmixed to 16bit to burn to CD for the listening while driving in the car test". One of my favorite bands is Rush. I have most of their albums in 24bit. I don't think I could pass a blind test as to 16bit vs 24bit with their music. I know in certain cases it's a night and day difference. There are so many factors and we're pretty clueless how our brains interpret music. As far as recording/mixing goes, my belief is it would be very ignorant to record in 16bit - even if it appears to sounds fine the mixing errors are just going to add up. Maybe something as simple as running it through an analog pedal could fix this, but I view it as a huge unknown and if garbage in gives garbage out, I at least want my in to be less garbage.

GuitarML commented 1 year ago

@mabushey Sorry for the confusion, I originally thought you were asking about a 24kHz samplerate, then realized you were obviously talking about bit depth and edited my comment. It should work with different bit depths currently, whether the models maintain that fidelity is a different question. Pytorch uses floating point 32 data, but depending on how the data is handled before that might negate any benefits of using 24 or higher bit depth. I've been using PCM16 data recently for the portability, and I can't tell the difference, but probably worth some investigation.