vadymmarkov / beethoven Goto Github PK
View Code? Open in Web Editor NEW:guitar: A maestro of pitch detection.
Home Page: https://github.com/vadymmarkov
License: Other
:guitar: A maestro of pitch detection.
Home Page: https://github.com/vadymmarkov
License: Other
Compiler Error. Switch must be exhaustive:
https://github.com/vadymmarkov/Beethoven/blob/master/Source/PitchEngine.swift#L76
When I specify the url variable to Config object, it will call OutputSignalTracker.start()function, but it can not enter this function and exit the program:
audioEngine.outputNode.installTap(onBus: bus, bufferSize: bufferSize, format: nil) { (buffer: AVAudioPCMBuffer!, time: AVAudioTime!) in
DispatchQueue.main.async {
self.delegate?.signalTracker(self, didReceiveBuffer: buffer, atTime: time)
}}
Hi I am trying to install Beethoven but I can't find the "Sources" folder that is required for manual installation. Maybe you were referring to the Source directory located in the root? Thanks
Hi @vadymmarkov, It's been a while since I've tried to compile my app that depends on this framework, and I'm getting an error when I try to import Pitchy: "Module compiled with Swift 3.0.2 cannot be imported in Swift 3.1"
I also tried updating Beethoven with Carthage and got the following error:
carthage update beethoven
*** Fetching Beethoven
*** Fetching Pitchy
*** Fetching Quick
*** Fetching Nimble
*** Checking out Nimble at "v5.1.1"
*** Checking out Quick at "v1.0.0"
*** Checking out Pitchy at "2.0.1"
*** Checking out Beethoven at "3.0.1"
*** xcodebuild output can be found in /var/folders/bm/25m_zbpn1ys21pt5xc004p6h0000gp/T/carthage-xcodebuild.PYOJL6.log
*** Building scheme "Nimble-iOS" in Nimble.xcodeproj
*** Building scheme "Nimble-tvOS" in Nimble.xcodeproj
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
I'm running Xcode 8.3.3
Any change you could compile and rerelease for Swift 3.1?
Thanks!
-Paul
Hey man,
Great library, I'm looking forward to use it however it looks like there is a discrepancy between the library and the example that you put in.
Can you put in the fix for that.
Thanks.
When running GuitarTuner on multiple, different iOS devices (iPhone, iPad), there is a Hang Risk issue raised each time InputSignalTracker's start() method is called.
This also happens with my own app when using Beethoven audio processing Swift library.
I don't know if it is XCode 13 issue, or if it has to be added in Package.swift. Has anyone dealt with it?
Hi,
Trying the Guitar Tuner example, I find that it detects pitches just out of the base level of noise that the microphone gets. So I'm looking for a way to "filter out" low level signals so that detection would only occur if the input level is above a certain value. I don't know much about AVAudio yet, so I'm asking if you have an idea on how to do this (or are planning to do it) before I dive into docs :)
Thanks
Hi,
I was just going through your library (which is one of the best I've come across in monophonic pitch detection). I was thinking if its possible to port it to work with watchOS target?
I would be happy to do it, although I'm very much a beginner in swift. I will just need some guidance for where to start.😅
Hello. First of all I want to thank you for developing such an amazing library.
I was going through the source code (inside the Source
folder) to learn how the library is implemented. I understand all the source code and what's going one, except for two questions I've got:
Check here. Why is the AudioSession category playAndRecord
? I mean, this library doesn't do playback at all. However, if I change the category to record
only, an error is thrown at runtime.
Check here. What is going on? The comment says //Check input type
.... but it's clearly referencing currentRoute.outputs
.... so is it input or output?
I checked Apple documentation. It says this about overrideOutputAudioPort
:
If your app uses the playAndRecord category, calling this method with the AVAudioSession.PortOverride.speaker option causes the system to route audio to the built-in speaker and microphone regardless of other settings. This change remains in effect only until the current route changes or you call this method again with the AVAudioSession.PortOverride.none option.
I understand the intent of the code. If we don't have any headphones (with microphone) plugged in, force the system to use the built-in mic. However, I think this falls back to these questions: 1. isn't this the default behaviour? and 2. why use category playAndRecord
?
Thanks!
When I play any tune there are call back method are called too many times why not call in once with correct frequency . It call to many time with diffrent frequencies.
Hi @vadymmarkov, first of all, thanks for this awesome library 🎹 🎉! It's been really helpful start understanding how pitch detection works.
My issue is that I'm trying to get individual notes in a sequence without one note being recognized multiple times. If I play say C4 for 1 second I'll get 5/6 calls to PitchEngineDelegate's
func pitchEngineDidReceivePitch(_ pitchEngine: PitchEngine, pitch: Pitch)
.
Is there a way to avoid this? Or some sort of comparison to detect if the exact same note is being played without interruptions? The goal is to be able to play a few individual notes (can be the same or different notes) and get the exact output like: A - A - C# - F - E
Trying to add as a Framework to an existing project and getting Swift Compiler Error:
Type 'AVMediaType' (aka 'NSString') has no member 'audio'
Hi, I'm trying to use this library with Swift 5 but it's giving me an error saying it's at Swift Version 3.0.
The podspec file has it set here:
Line 22 in 774fe12
Is that right?
I have integrated Pod in Objective C.
It Includes successfully. But When i am trying to create PitchEngine
object it not allowed to create object, it throws compile time error.
I'd love to use this on tvOS. Apart from InputSignalTracker is there anything you'd have to cut? I'm guessing it shouldn't be too tricky to add a tvOS target, you probably just didn't get around to it (yet?) 🙏
Hi there !
Sorry i am new to this, but I am desperate in finding a good solution for my pitch detection game made with unity.
I would love to use Beethoven in Unity if there is a way to do so ?
Any advice would be much appreciated.
best,
How about a Swift 3 version?
Having updated to the current master, I seem to now often encounter a problem in HPSEstimator.estimateLocation. The following line
for i in (minIndex + 1)..<maxsearch {
if spectrum[i] > spectrum[max2] {
...
crashes because minIndex = 20 (at least in both cases I had that crash) and maxsearch is <20 (15 or 17).
Just for information, is there a Swift 3 version in the works ? If not I might go ahead and try converting it...
By some reason mic recognition start only when start
called twice:
class ProcessingUnit: NSObject {
var pitchChangedHandler: ((String) -> ())?
let pitchEngine: PitchEngine = {
let config = Config()
let engine = PitchEngine(config: config, delegate: nil)
return engine
}()
override init() {
super.init()
pitchEngine.delegate = self
pitchEngine.start()
pitchEngine.start()
}
}
extension ProcessingUnit: PitchEngineDelegate {
func pitchEngineDidReceiveError(_ pitchEngine: PitchEngine, error: Error) {
}
func pitchEngineWentBelowLevelThreshold(_ pitchEngine: PitchEngine) {
}
func pitchEngineDidReceivePitch(_ pitchEngine: PitchEngine, pitch: Pitch) {
let value = pitch.note.letter.rawValue + "\(pitch.note.octave)"
pitchChangedHandler?(value)
}
}
Beethoven is deaf
Hey,
excellent library, there are other examples ??
I would like to create an analyzer of the item using your library.
I do not find simple examples that have mic input and output the F0 using YIN or other algorithm.
Thank you
public func stop() {
audioEngine.stop()
audioEngine.reset()
audioEngine = nil
captureSession.stopRunning()
}
on 2nd call, audioEngine.stop() will crash since audioEngine is nil.
I am getting multiple instances of the same fatal exception, across iOS 12 and 13.
Fatal Exception: com.apple.coreaudio.avfaudio
required condition is false: IsFormatSampleRateAndChannelCountValid(format)
The app is crashing when the pitch engine starts. Here is the relevant code:
private let engine = PitchEngine()
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
engine.start()
}
I found a stack overflow post referencing this crash, but it seems to be marginally helpful at best.
I dug around a bit in the Beethoven code, and traced this engine.start()
call back to the audio session setup:
Is this something you've seen before? Any ideas on how to resolve? Thanks
I'm loving Beethoven. Great library.
Currently, the pitch engine processes the incoming audio stream in consecutive, separate buffers. There's no overlap in the data between buffers. So for a 44.1kHz input stream and a standard 4096 sample size, the engine returns about ten results per second to the delegate.
I'd like to see support for buffers with overlapping samples. For example, I could specify a sample size of 4096 but an overlap of 2048 samples. Then the pitch engine would pass overlapping windows of audio data to the estimator. In this example, the estimator would end up doing twice as much work, but it would return twice as many results per second with full accuracy.
A basic implementation of this could be done entirely in the existing PitchEngine class, without altering the interface used by the Estimator. A more advanced implementation could be done down the road using algorithms better suited for real-time audio processing (i.e. adding incremental data without reprocessing the whole window).
Would this kind of feature be welcomed in this project? If so, I could write this real quick and submit a pull request.
Are there any plans to add a MacOS target? I'd love to use this for a desktop application I am building.
First of all, great library -- it's really helpful.
One problem is puzzling me right now:
I get this error sometimes (NOT ALWAYS) when I try to stop the pitch engine, which leads me to think it's some sort of memory issue.
The offending code:
Any advice regarding this (especially if the problem's on my end) would be appreciated!
This doesn't seem to be maintained anymore. Recommendations for suitable replacements would be helpful in this request & to leave open for discoverability. And/or add to README documentation
(Not really an issue)
From my "real-world" tests, the default configuration works very well with an electric guitar plugged in an amp with no effects. However, I tried with a acoustic one, and while pitch detection is still accurate for the higher strings, it's consistently wrong with the lower ones (open low E is detected as B3, open A is E4...). Do you have any pointers to other pitch detection algorithms that would be worth looking into ? I've already skimmed through the wikipedia page.
(add: the Fender Tune app works perfectly with that same guitar).
Hi, currently the library crash in simulator.
Example App crashes when trying to open the Microphone on Simulator.
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.