#include "matching.h"
Functions | |
void | all_notes_off () |
int | has_accompaniment (Link *links, int delta_time) |
void | update_clocks () |
long int | get_current_time () |
void | after_match (Link link, Link *links) |
void | matching () |
void all_notes_off | ( | ) |
This function sends a 'Note Off' event for all the notes that may be sounding.
int has_accompaniment | ( | Link * | links, | |
int | delta_time | |||
) |
This function checks if there is any note between the delta time of the current position of each track and new delta time. It returns 1 if there is and 0 if there is not.
void update_clocks | ( | ) |
This function updates all the global variables that store the clocks values.
long int get_current_time | ( | ) |
This function gets the current computer time and returns its value in milliseconds.
This function handles the execution of the program after a match has been detected.
void matching | ( | ) |
This function is the kernel of this program. We can divide it into four parts: (1) first, it handles the musician input in real time; (2) compares it with the score using the LCS problem algorithm; (3) updates the virtual clock according to the musician's tempo; (4) plays the accompaniment given the evolution of the virtual clock.