0

I´m working on a platform to teach how to read/write sheet music.

So far, It´s been "easy"* to figure out a system in which people select the minimal rhytmic units to WRITE some music, but I dont know even how to start to other direction of this process: how to create an input system to provide activities in which students could READ and tap some rhytms on the keyboard. Of course, my objective is to capture the time interval between taps in relation to beats. In other words....how to measure the time between taps.

I know softwares like EarMaster or GNUSolfege figured this out. Any help would be much appreciated.

Thanks people :)

*"easy" because I´m a pianist/psychologist. All the PHP and JQuery and MySQL recently added to my life are still some hard/exciting things to understand.

1 Answers1

0

Say you have a button. That button will have some method that runs when you tap it. What you will want to do is get the current time, it will depend on your language/platform but there is typically some built-in method. This will be in Unix time, which is the number of seconds that have elapsed since jan 1 1970 (or milliseconds). So each time a user taps the button, get that time (an integer of milliseconds) and store it / match it against the tempo.

This sounds easier if you have a pre-defined tempo. Just convert beats-per-minute into milliseconds-per-beat, and you would have a repeating timer in the app that plays a sound or flashes a color after that many milliseconds.

This is probably an unsatisfying answer, and generally, stack overflow should be used for questions that specifically relate to code. So when you know what language you are using and you start to implement this feature, if you run into problems, try asking this question again with your code / a minimal version of it and you will likely get a better answer.

Kris
  • 3,091
  • 20
  • 28
  • 1
    Man, you´re absolutely right. Here is a place for code related questions, but since I didnt know where to start, I took my chances and you helped A LOT. A couple things you said opened a bunch of posibilities for me to start my searches. I´m already having fun here with unix time (had no idea about this) and it looks really promising. Thanks for your help! – Junior Leme Feb 13 '20 at 02:58