-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Implement an internal CLI for loading soundfonts and setting engine parameters. #973
Conversation
clients/jack_client.cpp
Outdated
} | ||
|
||
|
||
std::vector<std::string> string_tokenize(std::string str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str
could be const ref here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix ...
try { | ||
synth.setOversamplingFactor(stoi(args)); | ||
} catch (...) { | ||
std::cout << "ERROR: Can't set oversampling!\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of these throw, however they're not thread-safe so we need a mutex in the callback. You can check the SfizzVstProcessor.cpp
file for an example, especially the doBackgroundWork()
and process()
functions. Basically you need to fully lock in this cli_thread_proc()
method, and use try_lock()
in the real-time thread (and exit if you can't take the lock).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've been testing and the "random breaks" when loading soundfonts seems to be fixed.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may still have breaks for big soundfonts. If you want to avoid them you could somehow fade out the current loaded file before loading a new one in, but none of our plugins does this currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate a little bit what you mean for "fade out" the "currently loaded soundfont"? ;-)
Do you mean ending active notes before loading the new soundfont?
I made a change and did some formatting but I cannot push to your branch. Would you mind allowing it? Otherwise I'll do another PR from my fork. |
You should allowed to write in my fork now. Thanks! |
Hi @paulfd ! Is there some problem with merging this? Can i do something? We are preparing a new stable version and we would like to install sfizz from your deb packages, so we can keep updated easily. Thanks! |
BTW, I sent you and invitation to write on my fork but it's pending yet. |
Hi ! Sorry I'm too taken in RL things, and I missed the invitation which is now expired. You can resend it, but I think there's a checkbox in the right column of the pull request interface that says "Allow edits by maintainers" which would allow me to write on your branch without having write access on the whole repository. Then I can push my changes and if you're OK with them we can merge :) |
Hi @paulfd ! I didn't find this check anywhere. Perhaps it's only available when creating the PR? |
We can let the CI run although there are no "tests" of the program. In the meantime maybe check my changes ! Once the command-line interface is stable on your side maybe it'd be good to write down some tests so that we don't accidentally regress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks OK now ;-)
I will write some tests ASAP.
BTW, are the tests required for merging this PR? |
No no |
BTW, add a new command line argument (--num_voices).