Tuner - Frequency Detector, Musical Note.

Tuner
Captures audio in real time, analyzes its frequency and determines the corresponding pitch (musical note) based on equal temperament.

tuner


StartTuning

Starts audio capture and tone detection.

component_method (41)


StopTuning

Stops audio capture and tone detection.

component_method (42)


ToneDetected

Fired whenever a tone is detected in the captured audio.

component_event (22)

  • frequency: The detected frequency in Hertz (Hz).
  • note: The corresponding musical note, such as "C4" or "A#3", using the equal temperament system.

PermissionError

Fired if the necessary permissions to access the microphone have not been granted.

component_event (23)

  • Useful for notifying the user that they must grant permissions before using the extension.

Frequencies are detected with the help of FFT (Fast Fourier Transform), and notes are calculated relative to the standard frequency of A4 = 440 Hz.



Here's how you can apply for the permit and get started after it's granted.

blocks (85)

If the function is not going to be used at initialization, there is no need to set StartTuning in Initialize .


aiaProject:
Tuner.aia (4.3 MB)

Extension:
joejsanz.joedevtuner.aix (4.4 MB)


Thanks.

11 Likes

I was looking for such an extension since 2022, very nice one. I can use it in my projects now!

1 Like

I'll definitely try it. Well done once again :clap:

1 Like

Thanks a lot @AyProductions & @JEWEL

It still has some details to improve, but for now there it is.

I divided what was going to be a single extension into 3 extensions, I will probably upload the other 2 tomorrow.

2 Likes

Another very good extension, which will be very useful to me because I am an experienced guitarist!

Thank you so much,
Nico

2 Likes

Hola @Joejsanz , Felicitaciones por OTRO nuevo logro. Sigue asĂ­.
Pd. Como podría comunicarme directamente con vos, para hacerte unas consultas. No puedo hacerlo a través de tu perfil por que es privado.
Gracias por todos tus aportes.

2 Likes

Thanks a lot @nico , I am also a guitarist :sunglasses::guitar:

Muchas gracias @German_Skena.

2 Likes

Hello
Thanks @Joejsanz for your work.
I've got two issues :

  • I have had difficulties to understand which autorisation I needed and then to force the app to ask for it. Maybe you could add some documentation on that ?
  • The frequencies do not match the octave. For a measured frequency of 220Hz it says A3 instead of A2 (according to wiki)

I also noticed that it seems more sensible to higher frequency than lowest, and it get stuck on the harmonics. For exemple, if I play an E2, it says briefly E2, then E3 and E4. I don't hear such an evolution. Weird...

from the "wiki"

image

A3 is 220hz, A2 is 110hz (A1 is 55hz, A0 is 27.5hz)

Hello

That's right, I forgot to add that they have to request permission because I was testing it with another extension that requested permission.

Here's how you can apply for the permit and get started after it's granted.

blocks (85)

If the function is not going to be used at initialization, there is no need to set StartTuning in Initialize.


I'll check that out to find a solution as soon as I grab my guitar, I'm far from home right now.


I'll check that out too.


Thanks Eve.

(FYI @Joejsanz)

Hi

Well, I'm not a specialist, but from I get, there are different definitions for the octave number. So 440Hz is an A3 in latin and midi notations and an A4 in german notations. That's why I obtain different frequencies on google for A2 and A3.

From here

What instruments are you using? Piano or guitar? I did the tests on the guitar, and you are right, it is very sensitive to sound. I am showing you some results I had on the guitar with its pitch and frequency. A3 is 220 Hz and A2 is 110 Hz, but I am going to look into the German thing.