actual codes/files of codes where the actual playback of the score occurs
I have a project wherein I will be using the notes information, tempo, pitch, duration and lyrics as an input to produce a voice synthesis. I would like to know where the actual codes/files of codes where the actual playback of the score occurs, where the blue bar reads each segment and produce the midi sound on each staff. It would be a big help if you can show me around those files and codes.
Thanks!
Comments
I'd look at rendermidi.cpp
In reply to I'd look at rendermidi.cpp by Jojo-Schmitz
is that on the source code folder under the libmscore?
Thanks for this. It will be a head start for me. I'll just ask follow up questions if I have.
Thanks again!
In reply to is that on the source code… by ka_giroy
Haven't checked but yes, that's where it should be.
FWIW, one thing you'll find is that it doesn't actually work the way you described - it's not a question of the cursor reading each staff as it moves. Instead, everything is pre-generated, one staff at a time, before you hear a sound. The cursor really is just "following" this pre-generated playback.
In reply to FWIW, one thing you'll find… by Marc Sabatella
how exactly the cursor "follows" the pre-generated playback?
is it something like if you have 4 staves, it will start generating the midi sound of the note/chord/rest in the first staff, then followed by the note/chord/rest in the second staff to the 4th staff, then the musescore will play that segment, then goes with the next set of note/chord/rest on the first to 4th staff, is that right? did i make sense?
In reply to how exactly the cursor … by ka_giroy
UNless you are trying to do something that involves real-time interaction with other processes or hardware, you really don't need to be concerned with any of this. Almost everything having to do with converting the notes in a score to MIDI playback instructions happens during this re-rendering phase, within the rendermidi.cpp. So I suggest you start by delving into the code, reading it, working through it live under a debugger, etc. That should answer most of your questions. Then if there is some particular point that is still not clear, you can ask with respect to specific lines of code there and people should be able to help better.