Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
How to look for patterns in numbers in javascript?

Given any array of numbers, similar in nature to the following:

[48, 60, 64, 67, 72]

I want to be able to evaluate this(or any) series of numbers and look for musically meaningful patterns, and I'm not sure how to start going about it.

For example, if I subtract 48 from every number I would get this:

[0, 12, 16, 19, 24]

...one will notice that the 1st, 2nd and 5th numbers are 12 apart from each other, which is a meaningful pattern in music, as 12 steps is one octave. This is one of the things I would want to be able to figure out by just looking at the numbers.

Now, if I take the middle three numbers and subtract 12 from each one I get:

[0, 4, 7]

...which is the numerical pattern of steps on a keyboard that would create a Major Triad, which is another example of something I would want to be able to evaluate from a series of numbers.

So, in the end, the original series of numbers:

[48, 60, 64, 67, 72]

...represents the following musical notes:

[`C2`, `C3`, `E3`, `G3`, `C4`]

...which is a C Major Triad C3, E3, G3 with the root doubled down one octave C2 and doubled up one octave C4 as well.

What I want to do is write some code that takes in any series of midi message numbers, like the example above, evaluates them, then tells the user what musical entity they have played, including inversions, doublings, other possible interpretations, etc...

There would be a database/dictionary/object/array/data-thing of some type that contains many different patterns, then the code would compare the incoming numbers to this set of patterns to find the correct one(s)...

Not looking for code answers as much as an idea as to how to go about even getting started with such a thing in javascript, as this would be for the web...

I just don't really have any idea how to start going about this, but any thoughts or examples or resources that could point me in the right direction would be most appreciated.

Thanks! XD

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda