*edit : replaced my large piece of code by a minimal complete issue
Hello, I need some help to build a midi file, here is what I want to do :
Read a music (monophonic) file - OK
Detect pitches and offsets - rougthly OK
Translate to midi note number - OK
Put note events in a midi file - KO
The final purpose is to create a "whistle to midi" app.
Here is a test code for midi writing (sorry for duplication and length), it compile and run but the midifile is unreadable by sequencers or synthetisers (vlc) :
I am doing a meticulous search on the forum, and I just find one interesting ressource, here is the link for those who are interested: http://www.juce.com/forum/topic/midi-file-smpte-time-format-bug
To assign instruments, use MidiMessage::programChange
I'd recommend http://www.skytopia.com/project/articles/midi.html for an explanation of the midi file format.
From there you can also download a minimalistic piece of music to compare your midi file with:
http://www.skytopia.com/project/articles/midi/cde2.mid
And the result was OK but repeated multiple times, that was due to how I use the file as a stream, resulting in adding to previous results, making the file corrupted.
The last thing I need to figure out is how to manipulate the juce version of timestamps.