sdatkinson / NeuralAmpModelerPlugin

Plugin for Neural Amp Modeler
MIT License
1.98k stars 132 forks source link

[FEATURE] Make core dsp code more independent #90

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:

1) 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?

2) 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?

Thoughts? I'm happy to do the legwork here, but I wanted to get feedback before proceeding.

olilarkin commented 1 year ago

Hi Mike, your points are valid, i'd just point out iPlug2 can compile to Linux (on a branch) if that's any help for what you want to do.

olilarkin commented 1 year ago

Would love to improve iPlug2 support for RPi

mikeoliphant commented 1 year ago

Thanks, Oli. In my particular case, it is integrating into a custom framework rather than building a plugin, so I really need to get at the NAM dsp code directly.

sdatkinson commented 1 year ago

This is a good idea and I intend to get to it. Sit tight :)

mikeoliphant commented 1 year ago

It may even make sense to put the core NAM code (ie: just the NN dsp code without eq, noise gate, iplug, etc.) in a separate repo?

sdatkinson commented 1 year ago

Yep exactly :)

sdatkinson commented 1 year ago

Might have this this weekend :)

mikeoliphant commented 1 year ago

Great! This will be very helpful for porting and overall maintenance.

Btw, my messing around with code shows that removing the unused gain section and avoiding unnecessary buffer copies can shave a good 10% of overhead processing.

sdatkinson commented 1 year ago

Great! This will be very helpful for porting and overall maintenance.

Btw, my messing around with code shows that removing the unused gain section and avoiding unnecessary buffer copies can shave a good 10% of overhead processing.

Oh I believe it! This hasn't really gotten out of the "just make it work" phase to the "make it efficient" phase apart from your help (thanks!) 😄

mikeoliphant commented 1 year ago

Core issues still remain, so I'll re-open the issue on the new repo.