Slins-23 / flutter-fft

Flutter pitch detection/audio processing plugin, personalized for my guitar tuner application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What does variables in'data' mean?

AsashioB opened this issue · comments

While using, I find that data has 11 returned variables. I only know the meaning of data[1], data[2] and data[5], but I want to know what do other variables mean? Such like data[4] and data[5].
Thanks.

0 - tolerance: Error tolerance (HZ)
1 - frequency: Detected frequency (HZ)
2 - note: Detected note (String)
3 - target: Target note (HZ. Frequency of the note that is closest to this note in the target tuning. If there's no target tuning, this frequency will be the one that's closest to the note detected)
4 - distance: Absolute distance between detected and target note (HZ)
5 - octave: Detected note's octave (Integer)
6 - nearestNote: Note that is the closest to the current detected note (String)
7 - nearestTarget: Frequency of the note that is the closest to the current detected note (HZ. It seems that this will only differ from the original target if there's no current tuning target)
8 - nearestDistance: Absolute distance between detected note and the nearest note (HZ)
9 - nearestOctave: Octave of the note that is the closest to the current detected note (Integer)
10 - isOnPitch: Whether it is considered on pitch (Boolean. If the current detected frequency is within tolerance of the nearest target note's frequency)

You can find them being referenced as return values starting in the line 67 of this file: https://github.com/Slins-23/flutter-fft/blob/master/android/src/main/java/com/slins/flutterfft/PitchModel.java

Note that I haven't touched this code in a while and I just went through it for about half an hour to figure this out, so it's likely that I might be wrong somewhere, but that's the general picture.