MIDI Sequencer VST plugin

New user here. I would like to implement a MIDI Sequencer VST plugin using Juce.

I am also new to VST development, and I am abit confused about which would be best approach for:

  1. safely and bidirectionally accesssing MIDI-notes data, from the process function and the UI interface. The process function will be reading the data. The UI interface will be writing the data, which I started implementing as a std::multiset (although I am still not sure it’s the best choice).

  2. safely allocate new MIDI-notes data from the UI thread.

Thanks for any comment or suggestion.