Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added dspData struct and appropriate get_dsp() -methods to work with it. #31

Closed
wants to merge 4 commits into from

Conversation

masqutti
Copy link
Contributor

Let's try this again. :) Just the dspData struct addition, I added the metadata as a JSON as I don't know the exact properties (and I guess they are still on poll anyways?) but we can always add more specific data in in the future I guess.

Copy link
Owner

@sdatkinson sdatkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this!

However, there's some typing that isn't quite correct, and there's the addition of the new filesystem implementation that I don't think will compile as-is?

Since those might cause problems, it would probably be easiest to decrease the scope of this PR to defining dspData and extending the get_dsp() interface.

@@ -1,6 +1,6 @@
#pragma once

#include <filesystem>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice having all these #includes removed :)

@@ -22,6 +25,8 @@ enum EArchitectures
kNumModels
};

using sample = float;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the scope of this? It'd be global, wouldn't it? Since it's in a header?

The NAM models process floats, but the other DSP (the EQ filters) might operate on doubles.

I know it's a bit messy right now, but this is raising a flag for me about potential problems.

@@ -69,7 +74,7 @@ class DSP
// Should we normalize according to this loudness?
bool mNormalizeOutputLoudness;
// Parameters (aka "knobs")
std::unordered_map<std::string, double> _params;
std::unordered_map<std::string, sample> _params;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sample isn't a good type for params. Ideally, they'd have their own type.

That type would be float though, based on how the training currently is set up (using torch.Tensors, which are single-precision by default).

std::string architecture;
nlohmann::json config;
nlohmann::json metadata;
std::vector<float> params;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice floats here vs line 72. Not good.

@@ -191,11 +196,24 @@ class Conv1x1
// Utilities ==================================================================
// Implemented in get_dsp.cpp

struct dspData
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this :)

@@ -3,12 +3,15 @@
#include <stdexcept>
#include <unordered_set>

#include "ghc/fs_std_impl.hpp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this? Looks like a filesystem implementation?

I think i like it in principle, but I don't see it with this PR? I'd prefer overall to have this change (filesystem tools) in a separate PR.

@sdatkinson
Copy link
Owner

Resolves #45.

@masqutti
Copy link
Contributor Author

Sigh! Somehow I thought that new pushes on this branch would not propagate to the pull request automatically... Little did I know. I will, once again, create a new pull request with just the dspStruct addition 🙃

@masqutti masqutti closed this May 25, 2023
@masqutti masqutti mentioned this pull request May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants