I understand that there are a number of similar questions, but I believe that my situation is unique enough to justify my own post.
I am working on a “visual guide” - I created a program that tracks human hand gestures and extrapolates the tempo (in beats per minute) from these gestures. Now I would like to display the measured tempo in a MIDI file that plays while a person is conducting. In principle, I would like the program to allow someone to conduct a synthesized play, where the tempo of the file being played depends on the gestures of the explorer in real time. I wrote this in C ++ using the OpenCV libraries.
Here, where things get interesting / hairy. Changing the tempo of a MIDI file directly is a daunting task, and given the limited time I left this summer, I decided to look elsewhere. I managed to find the Sequencer interface in the Java API, which has an excellent method called setTempoinBPM . He does exactly what I need; I just failed to get it working in my C ++ code.
I tried to create my own JVM to call Java methods in C ++ code, but to no avail. I also tried calling Java programs by passing the appropriate command line arguments to system() , but I cannot change the tempo of the MIDI file after starting playback using this approach.
I am considering converting my C ++ code to Java code to directly call setTempoinBPM() , but I have heard conflicting messages about whether this will affect OpenCV performance.
I would like your opinion: the performance of OpenCV in Java is comparable enough to its performance in C ++, which would turn my project into Java? (If you happen to know how easy it is to change the tempo of a MIDI track, feel free to share it.)
source share