Hey everyone, I've started working on a little personal project at the moment. My kids both recently started up at a new school and they are both taking music classes for the first time ever. One is playing trumpet and the other clarinet; since the rest of the students have a year or two lead in practice I was hoping I could maybe build them something in Vuo to help them out a little. What I was thinking was to make them a Visual Electronic Music Tuner that would show them the note they were playing and give them visual feedback on how close they are to the note they are trying to play.

A few nodes of interest were Split Audio by Frequency, Calculate Loudness (so I can pull the dominant frequency from the microphone audio sample) and the Find Maximum nodes. I've also made an XML file with the frequencies of all the notes and octaves in the Major Scale that correspond to the MIDI nodes that VUO has (I figured it would keep things simple if I use the same numbering scheme in my lists that MIDI uses for it's notes), so there are a total of 128 notes, almost 11 full octaves, although the instruments they are playing will only span about 6 of those octaves.

What I was hoping to do what take the input microphone audio sample and find the dominant frequency and hopefully cross-reference that to nearest frequency in the XML file and pull the appropriate Note and Octave to display on the screen with an indicator of some type that shows how close they are to hitting the nearest note. It would hold the results for a set period of time or until a new sound that broke the threshold was heard. I've attached a file showing the direction I was going during testing but it's not working for some reason and it's going to be very node and cable heavy doing it this way. Is there a simpler way of doing this that I'm overlooking? Also can anyone see the flaw(s) in my composition? Any help or advice is appreciated! Thanks.


Pitch detection is an

jstrecker's picture
Submitted by

Pitch detection is an interesting and difficult problem :) The way that brains perceive sound is weird, and not always what you would expect from looking at an FFT. A sample FFT of a clarinet and a trumpet are here (p. 125-126).

Rather than trying to tackle the whole MIDI range, I'd recommend starting with an octave or less, and see how that goes. Like, if you know the note being played is somewhere within that octave, does the highest-amplitude frequency within that octave correctly detect the note?

In your composition, I'm suspicious that maybe Split Audio by Frequency doesn't know what to do with all those zeroes. It might be assuming the input will be a list of positive, increasing numbers.