xstreck1 / libpyin Goto Github PK
View Code? Open in Web Editor NEWPitch / fundamental frequency detection library for C,C++,C#
License: GNU General Public License v3.0
Pitch / fundamental frequency detection library for C,C++,C#
License: GNU General Public License v3.0
It doesn't work in Unity 2020.3.20f1 version.
DllNotFoundException: LibPyin
LoadLibrary.use () (at Assets/LoadLibrary.cs:30)
TestPyin.Start () (at Assets/TestPyin.cs:11)
I have imported the LoadLibrary.cs & LibPyin.dll to the Unity Assets folder.
Do you have any idea how to fix it?
What are the assumptions about samples? The main.cpp example for example has samples in the range [-1,1]?
i have this Unity AudioClip, then what should i do to draw the F0 ? can you point any direction ? thanks
Hi! Nice job here. I would like to comment that I get different results if using sonic-annotator with VAMP plugin. I'm working on it here:
https://github.com/EliosMolina/LibPyin
If you think there is something I should take into account to solve it, please let me know. Thanks.
Still the guy who opened the last issue and it's a different thing this time...
First of all, Streck, let me just say your work is great and I appreciate you making such incredible tools available for everyone to use.
So, since the .dll in your solution is for 32bit, I actually downloaded a Unity archived version with 32bit support (5.6.5f1) and installed it. Running that one, I also
BUT -> upon running the code I get the error
DllNotFoundException: LibPyin
LoadLibrary.use () (at Assets/LoadLibrary.cs:35)
I'm a total noob (as stated in the previous Issue) and I don't want to be pedantic at all, but I really don't know what to do.
Thanks for any possible replies!! :)
I wanted to use this great library, but I am finding that the GPL license is overly prohibitive, because the main use case for code like this is library use. So if I'd include this into a music app as a plug-in, then it'd require publicizing the whole music app, which I think is unreasonable.
Why isn't it licensed in LGPL?
In the Unity example section of the readme.md file it says to add the libpyin.dll to the assets but I can't seem to find this .dll file amongst the libpyin library folders I just downloaded from here. Sorry, maybe this is super obvious but I'm a silly newbie.
I am feeding the library a sample that's supposed to have a ~500 Hz tone, but it also has a lot of noise over it. The file is 44100 Hz 16-bit mono file.
The library gives me a list of pitches that read ~23kHz. Based on the file the file should not contain anything over 22050 Hz and the spectrum also doesn't show a lot of high-frequency energy.
Is this some sort of bug? Those values are non-sensical as frequency values for a 44.1 kHz file.
I am trying to create as small libraries as possible, and I noticed that the default CMakeLists.txt includes something about VAMP. I don't use VAMP.
I presume that at least lines 9-10 can be removed if VAMP support is not needed:
https://github.com/xstreck1/LibPyin/blob/master/CMakeLists.txt#L9
Right?
It would, possibly, be useful to share a "pyin-only" CMakeLists.txt.
Hello.
It seems that the LibPyin.dll has once again been removed from the repository?
Edit: Nevermind, I see it is in the release. Apologies!
I'm using https://github.com/xstreck1/LibPyin/blob/5a27943f5454d19b0b0f9a85457c153c04303a44/main.cpp with non-essential modifications.
I notice that the line:
Line 30 in 5a27943
returns 0 elements when it's called once and returns the expected elements when called a second time.
I've checked that the input is okay.
But it sounds as if the thing fails to initialize or something.
I called _pyin->getRemainingFeatures();
want to get each note's onset and offset.
I can get infos below, but I was wondering what it means? It doesn't looks like the percent of whole music length. Can you explain it? Many thanks
PYIN::FeatureSet features = _pyin->getRemainingFeatures();
for (const auto &feature : features) {
for (const auto &ff : feature.second) {
if (ff.hasDuration) {
ff.timestamp
ff.duration
}
}
}
output:
timestamp: 0.012226261, duration: 0.000651168
timestamp: 0.012935569, duration: 0.000558144
timestamp: 0.013679761, duration: 0.000593028
timestamp: 0.014423953, duration: 0.000593028
Could you please upgrade to latest vamp-plugin-sdk and latest pYIN?
Thanks.
Hello!
I am currently implementing a karaoke machine with a sing-star like game for fun and so far I love your lib, it seems to work out of the box with minimal changes for my C++ Qt5 project which is awesome! Except for my one issue:
This could very well be just me not using the library properly, maybe just a change in documentation?
I am doing the following:
void PitchDetector::processBuffer(QVector<float> &in){
//lib is in QSharedPointer
if(!mPyin.isNull()){
auto instd=in.toStdVector();
auto sz=in.size();
std::vector<float> pitches = mPyin->feed(instd);
auto np=pitches.size();
auto lastPitchPresent=mPitchPresent;
// How can I tell if a pitch is present?
mPitchPresent=(np>0);
if(mPitchPresent){
// Just care about first pitch we found
auto p=pitches[0];
// What is a valid pitch?
if(p>0.0){
mPitch=p;
}
}
auto change=((mPitch!=lastPitch) || (mPitchPresent != lastPitchPresent) );
if(change){
qDebug()<<"PITCH SIGNAL: "<<mPitchPresent << mPitch;
emit noteChanged(mPitchPresent, mPitch);
}
}
}
So this works, but the feed() method does always return a pitch! I tried setting different values for ::setCutOff(), including 0.0 and 1.0, but feed never returns without a pitch. The ouput looks like this:
PITCH SIGNAL: true 153
PITCH SIGNAL: true 138
PITCH SIGNAL: true 276
PITCH SIGNAL: true 138
PITCH SIGNAL: true 153
PITCH SIGNAL: true 138
PITCH SIGNAL: true 122
PITCH SIGNAL: true -430
PITCH SIGNAL: true -774
PITCH SIGNAL: true 106
PITCH SIGNAL: true 122
So my question/issue is; How can I know if a pitch was found or not, according to the cut off value selected?
Should I preprocess audio to remove noise?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.