Detect Guitar Chords

Back to General discussions forum

sam_bandara     2023-08-03 04:47:19

Hello Experts,

This subject doesn't relate to any ongoing tasks, but given the diverse expertise here, I'd like to present this issue. I apologize for going off-topic. My two sons, aged 11 and 13, are participants in the "First Lego League" competition. The theme for this season is "Masterpiece," involving connections between art and music. As a component of the competition, they are required to present an innovative project.

They asked me a question that I have no clue about.

Is there a potential method for real-time identification/recognition of guitar chords (not individual notes)? Their concept involves generating a series of vibrations that correspond to each chord while playing the guitar, aiming to assist individuals with hearing impairments.

Cheers, Sam.

Rodion (admin)     2023-08-03 05:50:55
User avatar

Hi Sam!

Curious idea! Regretfully it is such a topic in which you would like opinion of someone who actually tried something similar :)

I'm definitely not expert in the field, just tried something about sounds/notes recognition myself and can share some observations.

In theory it is very easy, if several harmonic sounds are playing simultaneously, one uses Fourier Transform to get a kind of "spectrum", to figure out which frequencies are heard. Despite strange formulas the idea is as simple as multiplying digitized sound sequence by sine wave and getting parameters from the result, you probably can find better explanation or numerous ready libraries for various programming languages.

Difficulties arose from working with real sound, particularly:

  1. Algorithm gives the more precision the longer sound sample is processed (it's a kind of general law coming perhaps from information theory, so it doesn't mean other magic algorithm may work better), but with real guitar "strums" could be pretty short.

  2. As with many musical instruments, guitar sounds, even from vibration of single string, contain several harmonics (overtones), which, when played simultaneously, will create complete mess on your spectrum chart and the task of "splitting" such "intervowen" spectrum into sounds of separate strings becomes non-trivial and requiring good study.

If by chance you have seen Sound-Controlled Robot problem, there is a short video of the thing moving by the whistles of recorder (flute). Even in this simple project both of the issues are noticeable - it won't react if sounds are too short (issue 1) and it won't work if we play harmonica instead (it produces much more overtones compared to recorder - issue 2). Though honestly that robot used simplified algorithm and low sampling rate due to its limited resources.

Thus to conclude, I believe that's doable and some results worth demonstrating could be achieved, but it may be quite difficult to make it practical. Thus your sons may prefer to simplify the task in some way to match their skills and amount of time they have :)

sam_bandara     2023-08-03 06:26:39

Hi Rodion,

Thanks for the explanation. I totally agreed. This is a such big project. But what I thought is, if someone has already done the first part of the project (detecting the chords), then we do not need to reinvent the wheel. We can just build only the second part of the project based on the output of the detecting program.

Cheers,

Please login and solve 5 problems to be able to post at forum