I'm a PHP programmer whose decided to take the plunge into C++ by developing a simple alternative to MissWatson that would allow me to, via the command line with PHP, process a MIDI file through a VST.
I started with the Steinberg VST SDK and I've been using this MIDI library: https://ccrma.stanford.edu/software/stk/index.html.
I'm stuck on vectors, specifically the vectors that would store the MIDI events into. Here's the last bit of code to clean up (keep in mind I'm a total noob to C++ and am probably doing most of this wrong):
std::string midiPath = "C:\\creative\\midi\\m1.mid";
if (argc > 1) {
midiPath = argv[1];
}
//MidiFileIn::MidiFileIn(midiPath);
stk::MidiFileIn::MidiFileIn(midiPath);
//std::vector<_Ty> * midiEvents;
std::vector<_Ty> midiEvents(200);
stk::MidiFileIn::getNextEvent(midiEvents, 0);
//char* midiEvents[200];
//VstEvents* midiEvents;
//processMidi(effect, VstEvents*);
const char* wavPath = argv[2];
//processAudio(effect, 0, x, x);
and here are the errors:
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(370): error C2065: '_Ty' : undeclared identifier
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(370): error C2514: 'std::vector' : class has no constructors
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(480) : see declaration of 'std::vector'
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(372): error C2664: 'stk::MidiFileIn::getNextEvent' : cannot convert parameter 1 from 'std::vector' to 'std::vector<_Ty> *'
1> with
1> [
1> _Ty=unsigned char
1> ]
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>
So, how do I use the _Ty constructor? Am I on the right track or just crazy?