sdatkinson / NeuralAmpModelerCore

Core DSP library for NAM plugins
MIT License
296 stars 59 forks source link

Make core dsp code more independent #10

Closed mikeoliphant closed 1 year ago

mikeoliphant commented 1 year ago

I'm using the NAM code in another context (ie: not using IPlug2). I've currently got my own hacked up version, but it would be nice to have the core code be more easily isolated from the specific plugin context.

To this end:

The dsp code is currently using "iplug::sample" for the sample format. The neural network code is all float-based. Maybe it should require I/O as float?

The dsp code references parameters, but they don't seem to actually be used anywhere (unless I'm missing something?). It also takes input/output gain, but they seem to be hardcoded to 1.0 - the actual gain adjustments seem to be done independently in the plugin (which I think makes sense). Maybe the dsp gain code, the parameters, or both could be removed?

mikeoliphant commented 1 year ago

I'm happy to take a stab at this if you want - let me know if it is something you'd rather do yourself.

sdatkinson commented 1 year ago

I agree mostly with this all; there's a bit of cleanup to be done.

Seems like this could be broken into a few Issues?

The dsp code is currently using "iplug::sample" for the sample format. The neural network code is all float-based. Maybe it should require I/O as float?

Agreed. There is some classical DSP in here (e.g. the biquads) that I suppose would benefit from doubles, but yeah, the NN code is designed to work in single-precision. Perhaps we need both for different parts? Open to feedback.

The dsp code references parameters, but they don't seem to actually be used anywhere (unless I'm missing something?).

Can you tell me where you're looking?

It also takes input/output gain, but they seem to be hardcoded to 1.0 - the actual gain adjustments seem to be done independently in the plugin (which I think makes sense). Maybe the dsp gain code, the parameters, or both could be removed?

Agreed.

mikeoliphant commented 1 year ago

The dsp code references parameters, but they don't seem to actually be used anywhere (unless I'm missing something?).

Can you tell me where you're looking?

The "params" argument to the dsp::process method. It doesn't seem to actually be used - at least in the plugin implementation. The plugin just passes a map of dummy "Input" and "Output" parameters that are just set to 0.