Midi chord plugin , xml files , saving presets , midibuffer threads

Hi all,
I am working on this midi chord VST plugin with JUCE.


It works as I want to play through chord progressions with midi notes.
At the moment it only plays one chord progression which is declared globally by the programmer in the pluginprocessor.cpp

vector< vector<int> > chords {
    { 41, 48 , 55, 56, 58, 63 },
    { 44 , 51 , 56, 58 , 61, 63 } } ///etc 

I have been thinking of ways I would like to easily create and save chord progressions.

I wrote a little c++ program that just allows you to enter the note numbers. One option is to figure out how to export an xml from that with the data structure and then figure out how to import it into the JUCE program.

What would be more fun was if I could hack this tutorial https://docs.juce.com/master/tutorial_handling_midi_events.html
and the MidiKeyboardComponent
to “play in” the progression.

I thought that it could be played one note at a time. Playing a note twice would signal that a new chord should start and playing a note 3 times would signal the end of the progression.

My code uses a midi note to turn on “latch mode” where note on’s and note offs are kind of reversed.

I thought another midi note could allow you to start recording a new chord sequence.

Is it possible to say have the user click a B midi note 59 and a window pops up to load a new xml file ?

perhaps a load button in the gui would be a better option ?

I don’t know much about pop up windows etc everything I have created before just waits in a loop and does stuff …

I scoured the internet trying to find a simple piano keyboard gui that would output midi note numbers with mouse clicks on a keyboard but it seems like the JUCE one is probably the easiest to use.

I also thought of some separate standalone JUCE built application for creating the chord progressions and saving them as xml files.

How can I save that vector as a file and open it inside a VST plugin ?

Sorry for the meandering post.

How would all you smart folks do this?

Sean

Users will probably like it more if you just allow doing everything in the plugin.

1 Like

That would be great. I worry it might take me a year to figure out how to do that!

If you could do a standalone Juce application to do it, there shouldn’t be any reason you couldn’t do it just as well within a plugin. Maybe you are overcomplicating things in your mind?

Thanks there is probably a simple way to do it …
One simple way is just to give the user a textbox with instructions I guess
https://docs.juce.com/master/classTextEditor.html#details
and then clean and parse the string into the std::vector …
It would be nice to make a more interactive input box.
Perhaps I will start with the simple text box and work towards something prettier.