Skip to main content
Log in

A template-based algorithm by geometric means for the automatic and efficient recognition of music chords

  • Special Issue
  • Published:
Evolutionary Intelligence Aims and scope Submit manuscript

Abstract

In this work, we introduce a template-based computational method to recognize chords through an audio recording of a musical instrument. The algorithm is based on a temporal frequency analysis using Gabor’s filter banks. These filters are centered over adjusted frequencies of musical notes in different octaves and the adjustment is accomplished in terms of the detunings on the recording. Using the results in the filtering stage, a geometric mean of each chord is calculated. It is important to mention that these statistics are calculated from the combination of notes that form each chord and are automatically grouped as templates. The presence of chords is determined from these metrics. Several experiments are carried out for major, minor, augmented, diminished and suspended chords played on acoustic guitar, classic guitar, electric guitar, piano and ukulele. A comparative study against machine-learning classifiers is presented. The results show a superior performance of the present approach. In addition, the proposed method presents the advantage that it does not require a training stage, in contrast with the methods based on machine-learning algorithms. This reduces significatively the storage and time requiered for processing.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

Availability of data and materials

Data available on request from the corresponding author.

Code availability

Code available on request from the corresponding author.

References

  1. Fenrich P (2014) Practical principles of instructional design, media selection, and interface design with a focus on computer-based training/educational software. Informing Science, Santa Rosa

    Google Scholar 

  2. Simon I, Morris D, Basu S (2008) Mysong: automatic accompaniment generation for vocal melodies. In: Proceedings of the SIGCHI conference on human factors in computing systems, pp 725–734

  3. Herrera-Boyer P, Klapuri A, Davy M (2006) Automatic classification of pitched musical instrument sounds. In: Signal processing methods for music transcription. Springer, Boston, pp 163–200

  4. Downie JS (2003) Music information retrieval. Ann Rev Inf Sci Technol 37(1):295–340

    Article  Google Scholar 

  5. Müller M (2015) Fundamentals of music processing: audio, analysis, Algorithms, Applications. Springer, Switzerland

    Book  Google Scholar 

  6. Muller M, Ellis DP, Klapuri A, Richard G (2011) Signal processing for music analysis. IEEE J Select Top Signal Process 5(6):1088–1110

    Article  ADS  Google Scholar 

  7. Micchi C, Kosta KEA (2021) A deep learning method for enforcing coherence in automatic chord recognition. In: Proceedings of the 22nd international society for music information retrieval conference (1), pp 443–451

  8. Mabpa P, Sapaklom T, Mujjalinvimut E, Kunthong J, Na Ayudhya PN (2021) Automatic chord recognition technique for a music visualizer application. In: 2021 9th international electrical engineering congress (iEECON), pp 416–419

  9. O’Hanlon K, Sandler MB (2021) Fifthnet: structured compact neural networks for automatic chord recognition. IEEE/ACM Trans Audio Speech Lang Process 29:2671–2682

    Article  Google Scholar 

  10. Li T (2021) Study on a CNN-HMM approach for audio-based musical chord recognition. J Phys Conf Ser 1802(3):032033

    Article  Google Scholar 

  11. Ru Y (2021) Computer assisted chord detection using deep learning and YOLOV4 neural network model. J Phys Conf Ser 2083(4):042017

    Article  Google Scholar 

  12. Rarità L, Stamova I, Tomasiello S (2021) Numerical schemes and genetic algorithms for the optimal control of a continuous model of supply chains. Appl Math Comput 388:125464

    MathSciNet  Google Scholar 

  13. de Falco M, Gaeta M, Loia V, Rarita L, Tomasiello S (2016) Differential quadrature-based numerical solutions of a fluid dynamic model for supply chains. Commun Math Sci 14(5):1467–1476

    Article  MathSciNet  Google Scholar 

  14. Wu Y, Carsault T, Nakamura E, Yoshii K (2020) Semi-supervised neural chord estimation based on a variational autoencoder with latent chord labels and features. IEEE/ACM Trans Audio Speech Lang Process 28:2956–2966

    Article  Google Scholar 

  15. Shukla S, Banka H (2018) An automatic chord progression generator based on reinforcement learning. In: 2018 international conference on advances in computing, communications and informatics (ICACCI), pp 55–59. IEEE

  16. Tomasiello S (2011) A functional network to predict fresh and hardened properties of self-compacting concretes. Int J Numer Methods Biomed Eng 27(6):840–847

    Article  Google Scholar 

  17. Bando Y, Tanaka M (2022) A chord recognition method of guitar sound using its constituent tone information. IEEJ Trans Electr Electron Eng 17(1):103–109

    Article  Google Scholar 

  18. Tomasini MC (2007) El fundamento matemático de la escala musical y sus raíces pitagóricas. C &T Universidad de Palermo, pp 15–27

  19. Meyer J (2009) Acoustics and the performance of music: manual for acousticians, audio engineers, musicians, architects and musical instrument makers. Springer, Berlin

    Book  Google Scholar 

  20. Lárez V (2010) Armonía. Universidad Nacional Experimental de las Artes-UNEARTE, Caracas

    Google Scholar 

  21. Schmidt-Jones C (2013) Understanding basic music theory. Rice University, Houston

    Google Scholar 

  22. International Organization for Standardization: ISO/IEC 13818-3:1998. ISO (1998)

  23. Kamagalakshmi KEC (2014) Log-Gabor orientation with run-length code based fingerprint feature extraction approach. Glob J Comput Sci Technol 14(1)

  24. Mehrotra R, Namuduri KR, Ranganathan N (1992) Gabor filter-based edge detection. Pattern Recognit 25(12):1479–1494

    Article  ADS  Google Scholar 

  25. Guerrero J, Marroquin J, Rivera M, Quiroga J (2005) Adaptive monogenic filtering and normalization of ESPI fringe patterns. Opt Lett 30(22):3018–3020

    Article  CAS  PubMed  ADS  Google Scholar 

  26. Galton F (1879) Xii. the geometric mean, in vital and social statistics. Proc Royal Soc Lond 29(196–199):365–367

    Google Scholar 

  27. Learned-Miller EG (2014) Introduction to supervised learning. I: Department of Computer Science, University of Massachusetts

  28. Ligges U, Preusser A, Thieler A, Mielke J, Weihs C et al (2018) Package ‘tuner’. https://cran.r-project.org/web/packages/tuneR/tuneR.pdf. Accessed 15 Apr 2022

  29. Breiman L (1996) Bagging predictors. Mach Learn 24(2):123–140

    Article  Google Scholar 

  30. Peters A, Hothorn T, Hothorn MT (2009) Package ‘ipred’. R Package, 2009

  31. Quinlan C (1993) Programs for machine learning morgan kaufmann. San Francisco

  32. Kuhn M, Weston S, Culp M, Coulter N, Quinlan R (2015) Package ‘C50’. CRAN, UTC

  33. Breiman L, Friedman J, Olshen R, Stone C (1984) Classification and regression trees. Wadsworth Int Group 37(15):237–251

    Google Scholar 

  34. Therneau T, Atkinson B, Ripley B, Ripley MB (2015) Package ‘rpart’. Available at: cran.ma.ic.ac.uk/web/packages/rpart/rpart.pdf. Accessed on 20 April 2016

  35. Breiman L (2001) Random forests. Mach Learn 45(1):5–32

    Article  Google Scholar 

  36. RColorBrewer S, Liaw MA (2018) Package ‘randomforest’. University of California, Berkeley

  37. Friedman JH (2001) Greedy function approximation: a gradient boosting machine. Ann Stat 29:1189–1232

    Article  MathSciNet  Google Scholar 

  38. Greenwell B, Boehmke B, Cunningham J, Developers G, Greenwell MB (2019) Package ‘gbm’. R package version 2(5)

  39. Zhang H (2004) The optimality of Naive Bayes. AA 1(2):3

    Google Scholar 

  40. Meyer D, Dimitriadou E, Hornik K, Weingessel A, Leisch F, Chang C-C, Lin C-C, Meyer MD (2019) Package ‘e1071’. R J

  41. Hastie T, Tibshirani R, Buja A (1994) Flexible discriminant analysis by optimal scoring. J Am Stat Assoc 89(428):1255–1270

    Article  MathSciNet  Google Scholar 

  42. Hastie MT (2020) Package ‘mda’

  43. Ripley B, Venables W, Ripley MB (2016) Package ‘nnet’. R Package Vers 7(3–12):700

    Google Scholar 

  44. Ripley BD (2007) Pattern recognition neural network. Cambridge University Press, New York

    Google Scholar 

  45. Cunningham P, SJ D (2007) k-Nearest neighbour classifiers. Mult Classif Syst. Springer

  46. Ripley B, Venables W, Ripley MB (2015) Package ‘class’. The Comprehensive R Archive Network 11

  47. Hastie T, Tibshirani R, Friedman J (2008) The elements of statistical learning; data mining, inference and prediction. Springer (2009)

  48. Venables WN, Ripley BD et al (1999) Modern applied statistics with S-PLUS. Springer, New York

    Book  Google Scholar 

  49. Ripley B, Venables B, Bates DM, Hornik K, Gebhardt A, Firth D, Ripley MB (2013) Package ‘mass’. CRAN R 538:113–120

    Google Scholar 

  50. Team R Core (2013) R: a language and environment for statistical computing. Vienna

  51. Linardatos P, Papastefanopoulos V, Kotsiantis S (2020) Explainable ai: a review of machine learning interpretability methods. Entropy 23(1):18

    Article  PubMed  PubMed Central  ADS  Google Scholar 

  52. Molnar C (2020) Interpretable machine learning. Lulu. com, Berlin

    Google Scholar 

Download references

Funding

The corresponding author (J.E.M.-D.) acknowledges the financial support from the National Council for Science and Technology of Mexico (CONACYT) through Grant A1-S-45928.

Author information

Authors and Affiliations

Authors

Contributions

The authors contributed equally to the work.

Corresponding author

Correspondence to Jorge E. Macías-Díaz.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Hernández, R., Guerrero, A. & Macías-Díaz, J.E. A template-based algorithm by geometric means for the automatic and efficient recognition of music chords. Evol. Intel. 17, 467–481 (2024). https://doi.org/10.1007/s12065-022-00771-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12065-022-00771-6

Keywords

Navigation